How to solve a 13 set of equations and evaluate their change over time?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I need to solve these set of equations. I thought about using matrices but I could not figure out how use "syms" to add so many variables. Also, how can evaluate the ODE equations over time (tspan = [0:100]?
%K Constants
k1 = 0.3;
k2 = 0.3;
k3 = 0.4;
k4 = 0.05;
k5 = 0.77;
k6 = 0.125;
k7 = 0.48;
k8 = 0.0017;
k9 = 0.27;
%Rate Equations
v1 = k1*ATP;
v2 = k2*PEP;
v3 = k3*P2G;
v4 = k4*BPG*ATP;
v5 = k5*G3P;
v6 = k6*FBP;
v7 = k7*DHAP*G3P;
v8 = k8*FBP;
v9 = k9*FBP;
v10 = K10*ADP;
%ODE
PEP = v1-v2;
P2G= v2-v3;
P3G = v3-v4;
BPG = v4-v5;
G3P = v5-v6-v7;
DHAP = v6-v7;
FBP = v7-v8-v9;
ATP = -v1-v4+v10;
ADP = v1+v4-v10;
%Here i try to do it for the PEP equation but i keep getting error.
for tspan = 0:10
v2 = k2*(v1-v2);
dpdt = @(PEP,t) (k2*PEP*t);
[PEP, t] = ode45(dpdt,tspan,0);
end
2 commentaires
Torsten
le 19 Oct 2022
As already noted, write out your equations in a mathematical notation since we cannot make sense of your code.
John D'Errico
le 26 Nov 2022
What you have written does not make complete sense.
You define v2 outside the loop. Then inside the llop, you redefine v2 as
v2 = k2*(v1-v2)
But then you never use v2 anyway.
And your ODE?
dp/dt = k2*PEP*t
PEP is defined as
PEP = v1 - v2
But is that value of v2 changing? Do we know that?
What I'm not clear of, is this a DAE? So a differential algebraic system of equations?
You have 10 rate equations, for v1 through v10. Then you define 9 other algebraic equations, for the variables PEP, etc., as linear combinations of those rates.
So it LOOKs as it you have a DAE system. I'm confused as to what you are doing with v2 in the loop there.
Solving a DAE can be done using two numerical solvers.
help ode15s
help ode23t
Réponses (0)
Voir également
Catégories
En savoir plus sur Ordinary Differential Equations dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!