Re: request help
- To: mathgroup at smc.vnet.net
- Subject: [mg116450] Re: request help
- From: "Sjoerd C. de Vries" <sjoerd.c.devries at gmail.com>
- Date: Wed, 16 Feb 2011 04:33:09 -0500 (EST)
- References: <iig76m$rl2$1@smc.vnet.net> <iij9l4$gnb$1@smc.vnet.net>
But I have a much better approach for you. Just try: InverseDis[d_, n_] := r /. FindRoot[Dis[r, n] == d, {r, 0.5}] In[757]:= InverseDis[0.15, 5] Out[757]= 0.742527 In[758]:= InverseDis[Dis[1, 5], 5] Out[758]= 1. Cheers -- Sjoerd On Feb 5, 11:43 am, "Sjoerd C. de Vries" <sjoerd.c.devr... at gmail.com> wrote: > Well, I don't have an analytic approach. I just note that the plot of > the function seems smooth enough that it can be easily fitted, for > instance by the product of n and a polynome in r of order 4, as long > as you stay out of the forbidden areas of this plot: > > ContourPlot[dis[r, n], {r, -1, 1}, {n, -1, 6}] > > So, here some fit examples: > > DynamicModule[{f, b, c}, > f[r_, n_] := n (b r^2 + c r^4); > Manipulate[ > {b, c} = {b1, c1} /. > FindFit[Table[{r, dis[r, n]}, {r, -0.2, 0.2, .01}], > n b1 x^2 + n c1 x^4, {b1, c1}, x]; > Show[ > Plot[f[r, n], {r, -.2, .2}, PlotStyle -> Directive[Red, Dashed], > PlotRange -> All], > Plot[dis[r, n], {r, -.2, .2}, PlotRange -> All, > PlotStyle -> Directive[Blue, DotDashed]] > , ImageSize -> 500, Frame -> True], > {n, 1, 5}, TrackedSymbols -> {n} > ] > ] > > Given the fit, the road to the inverted function is now easy and left > as an exercise to the reader. > > Cheers -- Sjoerd > > On Feb 4, 7:43 am, Berihu Teklu <beri... at gmail.com> wrote: > > > I need to invert a real function of two real variables Dis[r, n] with > > respect to the first variable r, while the second variable n is fixed. > > The function is rather difficult, that I couldn't invert it. this is > > kindly request you to write me any comments on the attached notebook. > > > Many thanks for any help, > > > Berihu > > > Dis[r_, n_] := > > 1/4 (2 (-2 + Sqrt[(1 + 2 n)^2]) Log[-2 + Sqrt[(1 + 2 n)^2]] - > > 2 (2 + Sqrt[(1 + 2 n)^2]) Log[ > > 2 + Sqrt[(1 + 2 n)^2]] - (-2 + > > Sqrt[(1 + 2 n)^2 Cosh[2 r]^2]) Log[-2 + > > Sqrt[(1 + 2 n)^2 Cosh[2 r]^2]] + (2 + > > Sqrt[(1 + 2 n)^2 Cosh[2 r]^2]) Log[ > > 2 + Sqrt[(1 + 2 n)^2 Cosh[2 r]^2]] - (-2 + > > Sqrt[((1 + 2 n)^2 (1 + 2 n - > > 2 Cosh[2 r])^2)/(-2 + (1 + 2 n) Cosh[2 r])^2]) Log[= -2= > + > > Sqrt[((1 + 2 n)^2 (1 + 2 n - > > 2 Cosh[2 r])^2)/(-2 + (1 + 2 n) Cosh[2 r])^2]] + (2= + > > Sqrt[((1 + 2 n)^2 (1 + 2 n - > > 2 Cosh[2 r])^2)/(-2 + (1 + 2 n) Cosh[2 r])^2]) Log[ > > 2 + Sqrt[((1 + 2 n)^2 (1 + 2 n - > > 2 Cosh[2 r])^2)/(-2 + (1 + 2 n) Cosh[2 r])^2]]) > > > Solve[1/4 (2 (-2 + Sqrt[(1 + 2 n)^2]) Log[-2 + Sqrt[(1 + 2 n)^2]] - > > 2 (2 + Sqrt[(1 + 2 n)^2]) Log[ > > 2 + Sqrt[(1 + 2 n)^2]] - (-2 + > > Sqrt[(1 + 2 n)^2 Cosh[2 r]^2]) Log[-2 + > > Sqrt[(1 + 2 n)^2 Cosh[2 r]^2]] + (2 + > > Sqrt[(1 + 2 n)^2 Cosh[2 r]^2]) Log[ > > 2 + Sqrt[(1 + 2 n)^2 Cosh[2 r]^2]] - (-2 + > > Sqrt[((1 + 2 n)^2 (1 + 2 n - > > 2 Cosh[2 r])^2)/(-2 + (1 + 2 n) Cosh[2 r])^2]) L= og= > [-2 + > > Sqrt[((1 + 2 n)^2 (1 + 2 n - > > 2 Cosh[2 r])^2)/(-2 + (1 + 2 n) Cosh[2 r])^2]] += (= > 2 + > > Sqrt[((1 + 2 n)^2 (1 + 2 n - > > 2 Cosh[2 r])^2)/(-2 + (1 + 2 n) Cosh[2 r])^2]) L= og= > [ > > 2 + Sqrt[((1 + 2 n)^2 (1 + 2 n - > > 2 Cosh[2 r])^2)/(-2 + (1 + 2 n) Cosh[2 r])^2]]) = = > == > > Dis[r, n], r] > >