My students are attempting to use a python function with an if statement in it 
as part of a differential equation they are solving with desolve_odeint.  
Unfortunately, of course, Sage executes the python function as soon as they 
write it and not within the solver.  I need help on getting around this.  Here 
is some same code for a simpler case than what they are doing.


def f(x,y):
    if x<0.2:
        return(0)
    else:
        return(y*(1-y))

ans=desolve_odeint([SR(1),f(x,y)],[0,0.5],srange(0,10,0.01),[x,y])

-- 
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 sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to