2nd order differential equation

조회 수: 13 (최근 30일)
Carla
Carla 2011년 6월 25일
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

답변 (1개)

Walter Roberson
Walter Roberson 2011년 6월 25일
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

카테고리

Help CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by