ToolPythonAdvanced
sympy.N
Python. Called in 2 tutorials; each line below leads to its place in the tutorial.
ToolPythonAdvanced
Von Neumann stability analysis with SymPy: the leapfrog Courant limit
- roots = [sp.N(g.subs({C: C_val, s: 1}), 4) for g in (G1, G2)]
- print(f"C = 1.1 unstable from kΔx = {sp.N(2 * sp.asin(1 / sp.Rational(11, 10)), 4)}")
- print(f"C = 0.5, six points per wavelength: exact {sp.N(ratio.subs(at), 4)}, "
- f"series {sp.N(series.removeO().subs(at), 4)}, closed form {sp.N(closed.subs(at), 4)}")