Ask Your Question

Photon's profile - activity

2021-04-03 14:17:25 +0200 received badge  Famous Question (source)
2021-04-03 14:17:25 +0200 received badge  Notable Question (source)
2021-04-03 14:17:25 +0200 received badge  Popular Question (source)
2015-03-25 17:30:44 +0200 received badge  Nice Question (source)
2015-03-25 02:05:17 +0200 received badge  Student (source)
2015-03-24 21:51:52 +0200 asked a question Compact output of solution of DE

When I'm trying to solve DE:

t = var('t')
y = function('y', t)
de = t*(y^2)*diff(y,t) + y^3 == 1
sol = desolve(de,[y,t], [1,2])

the output is pretty ugly:

-1/3*log(y(t)^2 + y(t) + 1) - 1/3*log(y(t) - 1) == -1/3*log(7) + log(t)

When I'm solving this in matlab:

clear;
syms y(t)
y(t) =  dsolve(t*(y^2)*diff(y,t) + y^3 == 1, y(1) ==2)

The output looks much better:

y(t) = (exp(log(7) - 3*log(t)) + 1)^(1/3)

Can I see output in sage looking similiar to this from matlab? Simplify(sol) dosen't work. Maybe I've made mistake somewhere, but I can't determine without knowing the form y(t) from sage.

And btw, typing:

t*(y^2)*y'+ y^3 = 1, y(1) = 2

into wolframalpha.com results yet another solution. I'm lost...

2015-03-24 21:33:20 +0200 received badge  Editor (source)
2015-03-24 18:17:44 +0200 commented answer Solving differential equations with initial value starting not at 0

I think you did not read what I've wrote. Please read again my problem and then answer if you would like.

2015-03-24 14:14:01 +0200 asked a question Solving differential equations with initial value starting not at 0

Hello,

I'm trying sage instead of Mathematica and for I have a lot of problem, but first what is realy frustrating is solving diff eq. with initial value. For example, my equation is:

t*diff(y,t) + y == t*exp(t^2), and y(2) = 1

The problem is that every tutorial/documentation I googled, there is something like:

t = var('t')
y = function('y',t)
desolve(t*diff(y,t) + y == t*exp(t^2),y, ics=[1])
but it sets y(0) = 1, and I want to y(2) = 1.

I don't know if it's me googling poorly or something with sage doc, but plz, help me solve this.

Ok, I think I've got the solution:

t = var('t')
y = function('y',t)
de = lambda y: t*diff(y,t) + y - t*exp(t^2)
desolve(de(x),[x,t],[1,2])