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 comentario

Walter Roberson
Walter Roberson el 3 de Jun. de 2021
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.

Iniciar sesión para comentar.

Respuestas (1)

Sulaymon Eshkabilov
Sulaymon Eshkabilov el 4 de Jun. de 2021
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 comentario

Walter Roberson
Walter Roberson el 4 de Jun. de 2021
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.

Iniciar sesión para comentar.

Categorías

Más información sobre Symbolic Math Toolbox en Centro de ayuda y File Exchange.

Preguntada:

el 3 de Jun. de 2021

Comentada:

el 4 de Jun. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by