Ask Your Question
2

Solve a differential equation using series expansions.

asked 2018-04-21 06:36:53 +0100

userX gravatar image

updated 2018-04-21 10:15:40 +0100

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 15:41:50 +0100

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

Comments

Hello :) Is there any way that we can solve the differential equation in a series solution in SageMathCell? Also, how could we solve for the initial value? How could we adjust the default center 0(x0=0) to another value? Thank you!

posst gravatar imageposst ( 2023-03-09 02:20:13 +0100 )edit

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-21 06:36:53 +0100

Seen: 324 times

Last updated: Apr 21 '18