Solution of DAE-System is too linear

조회 수: 2 (최근 30일)
Georg Folwerk
Georg Folwerk 2022년 3월 31일
댓글: Georg Folwerk 2022년 3월 31일
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).

답변 (1개)

Torsten
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
  댓글 수: 1
Georg Folwerk
Georg Folwerk 2022년 3월 31일
Thanks a lot, that solved everything

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by