Python Forum

Full Version: Solving equation on a given domain
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Dear all,

I am trying to solve the following equation on [0,10] :

-0.523*sinh( 0.0597^2 * 0.247^2 *X) + 0.9*cosh( 0.0597^2 * 0.247^2 *X) = 0.1

To do so I used solve() from sympy... but as I cannot give a domain it takes ages to solve (if it solves) !!
I also tried solveset() from sympy but it fails to give me an answer (-87.78 is one for example).

from sympy import solveset, solve, Symbol
x = Symbol('x', real=True)
sol = solveset(-0.523*sinh( 0.0597^2 * 0.247^2 *x) + 0.9*cosh( 0.0597^2 * 0.247^2 *x) - 0.1, x, Interval(0,10))
Does anyone know how to restrict the domain using sympy ?
And does any of you know a python solver for which no initial guess is required for solving ?

Thanks in advance !!
This equation can be solved exactly by using the exponential forms of cosh and sinh. It reduces to a quadratic equation.