Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #16007

Re: request help

From Daniel Lichtblau <danl@wolfram.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: request help
Date 2011-02-05 10:45 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <iij9ng$gps$1@smc.vnet.net> (permalink)

Show all headers | View raw


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

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: request help Daniel Lichtblau <danl@wolfram.com> - 2011-02-05 10:45 +0000

csiph-web