How to run ode15s function for several times
3 次查看(过去 30 天)
显示 更早的评论
Thanks for taking the time to read this, I am new to matlab. The following four equations are what I need to solve them by ode15s:
eq1=diff(uc(t),2)==(-1/(L*(3*mc+4*h2*L*pi*a2*Ro)))*(3*(-Ft*L+4*h2*pi*a11*a2*(uc(t)+Beta*diff(uc(t)))+L*(alfa*mc*diff(uc(t))+pi*(p2(t)*a2^(2)-p1(t)*a2^(2)+2*h2*a12*(wr1(t)-wr2(t)+Beta*diff(wr1(t))-Beta*diff(wr2(t))))))+4*pi*h2*L^(2)*a2*alfa*Ro*diff(uc(t)));
eq2=(h2*L*a2^(2)*Ro)*diff(wr1(t),2)==(-h2*a12*a2*(uc(t)+Beta*diff(uc(t)))+L*(a2^(2)*p1(t)-h2*a22*(wr1(t)+Beta*diff(wr1(t))))-h2*L*a2^(2)*alfa*Ro*diff(wr1(t)));
eq3=(h2*L*a2^(2)*Ro)*diff(wr2(t),2)==(h2*a12*a2*(uc(t)+Beta*diff(uc(t))+L*(a2^(2)*p2(t)-h2*a22*(wr2(t)+Beta*diff(wr2(t)))))-h2*L*a2^(2)*alfa*Ro*diff(wr2(t)));
eq4=(pi*(L+uc(t))*(a1+wr1(t))^(2))*diff(p1(t))==(p1(t)-Bef)*((CD*Av*sqrt(2*(Bef-p1(t))*(p1(t)-p2(t))/(Bef*Rflu)))+pi*diff(uc(t))*(a2+wr1(t))^(2)+2*pi*(L+uc(t))*(a2+wr1(t))*diff(wr1(t)));
where uc,wr1,wr2,p1,p2 are state variables and mc,av Ft and t1 are fixed variables , all the other parameters are constant.
My problem is in the value of Ft=fo* sin(5000*t), for (t=0:0.63)sec then Ft=0 for (t=0.63:1)sec as a result for small increments I have 100 values of Ft and t1
I need to run my ode15s script 100 times for all 100 values of Ft and t1 then plot them in a single plot.
2 个评论
Jan
2017-11-13
Okay. Then use loops to do this. Did you try this already? What exactly is the problem?
回答(1 个)
Yogananda Jeppu
2017-11-13
Try a simple Euler integration. Xd = f(a,b,c ...). x = Xd*dt+x; store the values of x in an array. See if this works.
2 个评论
Steven Lord
2017-11-14
tamara hussien had flagged this answer as "Good idea".
"A flag is a request for review that any contributor can assign to content. Contributors with sufficient privileges can then review and potentially revise, close, or delete the flagged content.
Questions, answers, and comments can be flagged if unclear, not appropriate, or spam."
Since you seem happy with the suggestion, I'm going to remove the flag.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Ordinary Differential Equations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!