Solution of DAE-System is too linear
1 回表示 (過去 30 日間)
古いコメントを表示
Hi guys, I have a homework assignment where I am supposed to use DAE systems to describe the ecological balance of forest stand, grass stand, bird population and insect population. I have implemented this, but I don't like my solution. It all looks so linear, which it shouldn't, and the bird population and insect population is growing far too slowly.
The equations in the task are as follows:
% Variable declaration
tspan = linspace(t1, t2);
% DGL-declaration
%x=x1; y=x2; z=x3
odefun = @(t,X) [ a*x*(1-(x/k))-h*x-f*y*(x/(x+d)); % DGL
b*y*(1-(y/(m*x*(k-x))))-g*z*(y/(y+e));
c*z*(1-(z/(n*x*y)))];
% Parameter declaration
x = 20; % Initial values
y = 0.001;
z = 0.0001;
conds = [x, y, z]; %Column vector for initial values (conditions)
% DGL solution
[t,X] = ode45(odefun, tspan, conds);
%plot the results
In case you are wondering where the insect population graph is, it is basically the bird population graph.
I hope you can help me find the error(s).
0 件のコメント
回答 (1 件)
Torsten
2022 年 3 月 31 日
a = ...;
b = ...;
c = ...;
k = ...;
h = ...;
f = ...;
d = ...;
m = ...;
g = ...;
e = ...;
n = ...;
odefun = @(t,x,y,z) [ a*x*(1-(x/k))-h*x-f*y*(x/(x+d)); % DGL
b*y*(1-(y/(m*x*(k-x))))-g*z*(y/(y+e));
c*z*(1-(z/(n*x*y)))];
x = 20; % Initial values
y = 0.001;
z = 0.0001;
conds = [x, y, z]; %Column vector for initial values (conditions)
t1 = ...; % integration period
t2 = ...;
tspan = linspace(t1, t2);
% DGL solution
[t,X] = ode45(@(t,X)odefun(t,X(1),X(2),X(3)), tspan, conds);
plot(t,X) % plot solution
参考
カテゴリ
Help Center および File Exchange で Ordinary Differential Equations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!