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

1 view (last 30 days)
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 Comment
Walter Roberson
Walter Roberson on 18 Aug 2021
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);

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!