Solving non-linear differential system
Mostra commenti meno recenti

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 Commento
Walter Roberson
il 3 Giu 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.
Risposte (1)
Sulaymon Eshkabilov
il 4 Giu 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 Commento
Walter Roberson
il 4 Giu 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.
Categorie
Scopri di più su Symbolic Math Toolbox in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!