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.Sat, 05 Dec 2020 23:06:08 +0100How to solve higher order (3rd or 4th) differential equation?https://ask.sagemath.org/question/54580/how-to-solve-higher-order-3rd-or-4th-differential-equation/I am new to Sagemath. I was trying to solve ODE of order 4 in sagemath but it gives following error
"NotImplementedError: Maxima was unable to solve this ODE."
x=var('x')
w = function('w')(x)
desolve(diff(w,x,4)==1,w,contrib_ode=True)
Thanks in advance.sonimohitSat, 05 Dec 2020 23:06:08 +0100https://ask.sagemath.org/question/54580/How can I solve the following (linear) differential equation?https://ask.sagemath.org/question/45075/how-can-i-solve-the-following-linear-differential-equation/I want Sage to solve this equation:
$y'''-3y''+y'-5y=0$.
Both
y=function('y')(x)
desolve(diff(y,3)-3*diff(y,2)+diff(y,1)-5*y,y)
and
giac("desolve([y'''-3y''+y'-5y],y)").sage()
result in errors.ThrashThu, 17 Jan 2019 05:27:41 +0100https://ask.sagemath.org/question/45075/Wrong 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/Any way to solve this differential equation?https://ask.sagemath.org/question/36122/any-way-to-solve-this-differential-equation/ sage: x(t)=function('x')(t)
sage: x
t |--> x(t)
sage: g(v,c)=1/sqrt(1-v^2/c^2)
sage: g
(v, c) |--> 1/sqrt(-v^2/c^2 + 1)
sage: var('a')
a
sage: ode = g(diff(x,t))*diff(x,t) == a*t
sage: ode
t |--> diff(x(t), t)/sqrt(-diff(x(t), t)^2/c^2 + 1) == a*t
sage: desolve(ode,x)
Traceback (most recent call last):
...
ValueError: Unable to determine independent variable, please specify.
sage: desolve(ode,[x,t])
Traceback (most recent call last):
...
NotImplementedError: Maxima was unable to solve this ODE. Consider to set option contrib_ode to True.
sage: desolve(ode,[x,t],contrib_ode=True)
Traceback (most recent call last):
...
NotImplementedError: Maxima was unable to solve this ODE.
I can solve it by hand.
Mathematica can solve it. But I would very much prefer to learn to use Sage because it's open source.
It looks like it is Maxima that cannot solve it. But is it possible to make Sage invoke any other open source program than Maxima? Or use some trick in defining the problem that would allow Maxima to solve it?
Thank you.omoplataThu, 29 Dec 2016 20:15:36 +0100https://ask.sagemath.org/question/36122/2nd-order ODE: Maxima wants sign of 1 constant before finishinghttps://ask.sagemath.org/question/24624/2nd-order-ode-maxima-wants-sign-of-1-constant-before-finishing/ I'm trying to solve a 2nd-order nonlinear ODE using desolve(). Maxima gets partway through, but then asks for the sign of one of the integration constants. How can I tell it to assume something that doesn't exist before I call desolve()?
t,P,x0=var('t,P,x0')
x=function('x',t)
de=(diff(x,t,2)*x^2+P==0)
forget()
assume(P>0,x0>0)
desolve(de,x,ics=[0,x0,0],ivar=t)
gives the error:
TypeError: ECL says: Maxima asks: Is %k1 positive or negative?
Hoss N. FefferFri, 24 Oct 2014 17:16:29 +0200https://ask.sagemath.org/question/24624/Difficulty solving some second order differential equationshttps://ask.sagemath.org/question/10177/difficulty-solving-some-second-order-differential-equations/I have trouble finding 10% and 90% of the rise time in a second order differential equation.
I have tried to search but i have not solved my issue, so now i ask here.
I have added the code to aleph.sagemath.org however the link is crazy long so i put it in a short link: [http://bit.utoft.org/138hfAz](http://bit.utoft.org/138hfAz)
The code is also on pastebin
[http://pastebin.com/4hwdLJuT](http://pastebin.com/4hwdLJuT)
Please help :)
Cheers
J. UtoftjesperFri, 31 May 2013 13:51:05 +0200https://ask.sagemath.org/question/10177/desolve_system error "unable to make sense of Maxima expression"https://ask.sagemath.org/question/9591/desolve_system-error-unable-to-make-sense-of-maxima-expression/ t = var('t')
y = function('y', t)
w = function('w', t)
p = function('p', t)
de1 = diff(y,t) == - 0.5*y - 0.9*p + 0.5*w
de2 = diff(w,t) == 1.0*p + 0.7*w
de3 = diff(p,t) == + 0.5*y - 0.3*w
desolve_system([de1, de2, de3], [y,p,w])
The function desolve_system stops with the error:
> TypeError: unable to make sense of
> Maxima expression
> 'y(t)=ilt((200*y(0)*?g1090327^2+(-140*y(0)+100*w(0)-180*p(0))*?g1090327+60*y(0)+54*w(0)+226*p(0))/(200*?g1090327^3-40*?g1090327^2+80*?g1090327-83),?g1090327,t)'
> in Sage
Why? Thanks in advance!
petresFri, 30 Nov 2012 07:51:59 +0100https://ask.sagemath.org/question/9591/How to solve an implicit differential equation numerically?https://ask.sagemath.org/question/9506/how-to-solve-an-implicit-differential-equation-numerically/I tried Mathematica for this, but didn't see how to do it.
Is it possible to solve an equation of the following kind?
diff(R(t),t) == C1*(C2 - C3*1/R(t))*(1/R(t) + 1/sqrt(C4*t))
where t is a variable, R(t) is a function of t and C1 to C4 are constants
Any help would be appreciated.
clenzTue, 06 Nov 2012 11:47:43 +0100https://ask.sagemath.org/question/9506/how to plot solution of differential systemhttps://ask.sagemath.org/question/9337/how-to-plot-solution-of-differential-system/Hi, everyone!
I got a question.
I have a system of three Newton's equations
x''=-x/(x*x+y*y+z*z)^3/2-F(t)
y''=-x/(x*x+y*y+z*z)^3/2
z''=-x/(x*x+y*y+z*z)^3/2
I use `ode_solver()` to solve numerically the system by using `y[0]` for x, `y[1]` for y, `y[2]` for z like in example in the manual without using jacobian:
j_1= lambda t,y: [ y[3], y[4], y[5], -y[0]/(y[0]*y[0]+y[1]*y[1]+y[2]*y[2])^(1.5)-F*cos(w*t), -y[1]/(y[0]*y[0]+y[1]*y[1]+y[2]*y[2])^(1.5), -y[2]/(y[0]*y[0]+y[1]*y[1]+y[2]*y[2])^(1.5)]
How may I plot the curve (x(t), y(t)) or (x(t), z(t))?
`T.plot_solution(i=0, filename=outfile)` allows to plot only (x(t), t), (y(t), t) or (z(t), t)
Thank you
5tarasFri, 21 Sep 2012 23:24:40 +0200https://ask.sagemath.org/question/9337/Order of a differential equation?https://ask.sagemath.org/question/9113/order-of-a-differential-equation/Does it exists a method or a function that returns the the order of a (O-P)DE?Lucas_MalorSun, 15 Jul 2012 13:48:41 +0200https://ask.sagemath.org/question/9113/How to extract coefficient terms from a differential equation, as for polynomial?https://ask.sagemath.org/question/9154/how-to-extract-coefficient-terms-from-a-differential-equation-as-for-polynomial/Hello all. As title, I want to extract from a differential equation the term coefficients with respect to a variable. For example:
var('x, u')
y = function('y', x)
DE = y.diff(x)*u^2 + 2*u + x
from DE I want to create a new symbolic expression with the coefficient of u^2, in this case y.diff(x).
Must I convert DE to a polynomial ring? And how can I do it?Lucas_MalorSat, 14 Jul 2012 08:59:09 +0200https://ask.sagemath.org/question/9154/Is there a way to solve a differential equation in sage with adaptive step size?https://ask.sagemath.org/question/7664/is-there-a-way-to-solve-a-differential-equation-in-sage-with-adaptive-step-size/Is there a way to solve a differential equation in sage with adaptive step size?ShashankSun, 10 Oct 2010 01:04:03 +0200https://ask.sagemath.org/question/7664/differential equation problems.https://ask.sagemath.org/question/7884/differential-equation-problems/I am trying to get the differential equation examples to work:
x = var('x')
y = function('y',x)
desolve(diff(y,x) + y - 1, y)
or
t = var('t')
x = function('x',t)
DE = diff(x, t) + x - 1
desolve(DE, [x,t])
Both return errors. What am I doing wrong?
mhfreyTue, 18 Jan 2011 17:24:58 +0100https://ask.sagemath.org/question/7884/