Python Forum

Full Version: solve ODE with sympy
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello
Is it possible to solve this differential equation using sympy?
z'' + c * z = -sign(z')
I tried to solve it and got the following error:
Error:
No algorithms are implemented to solve equation _Dummy_39 + x(t) + sign(_X0)
Code:
import sympy as sp
import numpy as np
sp.init_printing()


t = sp.symbols('t')
x = sp.Function('x')(t)
x_dot = x.diff(t)
x_two_dot = (x.diff(t)).diff(t)

expr = sp.Eq(x_two_dot, -sp.sign(x_dot) -x )

sol = sp.dsolve(expr); sol
Thanks for your helps
You don't need sympy to solve this. Solve it with pen and paper!
I know that this can be solved on paper. I need to do this symbolically in order to create a lab work on differential equations using python.
Do I understand correctly that symbolic calculations don't work well with piecewise type functions?