MathGroup Archive 2012

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

Search the Archive

Re: Reduce command Mathematica

  • To: mathgroup at smc.vnet.net
  • Subject: [mg128269] Re: Reduce command Mathematica
  • From: Alexei Boulbitch <Alexei.Boulbitch at iee.lu>
  • Date: Wed, 3 Oct 2012 03:07:49 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-newout@smc.vnet.net
  • Delivered-to: mathgroup-newsend@smc.vnet.net

> Reduce[2 n - Tanh[z] Tanh[2 n z] == 0, z]

Hi.  I can't get this to work either.
Here's a technique when working with 1 equation, and 2 variables.
You are looking for the contour of 0.
(Mouse over the 0 line in the chart for confirmation)

equ=2 n-Tanh[z] Tanh[2 n z];

ContourPlot[
equ,{n,-2,2},{z,-3,3},

Contours->Range[-4,4],
CoordinatesToolOptions->Automatic,
FrameLabel->{"n","z"}
]


As you can see, the obvious solution is n=0.
But, there is also a solution near the top and bottom with  -.5 < n <+.5

Sometimes, putting further constraints works, but it doesn't work here:

Reduce[{equ == 0 , -1/2 < n < 1/2}, z, Reals]

  << No Luck >>

For example, if n = 1 / 4, then it won't catch the solution for z of Log[2+Sqrt[3]]  :

equ /. {n -> 1 / 4,  z-> Log[2+Sqrt[3]]}   //FullSimplify

0

Hopefully, someone can jump in with a better idea:

= = = = = = = = = =
HTH  :>)
Dana DeLouis
Mac & Mathematica 8
= = = = = = = = = =

Hi, Dana,

It depends upon what do you consider to be a satisfactory answer. I would not expect that
the solution z=z(n) can be found analytically in the explicit form for an
y n. The solution given
by Bob Hanlon here (http://forums.wolfram.com/mathgroup/archive/2012/Sep/msg00332.html)
looks difficult to compare with the contour plot you have built.

If you would be satisfied by a numeric solution, consider the following.
At n<0.5 one can solve your equation directly. This function gives the solution, z,
provided the parameter n is fixed:

f1[n_] := FindRoot[(2 n - Tanh[z] Tanh[2 n z]), {z, 1}]

This returns the list of pairs {n,z}, where z is the solution corresponding to the n value:

lst1 = Table[{n, f1[n][[1, 2]]}, {n, 0.01, 0.4, 0.01}];

As soon as n>=0.5 the function f1[n] is unable to find a solution or at least I do not know how to
force it to. The reason becomes clear after a look on the contour plot you have built. The growth
z=z(n) corresponding to the solution becomes here too steep, and solution requires the growing precision.
However, one can easily go around this problem. It is instead solving for z with n playing the role of the parameter, we can solve for n with z being 
the parameter.
This function returns the n as the solution at fixed parameter z: 

f2[z_] := FindRoot[(2 n - Tanh[z] Tanh[2 n z]), {n, 0.45}]

Now the following makes a second list of pairs {n,z} where n values are now the solutions, while z values are fixed:

lst2 = Table[{f2[z][[1, 2]], z}, {z, 1.2, 10, 0.1}];

Since these two lists have the same structure we can join them. Now you can build a plot out of this and what?
Look at it? Use it? Throw it away? Whatever you like.
Execute this:

lst = Join[lst1, lst2];
ListPlot[lst, PlotRange -> All,
 AxesLabel -> {Style["n", 16], Style["z", 16]}]

One else thing could be done here at least in principle, if you need an analytic solution. In that case you might want to think of approximating the obtained result by some suitable function.

Have fun, Alexei

Alexei BOULBITCH, Dr., habil.
IEE S.A.
ZAE Weiergewan,
11, rue Edmond Reuter,
L-5326 Contern, LUXEMBOURG

Office phone :  +352-2454-2566
Office fax:       +352-2454-3566
mobile phone:  +49 151 52 40 66 44

e-mail: alexei.boulbitch at iee.lu






  • Prev by Date: Sum pattern
  • Next by Date: LaTeX output - my experience
  • Previous by thread: Re: Reduce command Mathematica
  • Next by thread: Multi Thread in Mathematica (not multi core)