2nd order differential equation

14 vues (au cours des 30 derniers jours)
Carla
Carla le 25 Juin 2011
Hi everyone
I'm modeling the cardiac valves and one of the equations used is a second order differential equation, which corresponds to the 14th expression mentioned in the pdf from this link: http://www.sciencedirect.com/science/article/pii/S0021929005002927
I tried to implement it in this way, however the values of teta_ao variable have to be between 5 degrees and 75 degrees. How can I put this condition when solving the equation with the ode45 command?
{function acelerteta_ao=f(t,w,Plv,Psas,Qao)
global Kp_ao Kf_ao Kb_ao Kv_ao; %Parameters related with the aortic valve opening
for j=1:klokmax
D=zeros(1,klokmax);
if(Qao>=0)
D(j)=(Plv-Psas)*Kp_ao*cos(teta_ao)-Kf_ao*w(2)+Kb_ao*Qao*cos(teta_ao)-Kv_ao*Qao*sin(teta_ao)
else
D(j)=(Plv-Psas)*Kp_ao*cos(teta_ao)-Kf_ao*w(2)+Kb_ao*Qao*cos(teta_ao)
end
acelerteta_ao=[w(2);D(j)]
end
end
}
{main.m
clear all
klokmax=180000;
t=[0 klokmax]
initialvalues=[5 0];
[t,w]=ode45(@f,t,initialvalues)
}
Thanks in advanced for any suggestion.
Carla

Réponses (1)

Walter Roberson
Walter Roberson le 25 Juin 2011
I am still fairly weak with the ode* solvers, but I wonder if perhaps using an "event" would be suitable for your purpose? See http://www.mathworks.com/help/techdoc/ref/odeset.html

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by