I've gone back to the basics. The keys seem to be to define the
independent variable, to write both components of the vector field as
functions but not to specify the inputs to the functions in the vector
field definition, and (most critically) to use the parameter identifiers
(ivar, dvars, time, ics) in the call to desolve_odeint.
The following code seems to be working now.
var('x y t')
def dx(x,y,t):
if x<0.2:
return(-x)
else:
return(y*(1-y))
def dy(x,y,t):
return(1)
F=[dx,dy]
ans=desolve_odeint(F,ics=[0.5,1],times=srange(0,10,0.1),dvars=[x,y],ivar=t)
line(ans)
http://sagecell.sagemath.org/?z=eJxljUEKwjAQRfeF3iG7TmRaEsGNmG0vUYoEM5VATSGJJbm9qRZE_Kv5M483q_bQJJZZbHhd1ZWhiZkECTNGfq4rVmInli6iO-51i6f49A7axD87mgP9n_MBZJv5V5x_xTsm30CvBpPQ5HEr2gVlKCzzStfFkHURerS3oAbRnVCOGO2DggpeuzuBQClQdJKjWbUvUPkyoi2zisU9W0dQjPwF2u1AUQ==&lang=sage
--
You received this message because you are subscribed to the Google Groups
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.