Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.
how to use Prev(.) function during simulation? How to write FOR loop in comsol for simulation?
Posted 20 set 2020, 06:02 GMT-4 Computational Fluid Dynamics (CFD), Microfluidics, Simulation Apps Version 5.5 1 Reply
Please login with a confirmed email address before reporting spam
Hi, Can you please help me out in using prev function to get back the dependent variables from last time step and use those in current timestep during simulation? in simply words how to make comsol work in For loop for certain dependent variables. my problem: theta(1)=0; for i=2:t { xA=c1-bsin(theta(i-1)); yA=c2+bcos(theta(i-1)); m=2(c1yA+c2xA); n=2(c1yA-c2xA); q=2xA^2+2yA^2+c1^2+c2^2-b^2; W=arccos(m/sqrt(m^2+n^2)); theta(i)=arccos(q/sqrt(m^2+n^2))-W; } end
How to write this FOR loop code in comsol? or is there any other ways to do the same task?