Solve a system of two differential equations symbolically

1 回表示 (過去 30 日間)
Conrado Santurino
Conrado Santurino 2020 年 4 月 6 日
コメント済み: Torsten 2020 年 4 月 6 日
Good evening, I'm trying to solve this system of two differential equations:
where r_x, r_y, alpha and beta are positive real parameters, by using this code:
syms x(t) y(t) rx ry alpha beta
ode1 = diff(x) == rx*x*(1-alpha*y);
ode2 = diff(y) == ry*y*(beta*x);
odes = [ode1; ode2];
S = dsolve(odes)
xSol(t) = S.x
ySol(t) = S.y
When I run the script, MATLAB returns me the following error:
Warning: Unable to find symbolic solution.
> In dsolve (line 216)
In [Name of the script] (line 59)
S =
[ empty sym ]
Dot indexing is not supported for variables of this type.
Error in sym/subsref (line 898)
R_tilde = builtin('subsref',L_tilde,Idx);
However, from what I've tried, it works if I change the original equations to this form:
and I run the code, but I need to solve the first ones, not these last.
Does anybody know how I can solve it?
Thanks in advance.
  3 件のコメント
Conrado Santurino
Conrado Santurino 2020 年 4 月 6 日
編集済み: Conrado Santurino 2020 年 4 月 6 日
And do you know any other way to solve it symbolically? Because I have used Runge-Kutta 4 integrator to have a numerical solution, but I also need to find the symbolical expression. Thanks.
Torsten
Torsten 2020 年 4 月 6 日
predator-prey equations don't have an analytical solution.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeSymbolic Math Toolbox についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by