Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #6070
| From | "David Park" <djmpark@comcast.net> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | RE: Simple question about inverse of a function |
| Date | 2011-10-31 11:57 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <j8m2fe$rvj$1@smc.vnet.net> (permalink) |
| References | <30343966.37232.1319964520601.JavaMail.root@m06> |
I like this kind of question because it reminds us of Mathematica
capabilities that we might be less familiar with. I can't believe this
hasn't been enhanced since Version 2, but perhaps indirectly through Solve.
Since theta is a parameter let's put it in as a SubValue.
Clear[f, g]
conditions = 0 <= t <= 1 && 1 <= theta <= Infinity;
f[theta_][t_] := (1 - t)^theta
g[theta_] = Assuming[conditions, InverseFunction[f[theta]]]
1 - #1^(1/theta) & and a warning message that I believe can be ignored.
Testing:
Simplify[g[theta][f[theta][t]], conditions]
t
The following draws the function, the inverse by interchanging x and y, the
calculated inverse on top of it, and the inverse operating on the function
in blue.
<< Presentations`
With[{theta = 5},
Draw2D[
{Draw[f[theta][t], {t, 0, 1}, PlotRange -> All],
{Opacity[0.2, Black], AbsoluteThickness[7],
ParametricDraw[{f[theta][t], t}, {t, 0, 1}]},
{Red,
Draw[g[theta][t], {t, 0, 1}, PlotRange -> All]},
{Blue,
Draw[g[theta][f[theta][t]], {t, 0, 1}]}},
AspectRatio -> 1,
PlotRange -> Automatic,
Frame -> True, FrameLabel -> {t, None, None, None},
ImageSize -> 200]
]
David Park
djmpark@comcast.net
http://home.comcast.net/~djmpark/
From: Mikael [mailto:mikaen.anderson.1969@gmail.com]
I have a simple question on how to calculate the inverse of a a function.
This is the function I define:
f[t_] := (1 - t)^theta
To calculate the inverse I write:
Assuming[t >= 0 && t <= 1 && theta >= 1 && theta < Infinity, {
InverseFunction[f[t]]}]
but the answer I get is
{InverseFunction[(1 - t)^theta]}.
Now I know I can do this:
In[11]:= Solve[f[g[x]]==x,g[x]]
Out[11]= {{g[x]->1-x^(1/theta)}}
but I wonder what is the correct way of specifying assumptions on t and
theta to make the InverseFunction work. Thanks.
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
RE: Simple question about inverse of a function "David Park" <djmpark@comcast.net> - 2011-10-31 11:57 +0000
csiph-web