Weird discrepancy while plotting solutions of ode systems

2 次查看(过去 30 天)
I am plotting the solutions of some ode systems which describe a biological model, but the graphs I got are a bit different from the ones presented in the papers. I am wondering if I am doing something wrong (maybe in interpreting the constants) or if it is possible that the same system may generate such different solution plots considering that I am using Matlab while the authors have plotted the graphs with Mathematica:

回答(1 个)

bio lim
bio lim 2015-9-20
Without looking at the code, I don't think it is possible for us to answer your question.
Judging from the graphs, I can only tell that you shifted the graph to the right side about 25 hours, and your graph, especially the Biomass (Y(:,1)) looks much smoother.
As for the softwares, I don't think there would be any difference.
  1 个评论
Viviana Arrigoni
Viviana Arrigoni 2015-9-20
Fine, well here's the model:
and here is my code. I first wrote this function in which the equations are described:
function dydt = firstsystem ( t, y )
dydt = zeros(4,1);
dydt(1)=((0.16 * y(2))/(0.01+y(2)) - 0.0001*y(3))*y(1);
dydt(2)=(-0.16 * y(2)/((0.01+y(2))*31))*y(1);
dydt(3)=(0.3*y(4)/(10+y(4)))*y(1);
dydt(4)=((-0.3*y(4))/((10+y(4))*0.47))*y(1);
and then this script:
tspan = [0 300];
yzero = [0.1 150 0 240];
[T,Y] = ode45 (@firstsystem, tspan, yzero);
plot (T,3*Y(:,1)/100,'m',T,Y(:,2),'g',T,Y(:,3),'b',T,Y(:,4),'c');
While plotting the first variable, I had to multiply it by 3/100, in order to obtain something more similar to the correst results.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Programming 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by