3
$\begingroup$

how can I solve the following equation

x[r_]=-16*(0.189*Log[3.35-r]-0.0861*Log[-1.078+r]-0.103*Log[4.42+r])

and obtain r[x]?

$\endgroup$
1
  • 1
    $\begingroup$ Knowing x[r] you could use InverseFunction $\endgroup$ Jul 11, 2018 at 7:51

1 Answer 1

12
$\begingroup$

You could define the inverse function "by hand":

rx[x_?NumericQ] := r /. NSolve[{x == -16*(0.189*Log[3.35 - r] - 0.0861*Log[-1.078 + r] - 0.103*Log[4.42 + r])}, r, Reals][[1]]

and check it

Show[{ParametricPlot[{r, -16*(0.189*Log[3.35 - r] - 0.0861*Log[-1.078 + r] -0.103*Log[4.42 + r])}, {r, 0, 3}, 
AspectRatio -> 1, AxesLabel -> {r, x}],
Graphics[Point[Table[{rx[x], x}, {x, -5, 5, .25}]]]}]

Alternatively you can use InverseFunction:

ri = InverseFunction[Function[{r}, -16*(0.189*Log[3.35 - r] - 0.0861*Log[-1.078 + r] -0.103*Log[4.42 + r])]]
ParametricPlot[{ri[x], x}, {x, -5, 5}, AspectRatio -> 1]    

enter image description here

$\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.