How to run ode15s function for several times
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Jan
el 13 de Nov. de 2017
Okay. Then use loops to do this. Did you try this already? What exactly is the problem?
Respuestas (1)
Yogananda Jeppu
el 13 de Nov. de 2017
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 comentarios
Steven Lord
el 14 de Nov. de 2017
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.
Ver también
Categorías
Más información sobre Ordinary Differential Equations en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!