Ask Your Question
2

Solve a differential equation using series expansions.

asked 2018-04-20 23:36:53 -0600

userX gravatar image

updated 2018-04-21 03:15:40 -0600

Given an ODE such as $$y''+x^2y'+y=0$$ Is it possible to get sage to display the solution in the from (at least the first few terms of the expansion) $$y=a_o\left(c_0+c_1x+c_2x^2+\dots\right) + a_1\left(d_0+d_1x+d_2x^2+\dots\right) $$

my attempts:

EDIT: I have made some progress, functional but it is not pretty. second attempt

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2018-04-21 08:41:50 -0600

tmonteil gravatar image

You can use the ore_algebra package as follows.

First, you need to install the latest version (not the packaged one which is not up-to-date), from the shell, just type:

sage -pip install --upgrade --user git+https://github.com/mkauers/ore_algebra.git

Then, in Sage:

sage: from ore_algebra import *
sage: R.<x> = PolynomialRing(ZZ); A.<Dx> = OreAlgebra(R)
sage: O = Dx^2 + x^2*Dx + 1
sage: O
Dx^2 + x^2*Dx + 1
sage: O.power_series_solutions(n=10)
[x - 1/6*x^3 - 1/12*x^4 + 1/120*x^5 + 7/360*x^6 + 13/1680*x^7 - 11/10080*x^8 - 209/120960*x^9 + O(x^10),
 1 - 1/2*x^2 + 1/24*x^4 + 1/20*x^5 - 1/720*x^6 - 13/2520*x^7 - 179/40320*x^8 + 17/90720*x^9 + O(x^10)]
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-04-20 23:36:53 -0600

Seen: 69 times

Last updated: Apr 21