How to invert a function
- To: mathgroup at smc.vnet.net
- Subject: [mg81120] How to invert a function
- From: Teodoro <jwheeler51 at gmail.com>
- Date: Thu, 13 Sep 2007 06:24:59 -0400 (EDT)
Hi,
this is my first post ro the Mathematica group, so, please be patient ...
The problem I'm trying to solve is a little bit more complex, but
anyway I was able to reproduce the unwanted behaviour using a "toy" example.
As far as I understand the fragment of code
m = 7.984136668700428`*^-14; p = 38.64734299516908`; n =
9.185777`*^-7; q = 7.729468599033817`; r = -9.18579746734159`*^-7;
f[y_] = m Exp[p y];
g[x_] := Solve[f[y] == x, y]
h[x_] := y /. g[x]
allows me to get y as a function of x. To check that h[x] is indeed
the inverse of f[y] (you already know the solution !) one can run
Evaluate[f[h[z]]]
Evaluate[h[f[z]]]
for any value of z you get again z:
z -> h[z] -> f[h[z]=z
z -> f[z] -> h[f[z]=z
or
Plot[Evaluate[h[x]], {x, 1, 20}, PlotRange -> {Full}]
and get a straight line.
However, when I try to invert
f[y_] = m Exp[p y]+n Exp[q y]+r
I get some result, but the result is WRONG !
In another system I get the correct behaviour, even with more complex
functions ...
I can guess that somewhere in the answers I can get the one I need,
but the Forum is so immense !
Thanks
Teodoro