How to solve a 13 set of equations and evaluate their change over time?
조회 수: 1 (최근 30일)
이전 댓글 표시
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
Torsten
2022년 10월 19일
As already noted, write out your equations in a mathematical notation since we cannot make sense of your code.
John D'Errico
2022년 11월 26일
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
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!