I am trying to solve a small system of ODEs, following the tutorial on
the SAGE homepage; however, I only receive an error message. What am I
doing wrong?
Here is my code:
====================
t = var ('t')
S_0 = 1.5
X_0 = 0.05
Y_XS = 0.5
K_S = 0.007
mu_max = 0.8
X = function ('X', t)
S = function ('S', X)
mu = function ('mu', S)
dXdt = diff (X, t) == mu * X
dSdt = diff (S, t) == -mu * X / Y_XS
mu = (mu_max * S) / (K_S + S)
desolve_system ([dXdt, dSdt], [X, S], ics = [0, X_0, S_0])
====================
(Part of) the error message is:
====================
TypeError: Error executing code in Maxima
CODE:
sage7 : atvalue(sage1,sage5,sage6)$
Maxima ERROR:
Improper argument to atvalue:
['X(t)]
====================
Thanks,
Richard
Richard
but I figured my initial code didn't make sense in the way mu was
computed; so I changed it to the following. The error message stays
the same, though.
====================
t = var ('t')
S_0 = 1.5
X_0 = 0.05
Y_XS = 0.5
K_S = 0.007
mu_max = 0.8
X = function ('X', t)
S = function ('S', X)
def mu (S):
return (mu_max * S) / (K_S + S)
dXdt = diff (X, t) == mu(S) * X
dSdt = diff (S, t) == -mu(S) * X / Y_XS
desolve_system ([dXdt, dSdt], [X, S], ics = [0, X_0, S_0])
====================
Richard
On 07/23/2010 04:41 AM, kcrisman wrote:
> Thanks for this explicit example. I think that what is happening is
> that we are providing a list to the Maxima function "atvalue" (the
> 'X(t) is just an unevaluated function X(t)), which Maxima wouldn't
> like, perhaps.
[...]
> But I'm not sure why this is happening; doing the atvalue 'by hand'
> seems to give the right thing. Anyone else have ideas why this
> happens?
Apparently no, at least there hasn't been any further reply so far :)
Should I file a bug?
Is there any other way to solve my system of ODEs using SAGE? I need
to work with those equations in systems biology class.
Thanks,
Richard