Having problems with ode solution

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

 Accepted Answer

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 Comment

Thank you!
I feel like an idiot right now ^^'
Best wishes, Andrej

Sign in to comment.

More Answers (0)

Products

Release

R2018a

Community Treasure Hunt

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

Start Hunting!