Having problems with ode solution

조회 수: 2 (최근 30일)
Andrej Musikic
Andrej Musikic 2018년 7월 12일
댓글: Andrej Musikic 2018년 7월 13일

Hello,

So I have this:

function [dS] = Mechanism(~, S, E, K, k)
S1 = S(1); S2 = S(2); S3 = S(3);
E1 = E(1); E2 = E(2);
K1 = K(1); K2 = K(2);
k1 = k(1); k2 = k(2);
v1 = (k1*E1*S1)/(K1+S1);
v2 = (k2*E2*S2)/(K2+S2);
dS1 = -v1;
dS2 = +v1 -v2;
dS3 = +v2;
dS(1,:) = dS1;
dS(2,:) = dS2;
dS(3,:) = dS3;
end

Just two Michaelis Menten Equations for rates v1 and v2 of this reaction S1 -> S2 -> S3.

And I am trying to solve it with:

S = [100 1 1]; % Substrate Conc.
E = [10 10]; % Enzyme Conc.
K = [200 50]; % Km
k = [5 10]; % kcat
tspan = [0 20];
options = odeset('NonNegative',1:3);
[t,y] = ode15s(@(t,y)Mechanism(t,S,E,K,k), tspan, S, options);
figure
plot(t, y);
xlabel('Time / s');
ylabel('Concentration / uM');
title('S1 -> S3');
legend('S1', 'S2', 'S3');
set(legend,'Location','northwest');

Now I would expect the plot to show S1 going down whilst S2 and S3 are increasing and then S2 going down - something like that.

But the plot which is created shows S1 going to 0 but S2 and S3 continuing linearly upwards without stopping.

So I am confused.

Why is this so? Did I write something incorrectly? Or is somehow my Matlab broken?

I also tried something similar which I copied 1:1 from a youtube video https://www.youtube.com/watch?v=Ksi1R2pcE1M - where it functioned without problems - but it didn't work. That video used MATLAB R2016b - so maybe something to do with that?

Thank you for reading and hoping you can help, Andrej

채택된 답변

Torsten
Torsten 2018년 7월 13일
Use
[t,y] = ode15s(@(t,y)Mechanism(t,y,E,K,k), tspan, S, options);
instead of
[t,y] = ode15s(@(t,y)Mechanism(t,S,E,K,k), tspan, S, options);
Best wishes
Torsten.
  댓글 수: 1
Andrej Musikic
Andrej Musikic 2018년 7월 13일
Thank you!
I feel like an idiot right now ^^'
Best wishes, Andrej

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by