Quantcast
Channel: Latest Discussions - COMSOL Forums
Viewing all articles
Browse latest Browse all 5773

how to use Prev(.) function during simulation? How to write FOR loop in comsol for simulation?

$
0
0

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?


Viewing all articles
Browse latest Browse all 5773

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>