ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 14 Jan 2019 17:54:14 +0100Wrong solution/output for differential equationhttps://ask.sagemath.org/question/45046/wrong-solutionoutput-for-differential-equation/As the user rburing advised in the thread
https://ask.sagemath.org/question/44995/combine-plots-with-built-in-maxima-trajectory-in-sage-available/
I'm opening this one now.
When running the following code, one obtains a wrong output:
y=function('y')(x)
desolve(diff(y)==4*y/x+x*sqrt(y),y,ics=[1,1]).factor()
The output is `1/4*x^4*(log(x) - 2)^2` instead of `1/4*x^4*(log(x) + 2)^2`. Mathematica however outputs both (by running `DSolve[{D[y[x], x] == 4*y[x]/x + x*Sqrt[y[x]], y[1] == 1}, y[x], x]`).ThrashMon, 14 Jan 2019 17:54:14 +0100https://ask.sagemath.org/question/45046/Compact output of solution of DEhttps://ask.sagemath.org/question/26316/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...PhotonTue, 24 Mar 2015 21:51:52 +0100https://ask.sagemath.org/question/26316/