Python Forum
Solve simple equation in Python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Solve simple equation in Python
#5
I have never used SymPy myself, but from this tutorial I think it looks fairly straight forward:

https://pythonforundergradengineers.com/...tions.html

My first shot would be:
from sympy import symbols, Eq, solve
x = symbols('x')
eq = Eq('0.4x - 0.38 - 0.58')
solution = solve((eq), (x))
There may be a way to solve an equation without first putting it in the form equation = 0. I don't know.
kmll likes this post
Reply


Messages In This Thread
Solve simple equation in Python - by kmll - Nov-01-2020, 03:32 PM
RE: Solve simple equation in Python - by deanhystad - Nov-01-2020, 03:43 PM
RE: Solve simple equation in Python - by kmll - Nov-01-2020, 04:11 PM
RE: Solve simple equation in Python - by jefsummers - Nov-01-2020, 03:57 PM
RE: Solve simple equation in Python - by deanhystad - Nov-01-2020, 04:34 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  A simple problem, how best to solve it? SuchUmami 2 739 Sep-01-2023, 05:36 AM
Last Post: Pedroski55
  How to solve this simple problem? Check if cvs first element is the same in each row? thesquid 2 1,262 Jun-14-2022, 08:35 PM
Last Post: thesquid
  Python selenium + Xevil to solve recaptcha sunny9495 6 3,439 Apr-04-2022, 10:23 AM
Last Post: sunny9495
Heart how to solve complex equations in python HoangF 3 2,838 Dec-26-2021, 07:04 PM
Last Post: HoangF
  NotImplementedError: pseudo-class is not implemented - how to Update Python to solve apollo 1 3,118 May-16-2021, 08:03 AM
Last Post: buran
  Python gives " -0.0 " as solution for an equation akar 2 1,802 Aug-27-2020, 12:15 PM
Last Post: akar
  Asking for help in solving a single variable nonlinear equation using Python ! NDP 0 2,004 Feb-15-2019, 12:03 PM
Last Post: NDP
  How do I code this equation in python (factor ceiling(2^127-1)) Pleiades 5 4,482 Apr-23-2018, 03:01 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

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