我可以对 MatLab 中的两个微分方程组使用两个单独的 ODE 调用函数吗?

Can I use two separate ODE call functions for a system of two differential equations in MatLab?

我正在尝试编写如下所示的 ODE 系统。

如图所示,第二个 ODE 完全取决于第一个 ODE 的值。
我如何编写第二首颂歌? 我正在使用 ode45。

是的,这很有可能。将 x 定义为 [c;ce],那么您将得到如下内容:

function dx = my_ode(t,x)

% parameters definition
kf = ...; % whatever value you are using
P0 = ...; % whatever value you are using
Jer = ...; % whatever value you are using
J_serca = ...; % whatever value you are using
gamma = ...; % whatever value you are using

% differential equations
dc = (kf*P0+Jer)*(x(2)-x(1)) - J_serca;
dce = -gamma*dc;
dx = [dc;dce];

然后您可以将 ode 求解器调用为:

tspan = [0 10]; % or whatever time interval you want to solve the odes on
x_init = [0;0]; % ot whatever initial conditions you want to use
[T,Y] = ode45(@my_ode,tspan,x_init);