Weird discrepancy while plotting solutions of ode systems

1 view (last 30 days)
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:

Answers (1)

bio lim
bio lim on 20 Sep 2015
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 Comment
Viviana Arrigoni
Viviana Arrigoni on 20 Sep 2015
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.

Sign in to comment.

Categories

Find more on Programming in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!