ToolPythonAdvanced Perturbation theory with SymPy: the Duffing oscillator's frequency shift print("trigsimp:", sp.trigsimp(c3))
ToolPythonAdvanced Von Neumann stability analysis with SymPy: the leapfrog Courant limit P_cos = sp.collect(sp.trigsimp(P.rewrite(sp.cos)), G)expr = sp.trigsimp(sp.expand(expr).rewrite(sp.cos)).subs(dt, dt_value)