Solving non-linear differential system

I want to solve this non-linear differential system using matlab where :
sigma=2/3
mu=1/20
alpha=1/3
beta=2/3
gamma=1/3
b1=0
b2=0
b3=1/3
(S0,T0,I0,M0,R0)=(100000,50000,2753,2000,1645)

댓글 수: 1

Walter Roberson
Walter Roberson 2021년 6월 3일
If you have the Symbolic Toolbox, then that can make it easier to prepare the equations; after that you would follow the workflow in the first example in odeFunction() in order to construct a function handle to pass to a numeric solver.

댓글을 달려면 로그인하십시오.

답변 (1개)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2021년 6월 4일

0 개 추천

You can use: syms to introduce the variables and then employ dsolve to get symbolic solutions, e.g.:
syms S(t) M(t) I(t) T(t) R(t)
dS = diff(S, t);
dM = diff(M, t);
...
sigma=2/3
mu=1/20
...
EQN = [dS == -sigma*S*T+mu*T-b1*S, dT == sigma*S*T+mu*T-(mu+alpha)*TS, ..];
SOL = dsolve(EQN, S(0)==100000, T(0)==50000,..);
SOL.S % Solution: S(t)
SOL.T % SOlution: T(t)
...
fplot(SOL.S, [0, 15])
...

댓글 수: 1

Walter Roberson
Walter Roberson 2021년 6월 4일
dsolve() works well... until it doesn't.
There are a lot of systems that dsolve() cannot resolve symbolically. In those cases it may be necessary to use odeFunction() to convert the symbolic system to a function for numeric solution.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

질문:

2021년 6월 3일

댓글:

2021년 6월 4일

Community Treasure Hunt

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

Start Hunting!

Translated by