Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Nov 14th, 2018 72 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. import sympy as sp
  2. print('sympy version:', sp.__version__)
  3.  
  4. t = sp.symbols('t', real=True, nonnegative=True)
  5. n = sp.symbols('n', integer=True, nonnegative=True)
  6. f = sp.symbols('f', cls=sp.Function)
  7.  
  8. diff_eq = sp.Eq(f(t).diff(t, 2) + n**2*f(t), 0)
  9.  
  10. print('general solution:', sp.dsolve(diff_eq, f(t)))
  11. print('solution at n=0 (pre-subs):', sp.dsolve(diff_eq.subs(n, 0), f(t)))
  12. print('solution at n=0 (post-subs):', sp.dsolve(diff_eq, f(t)).subs(n, 0))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top