Help With ODE for a New Sage User

asked 2013-02-09 11:54:31 +0100

william.cipolli gravatar image
var('a b n k t')
c = function('c',t)
de = diff(c,t) - a + (b*c)*((c**n)/((k**n)+(c**n))) == 0
des = desolve(de,[c,t],[0,0]);show(des)
f(a,b,n,k,t,c) = des
plot(f(.1,3,8,.5,t,.42),(t,0,25),figsize=(4,3))

I followed an example almost exactly for a different equation to help solve this ODE:

c'=a-(bc((c^n)/(k^n+c^n))) with initial condition C[0]=0

The error I get is:

ValueError: The name "c(t)" is not a valid Python identifier.

edit retag flag offensive close merge delete

Comments

I'm not sure what's going on here yet, but it's a very subtle error that involves c(t) somehow being sent to Maxima/ECL which can't interpret it. What's more, I used to get your error, but now get a horrible segmentation fault after trying to debug it. Thanks for bringing this to our attention; I've made this http://trac.sagemath.org/sage_trac/ticket/14092

kcrisman gravatar imagekcrisman ( 2013-02-09 21:44:20 +0100 )edit

Thank you for the heads up, and submitting that ticket. I'll keep an eye out for a solution.

william.cipolli gravatar imagewilliam.cipolli ( 2013-02-11 08:20:35 +0100 )edit