-7

N = 1298 + 74.86*C + 1.283*C^2 − .0078*C^3 − .0006*C^4

I'm using this equation in my project, which has to be solved for to find C. I'm using this formula in python, this equation can be easily calculated in scientific calculator but i want it to do in python. If any other possible way to solve this please let me know Thanks

7vik ja9
  • 61
  • 1
  • 5
  • https://en.wikipedia.org/wiki/Quartic_function (link sourced from [this math SE post](https://math.stackexchange.com/questions/200617/how-to-solve-an-nth-degree-polynomial-equation) which answers the question for n order functions), see the solution methods of the quartic function wiki page – Nick is tired Mar 23 '20 at 06:03
  • Hello! Please refer to the [how to ask questions?](https://stackoverflow.com/help/how-to-ask) this will help you to improve your questions, to help others with the same problem. Thanks – EnriqueBet Mar 23 '20 at 06:04

1 Answers1

0

You can use sympy, Python's symbolic math library.

from sympy import solve
from sympy.abc import C

print(solve(1298 + 74.86 * C + 1.283 * C ** 2 - .0078 * C ** 3 - .0006 * C ** 4))

# result: [-28.2719434096994, 62.3383358961427, -23.5331962432216 - 25.9550273611766*I, -23.5331962432216 + 25.9550273611766*I]
JohanC
  • 71,591
  • 8
  • 33
  • 66