Solution of DAE-System is too linear
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/948284/image.png)
% 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
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/948289/image.jpeg)
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 comentarios
Respuestas (1)
Torsten
el 31 de Mzo. de 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
Ver también
Categorías
Más información sobre Symbolic Math Toolbox en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!