Processing math: 100%
Ask Your Question
2

Solve a differential equation using series expansions.

asked 7 years ago

userX gravatar image

updated 7 years ago

Given an ODE such as y+x2y+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=ao(c0+c1x+c2x2+)+a1(d0+d1x+d2x2+)

my attempts:

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

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
1

answered 7 years ago

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)]
Preview: (hide)
link

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 ( 2 years ago )

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: 7 years ago

Seen: 349 times

Last updated: Apr 21 '18