MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: request help

  • To: mathgroup at smc.vnet.net
  • Subject: [mg116209] Re: request help
  • From: Daniel Lichtblau <danl at wolfram.com>
  • Date: Sat, 5 Feb 2011 05:45:12 -0500 (EST)

Berihu Teklu 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]) 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]]) ==
>   Dis[r, n], r]
> 

Two problems, at least.

(1) Your input to Solve is tautologically true. What I suspect you 
actually want is something like Dis[n,r]==0.

(2) I doubt Solve will be able to unravel the transcendental functions 
involved, at least not in reasonable time. Might do better to use 
FindRoot and pnly define for explicitly numeric input. You will need to 
provide a reasonable starting point (which you might be able to obtain 
by plotting). Something like

invert[n_?NumericQ, init_] :=
  FindRoot[Dis[r, n] == 0, {r, init}, MaxIterations -> 1000]

Quick example:

In[28]:= inv = invert[2.2, -3 + I]
Out[28]= {r -> -1.45015*10^-8 + 1.5708 I}

In[29]:= Dis[r, 2.2] /. inv
Out[29]= -4.44089*10^-16 + 3.09213*10^-17 I

Daniel Lichtblau
Wolfram Research


  • Prev by Date: Re: request help
  • Next by Date: Re: request help
  • Previous by thread: Re: request help
  • Next by thread: Re: request help