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

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