필터 지우기
필터 지우기

Weird discrepancy while plotting solutions of ode systems

조회 수: 3 (최근 30일)
Viviana Arrigoni
Viviana Arrigoni 2015년 9월 19일
댓글: Viviana Arrigoni 2015년 9월 20일
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