Examples Lynch book
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

9 lines
290 B

# Program 02c: Power series solution first order ODE; exa 7 chp 2
from sympy import dsolve, Function, pprint
from sympy.abc import t
x = Function('x')
dxdt = x(t).diff(t)
ode = dxdt+t*x(t)-t**3
sol = dsolve(ode, hint='1st_power_series', n=8, ics={x(0): 1})
print('Solution:\n')
pprint(sol)