Kenenbek Arzymatov
Kenenbek Arzymatov

Reputation: 9139

How to solve nonlinear equation without sympy(max and min)?

How can I resolve the equation like x * max(x,15) + max(x, 45) / x = 10 with python libraries? I am forced not to use Sympy library, because symbolic calculations is very slow. The max() means the maximum between given two arguments. Maybe Scipy or Numpy libraries are good for it? My equations has a more complicated form, but I want to resolve it in simplified form.

Upvotes: 0

Views: 525

Answers (1)

Tomasz Kaminski
Tomasz Kaminski

Reputation: 910

Just use the power of mathematics!

Split this equation into two on different domains and solve each one: Solve x^2 = 10 for x > 15 and 15x = 10 for x= < 15

Upvotes: 2

Related Questions