On Tue, May 5, 2015 at 6:58 PM, Jotace <[email protected]> wrote:
> I am trying to obtain the explicit expression for the solution od an ODE, my
> code is
> var('k')
> y= function('y',x)
> h=desolve(diff(y,x) - k*y*(1-y),y, ivar=x)
> h

For this example you can do something like:

eq = h.simplify_log()*k
eq2 = exp(eq.rhs()) == exp(eq.lhs())
sol = solve(eq2,y)
g(x) = sol[0].rhs()

Then you have
sage: g
x |--> e^(_C*k + k*x)/(e^(_C*k + k*x) - 1)

And for specific values for _C and k:

sage: g(x,_C=10,k=2)
e^(2*x + 20)/(e^(2*x + 20) - 1)


Hope that helps,
-- 
Vegard

-- 
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/d/optout.

Reply via email to