Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to solve a Bernoulli Diff EQ?

Hi!

I've been trying to figure out how to solve a Bernoulli Diff EQ in Sage for 2 hours now and no matter what I do, it always gives me this long and/or complicated answer when the actual answer isn't anywhere near what sage says

My problem is

dx/dt = 2x(15-x),  P(0) = 10

And my sage code is

t=var('t')
x=function('x')(t)
de=diff(x,t)==2*x(15-x)
h=desolve(de,x,ics=[0,10],algorithm="fricas",contrib_ode=true)
z=desolve_laplace(de,dvar=x,ics=[0,10])
show(expand(h))
show(expand(z))

It gives me something weird and long, but the answer is actually

x=(30e^(30t))/(1+2e^(30t))

Any ideas on how to get this?

Thanks!

How to solve a Bernoulli Diff EQ?

Hi!

I've been trying to figure out how to solve a Bernoulli Diff EQ in Sage for 2 hours now and no matter what I do, it always gives me this long and/or complicated answer when the actual answer isn't anywhere near what sage says

My problem is

dx/dt = 2x(15-x),  P(0) = 10

And my sage code is

t=var('t')
x=function('x')(t)
de=diff(x,t)==2*x(15-x)
h=desolve(de,x,ics=[0,10],algorithm="fricas",contrib_ode=true)
z=desolve_laplace(de,dvar=x,ics=[0,10])
show(expand(h))
show(expand(z))

It gives me something weird and long, but the answer this:

-1/30*log(x(t) - 15) + 1/30*log(x(t)) == -1/30*I*pi + t + 1/30*log(10) - 1/30*log(5)

But what I want is actuallythis

x=(30e^(30t))/(1+2e^(30t))

Any ideas on how to get this?

Thanks!