Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

solving non-algebraic exponential equations

256 views
Skip to first unread message

Eva Hohberger

unread,
Nov 28, 2002, 2:19:45 PM11/28/02
to
I am trying to solve the following equation for given values of two
parameters a and b:

NSolve[Exp[-Pi*a/x] + Exp[-Pi*b/x] == 1, x]

This is straightforward for integer values of the parameters a and b
(e.g. a=1, b=1). However, Mathematica is unable to compute the
solution for non-integer values of a and b (e.g. a=1.1, b=1.1; even
a=1.0, b=1.0 doesn't work). Instead, the error message "Solve::"tdep":
"The equations appear to involve the variables to be solved for in an
essentially non-algebraic way." is produced.

Can anybody point out a way to overcome this problem and to obtain a
solution?

Thanks,
Eva

Jens-Peer Kuska

unread,
Dec 3, 2002, 4:39:09 AM12/3/02
to
Hi,

what ist with

With[{a = 1.1, b = 1.0},
FindRoot[Exp[-Pi*a/x] + Exp[-Pi*b/x] == 1, {x, 1}]
]

Regards
Jens

David Park

unread,
Dec 3, 2002, 4:45:20 AM12/3/02
to
Eva,

Instead of NDSolve you could try something like this...

f[a_, b_] := Exp[-Pi*a/x] + Exp[-Pi*b/x]

Plot[f[1.1,2.5]-1,{x,0,10}];

FindRoot[f[1.1, 2.5] == 1, {x, 6}]
{x -> 7.71189}

David Park
dj...@earthlink.net
http://home.earthlink.net/~djmp/

Tomas Garza

unread,
Dec 3, 2002, 4:49:32 AM12/3/02
to
Indeed, NSolve gives a list of numerical approximations to the roots of a
polynomial equation (cf. OnLine Help). Use instead FindRoot, and of course
you'll have to supply numerical values for a and b, as well as initial
values. This shouldn't be difficult if you begin by plotting your function
to see where to set initial values for the root finding process. For
example, if you define

In[1]:=
g[x_, a_, b_] := Exp[(-Pi)*(a/x)] + Exp[(-Pi)*(b/x)] - 1

and plot this function, say for a = 2.5 and b = 3.0, you'll find that the
root lies somewhere between 11 and 13:

In[2]:=
Plot[g[x, 2.5, 3.], {x, 1, 15}, PlotRange ->
{{8, 15}, {-1, 1}}];

Then use FindRoot:

In[3]:=
FindRoot[g[x, 2.5, 3.] == 0, {x, {11, 13}}]
Out[3]=
{x -> 12.428204959984097}

Tomas Garza
Mexico City

Steve Luttrell

unread,
Dec 3, 2002, 5:06:00 AM12/3/02
to
The following works OK in Mathematica 4.2 for Windows:

input:

With[{a = 1.1, b = 1.1},


NSolve[Exp[-Pi*a/x] + Exp[-Pi*b/x] == 1, x]

]

output:

{{x -> 4.9856}}

Steve Luttrell


"Eva Hohberger" <eva.hoe...@gmx.net> wrote in message
news:as5q8h$nin$1...@smc.vnet.net...

Theodore A Sande

unread,
Dec 3, 2002, 5:22:32 AM12/3/02
to
Dear Miss Hohberger:

In reference to your question:

"I am trying to solve the following equation for given values of two
parameters a and b:

NSolve[Exp[-Pi*a/x] + Exp[-Pi*b/x] == 1, x]

This is straightforward for integer values of the parameters a and b
(e.g. a=1, b=1). However, Mathematica is unable to compute the
solution for non-integer values of a and b (e.g. a=1.1, b=1.1; even
a=1.0, b=1.0 doesn't work). Instead, the error message "Solve::"tdep":
"The equations appear to involve the variables to be solved for in an
essentially non-algebraic way." is produced.

Can anybody point out a way to overcome this problem and to obtain a
solution?"

The most expedient method to solve this non-linear algebraic equation for
the variable, x, is to treat it as a 1-dimensional non-linear root extraction
problem. There are a host of numerical techniques to accomplish this, e.g.
the venerable Newton-Raphson technique.

Mathematica surely implements a variation of this as follows:

In := a = 3.22
b = 0.322
xInitial = 1.3
FindRoot[Exp[-a*Pi/x] + Exp[-b*Pi/x] == 1, {x, xInitial}]

Out: {x -> 5.61282}

The above values are examples of single precision real numbers. xInitial is
the initial guess for the "root", or solution, of the exponentially
non-linear algebraic equation.

FindRoot successively iterates the wrong initial solution, xInitial, until
it converges upon the true solution up to a given number of decimal point.

WARNING:

( 1 ) There is probably a way to specify the number of digits, or accuracy, of
your solution.

( 2 ) In general, there will be many roots, both real and complex. I am not
sure how FindRoot decides which root, if many, it will present to you.

Make sure the value returned is physically germane to the problem
that yielded the question in the first place.

( 3 ) Try many xInitials over a wide range of real values and see if you
converge to a difference root.

I hope this helps. Please email me as to your results, as I now may use this
in my work, too!


Sincerely,

Theodore Sande
MIT Department of Physics


Vladimir Bondarenko

unread,
Dec 3, 2002, 5:25:41 AM12/3/02
to
eva.hoe...@gmx.net (Eva Hohberger) wrote on Thursday, November 28, 2002, 3:08:00 PM :


EH> I am trying to solve the following equation for given values of two
EH> parameters a and b:

EH> NSolve[Exp[-Pi*a/x] + Exp[-Pi*b/x] == 1, x]

EH> This is straightforward for integer values of the parameters a and b
EH> (e.g. a=1, b=1). However, Mathematica is unable to compute the
EH> solution for non-integer values of a and b (e.g. a=1.1, b=1.1; even
EH> a=1.0, b=1.0 doesn't work). Instead, the error message "Solve::"tdep":
EH> "The equations appear to involve the variables to be solved for in an
EH> essentially non-algebraic way." is produced.

EH> Can anybody point out a way to overcome this problem and to obtain a
EH> solution?

Your may wish to use FindRoot.

a = 1.1; b = 1.1;
FindRoot[Exp[-Pi*a] + Exp[-Pi*b/x] == 1, {x, 1/10^100, 10}]

{x -> 107.748}

a = Random[Real, 1, 1000];
b = Random[Real, 1, 1000];
FindRoot[Exp[-Pi*a] + Exp[-Pi*b/x] == 1, {x, 1/10^100, 10}]

{x -> 0.741772}

Best wishes,

Vladimir Bondarenko
Mathematical and Production Director
Symbolic Testing Group

http://www.CAS-testing.org/ GEMM Project (95% ready)

Email: v...@mail.strace.net
Voice: (380)-652-447325 Mon-Fri 6 a.m. - 3 p.m. GMT
ICQ : 173050619
Mail : 76 Zalesskaya Str, Simferopol, Crimea, Ukraine

milkcart

unread,
Dec 3, 2002, 5:27:45 AM12/3/02
to

You can use FindRoot after plotting the graph of your equation.
For example

Plot[Exp[-Pi*0.5/x] + Exp[-Pi*3.0/x], {x, 0, 10}]
FindRoot[Exp[-Pi*0.5/x] + Exp[-Pi*3.0/x] == 1, {x, 2}]

> NSolve[Exp[-Pi*a/x] + Exp[-Pi*b/x] == 1, x]

>However, Mathematica is unable to compute the

> solution for non-integer values of a and b (e.g. a=1.1, b=1.1; even

> a=1.0, b=1.0 doesn't work). Instead, the error message "Solve::"tdep":

> "The equations appear to involve the variables to be solved for in an

> essentially non-algebraic way." is produced.


**************
milkcart


David Park

unread,
Dec 4, 2002, 3:49:50 AM12/4/02
to
Theodore,

For more robust root finding there is a package on MathSource, RootSearch,
by Ted Ersek. I claim that there can be no such thing as a perfect root
finding package, and for specific applications it may be useful to look for
specific transformations that put the problem in a more reasonable form.
Nevertheless, Ted's package is extremely good. It will, for example, find
all the roots in an interval to a specified precision.

One of the problems with the standard FindRoot routine is that you can't
specify an interval and say to stay withing the interval. Mathematica just
quits when an approximation takes it outside the interval, instead of
switching methods.

From: Theodore A Sande [mailto:tas...@MIT.EDU]

Dear Miss Hohberger:

In reference to your question:

"I am trying to solve the following equation for given values of two
parameters a and b:

NSolve[Exp[-Pi*a/x] + Exp[-Pi*b/x] == 1, x]

This is straightforward for integer values of the parameters a and b
(e.g. a=1, b=1). However, Mathematica is unable to compute the


solution for non-integer values of a and b (e.g. a=1.1, b=1.1; even
a=1.0, b=1.0 doesn't work). Instead, the error message "Solve::"tdep":
"The equations appear to involve the variables to be solved for in an
essentially non-algebraic way." is produced.

Can anybody point out a way to overcome this problem and to obtain a

0 new messages