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 个评论

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 个)

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 个评论

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 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by