How to solve a system of three ODE
조회 수: 6 (최근 30일)
이전 댓글 표시
I was looking into epidemiology, and I came to a system of three ODEs to solve the spread. For the life of me I can't remember how to do this in Matlab. Here is my system, with the initial conditions.
S(0) = 19,465,197
E(0) = 0
I(0) = 0
dS/dt=-147199.4991*S+10*S*I
dE/dt=10*S*I-147203.5121*E
dI/dt=4*E-147199.5197*I
댓글 수: 0
답변 (2개)
Benjamin Schwabe
2012년 6월 15일
Hi James,
start writing it in a vectorform with x=(S,E,I); Then you have x(0)=x0 as defined and you can write dx/dt=f(x); create a function doin this. the you might use ode45 oder another ode solver for you problem. The help is quite detailed here.
Hope that helps, Benjamin
댓글 수: 0
Walter Roberson
2012년 6월 15일
WIth the symbolic toolbox, it would look somewhat like
syms S(t) E(t) I(t)
dsolve(S(0) == 19465197, E(0) == 0, I(0) == 0, diff(S(t), t) == -1.471994991*10^5*S(t)+10*S(t)*I(t), diff(E(t), t) == 10*S(t)*I(t)-1.472035121*10^5*E(t), diff(I(t), t) = 4*E(t)-1.471995197*10^5*I(t))
with solution
E(t) = 0, I(t) = 0, S(t) = 19465197*exp(-147199.4991*t)
댓글 수: 0
참고 항목
카테고리
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!