I can't seem to figure out what's wrong with the code

2 次查看(过去 30 天)
I've attached my copy of the code..and included is the original code from Berkeley Madonna
Not 100% sure what I'm doing wrong, and I need to determine when SA will reach steady state. How do I go about that?
  1 个评论
Walter Roberson
Walter Roberson 2021-8-18
Total SA = (SA1 + SA2)/140;
You have a space in the variable name. However, that variable does not appear to be used for anything.
function ddt = odefun(t,y)
[...]
% Flows
JSA = k12 * SA1 - k21 * SA2;
You have not defined SA1 or SA2 at that point
y0 = [SA1; SA2; ASA1; ASA2];
That hints that inside odefun you need to do
SA1 = y(1); SA2 = y(2); ASA1 = y(3); ASA2 = y(4);

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrix Indexing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by