Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
solve ODE with sympy
#1
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
Reply
#2
You don't need sympy to solve this. Solve it with pen and paper!
« We can solve any problem by introducing an extra level of indirection »
Reply
#3
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?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  I need assistance with getting sympy to work alex_0 1 1,518 Apr-05-2021, 09:15 PM
Last Post: snippsat
  Sympy error "object is not callable" Cupcake 0 4,914 Feb-08-2020, 02:22 AM
Last Post: Cupcake
  Get the variables in a sympy expression SJ001 8 7,328 Feb-12-2019, 07:25 AM
Last Post: SJ001
  Sympy Import error: "unresolved referrence 'sympy' " BoaCoder3 0 2,689 Jul-27-2018, 12:48 PM
Last Post: BoaCoder3
  SymPy - SolveSet Values Plant_Boy 0 2,507 Jan-01-2018, 09:20 PM
Last Post: Plant_Boy
  Sympy symbolic Point shoulddt 0 2,766 Jul-17-2017, 06:07 PM
Last Post: shoulddt
  Sympy Integration Flexico 5 7,520 Dec-07-2016, 07:24 AM
Last Post: micseydel

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020