Solution of DAE-System is too linear
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (1)
Torsten
le 31 Mar 2022
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
Voir également
Catégories
En savoir plus sur Ordinary Differential Equations dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!