2
$\begingroup$

I've got the following problem:

If I want to calculate the following equation,

S[EK_] = Floor[Piecewise[{{0, 0 < EK < 8130},
    {((933.70*((Floor[EK] - 8130)/10000) + 1400)*(Floor[EK] - 8130)/
        10000), 8130 < EK <= 
      13469}, {((228.74*((Floor[EK] - 13469)/10000) + 
          2397)*((Floor[EK] - 13469)/10000) + 1014), 
     13469 < EK <= 52881},
    {(0.42*Floor[EK] - 8196), 52881 < EK <= 250730},
    {(0.45*Floor[EK] - 15718), 250730 < EK}}]]

Solve[S[x]/x == 0.25, x]

Mathematica is calculating but cannot solve the equation. The same goes for another set of equations.

Does anybody see the error in the equation or the function?

Beste wishes

$\endgroup$
6
$\begingroup$

It is best to provide exact numbers for Solve. This works (just a reminder, more often than not you should use S[EK_]:=... for function definitions, see e.g.: What is the difference between Set and SetDelayed?):

Solve[S[x]/x == 0.25 // Rationalize, x]

{{x -> 47876}, {x -> 47880}}

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.