Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sympy as sp
- print('sympy version:', sp.__version__)
- t = sp.symbols('t', real=True, nonnegative=True)
- n = sp.symbols('n', integer=True, nonnegative=True)
- f = sp.symbols('f', cls=sp.Function)
- diff_eq = sp.Eq(f(t).diff(t, 2) + n**2*f(t), 0)
- print('general solution:', sp.dsolve(diff_eq, f(t)))
- print('solution at n=0 (pre-subs):', sp.dsolve(diff_eq.subs(n, 0), f(t)))
- print('solution at n=0 (post-subs):', sp.dsolve(diff_eq, f(t)).subs(n, 0))
Add Comment
Please, Sign In to add comment