Group Abstract Group Abstract

Message Boards Message Boards

0
|
8.1K Views
|
22 Replies
|
10 Total Likes
View groups...
Share
Share this post:

trascendental equations in Mathematica

Posted 11 years ago

Hi all,

my name is luca I am a physicist and I do research in a company in Germany. I am trying to get a solution with Mathematica to

Solve[x^a-a*Log[1-x]==c && 1/2<x<1&&0<a<1,x,Reals]

but I cannot get a solution. x is the variable, a and c are parameters. From "plot" I can tell there is one solution. Could anybody suggest the best way to get the root in this case? Solve, NSolve, Reduce and Root would generate the same Warning " This system cannot be solved with the methods available to ..."

Thanks a lot in advance

POSTED BY: Luca D.
22 Replies
Posted 11 years ago

Sorry for one more post. c must be greater than 0.5^a - a*Log[0.5] so that 0.5 < x < 1. And rather than fixing a number of iterations, it is almost certainly better to have a minimum and maximum number of iterations along with a reasonable stopping rule. I was just being lazy with the example.

POSTED BY: Jim Baldwin
Posted 11 years ago

Now I remember. When a = 1, then c must be greater than 1.19315 to have 0.5 < x < 1. So while the numeric method provides real solutions for c > 1, some of those will result in x <= 0.5. A test could be added to check for the proper lower limit of c given a.

POSTED BY: Jim Baldwin
Posted 11 years ago

Ooops! Not sure where I got that c must be greater than 1.19315 as c must be greater than or equal to 1. However, the numerical method described above does give a real result when a is between 0 and 1 and c is greater than zero.

POSTED BY: Jim Baldwin

Let's set a=1/2, because of $1=(1-x)\exp\left(\frac{c-x^a}{a}\right)$ one could ask for the fourier transform. The 1 goes to the dirac delta , but

In[64]:= (* a = 1/2 *)
FourierTransform[E^(2 (c - Sqrt[x])) (1 - x), x, w]

Out[64]= (1/(8 Sqrt[2 \[Pi]] w^4 Abs[w]^(9/2)))E^(
 2 c - I/w) (-2 I E^(2 I/w) Sqrt[2 \[Pi]] w^5 (2 - 3 I w + 2 w^2) + 
   Sqrt[2 \[Pi]]
     w^4 (-3 I w + E^(2 I/w) (4 - 3 I w + 4 w^2)) Abs[w] - 
   3 I (-1 + E^(2 I/w)) Sqrt[2 \[Pi]] w^3 Abs[w]^3 + 
   4 E^(I/w) Abs[w]^(
    9/2) (E^(I/w) Sqrt[\[Pi]] Sqrt[I w] (2 I + 3 w + 2 I w^2) - 
      2 I w (1 - I w + w^2) + 
      E^(I/w) Sqrt[\[Pi]] Sqrt[
       I w] (2 - 3 I w + 2 w^2) Erfi[1/Sqrt[I w]]) + 
   32 I E^(I/w) w^5 Sqrt[Abs[w]]
     HypergeometricPFQ[{2}, {3/4, 5/4}, -(1/(4 w^2))] + 
   8 E^(I/w) w^4 Abs[w]^(
    5/2) (I w HypergeometricPFQ[{1}, {1/4, 3/4}, -(1/(4 w^2))] - 
      2 HypergeometricPFQ[{1}, {3/4, 5/4}, -(1/(4 w^2))] + 
      HypergeometricPFQ[{1, 3/2}, {1/4, 1/2, 3/4}, -(1/(4 w^2))]))

no chance to solve for w and to transform back. You need a truly clever trick to transform the condition or a numerical procedure along the lines Jim Baldwin proposed.

POSTED BY: Udo Krause
Posted 11 years ago
POSTED BY: Jim Baldwin
POSTED BY: Udo Krause
Posted 11 years ago
POSTED BY: Jim Baldwin
Posted 11 years ago

Hi Gianluca,

thanks for your help. I've just noticed the complex numbers come when I evaluate the Newton's method too far away from the actual solution. This brings the story to the original problem, because I need to know where the solution roughly is before getting an analytical expression of it. Outside Mathematica the solution should be used often, so I might need a different approach to get one analytical expression to be quickly used.

POSTED BY: Luca D.

For some purposes this may work:

myRoot[a_?NumericQ, c_?NumericQ] := 
 x /. ToRules@
   Reduce[x^Rationalize[a] - Rationalize[a]*Log[1 - x] == 
      Rationalize[c] && 1/2 < x < 1, x, Reals]

For example, you get a plot with

Plot[myRoot[a, 2], {a, 1/2, 1}]
POSTED BY: Gianluca Gorni
Posted 11 years ago
POSTED BY: Jim Baldwin
Posted 11 years ago

Hi Jim,

thanks for your suggestion. I do need to use the analytical solution outside Mathematica, so I believe "Interpolation" does not help.

POSTED BY: Luca D.
Posted 11 years ago
POSTED BY: Luca D.
Posted 11 years ago
POSTED BY: Luca D.

Can't you represent the power $x^a$ as a logarithmic expression to homogenize the look of the equation? Have you tried all flavours of simplify on the equation, to get some idea where to find the next step?

POSTED BY: Udo Krause

One searches for a $y$ satisfying the equation $x^a=-a \log(1-y)$

In[16]:= Solve[x^a == -a Log[1 - y] && 0 < a < 1 && 1/2 < x < 1, y, Reals]
Out[16]= {{y -> ConditionalExpression[1 - E^(-(x^a/a)), 0 < a < 1 && 1/2 < x < 1]}}

that's trivial but allows to transform the equation into $(1-x)\exp\left(-\frac{x^a}{a}\right)=\exp\left(-\frac{c}{a}\right)$. This will not be solved again

Solve[(1 - x) Exp[-x^a/a] == Exp[-c/a] && 1/2 < x < 1 && 0 < a < 1, x, Reals]
Solve::nsmet: This system cannot be solved with the methods available to Solve. >>

but can be expressed as $(1-x)\exp\left(\frac{c-x^a}{a}\right)=1$.

It's interesting to see how different quality the corresponding ContourPlot3D for the three equivalent equations are.

Any derivative of the above mentioned expression must vanish, but I do not see an usage of that fact.

But one could try to develop around $a = 1$. At least for $a=1$ a solution appears

In[36]:= Solve[(1 - x) Exp[c - x] == 1 , x]
During evaluation of In[36]:= Solve::ifun: Inverse functions are being used by Solve, so some solutions may not be found; use Reduce for complete solution information. >>
Out[36]= {{x -> 1 - ProductLog[E^(1 - c)]}}
POSTED BY: Udo Krause

For $a \rightarrow 0$ you catch a condition: $c \rightarrow 1$. Somehow raising $a$ from $0$ one could possibly see what $c$ has to be?

In[44]:= Solve[E^((c - x^a)/a) (1 - x) == 1, c]
Out[44]= {{c -> ConditionalExpression[x^a - a (2 I \[Pi] C[1] + Log[1 - x]), C[1] \[Element] Integers]}}

Returned to sender. Gosh!

Solve[E^((c - x^a)/a) (1 - x) == 1, a]
Solve::nsmet: This system cannot be solved with the methods available to Solve. >>

of course.

You could solve

In[47]:= Solve[E^((c - x^a)/a) (c - x^a)/a == 1, x]
During evaluation of In[47]:= Solve::ifun: Inverse functions are being used by Solve, so some solutions may not be found; use Reduce for complete solution information. >>
Out[47]= {{x -> (c - a ProductLog[1])^(1/a)}}

but again no benefit from this information is visible.

POSTED BY: Udo Krause
Posted 11 years ago
POSTED BY: Luca D.

my name is luca

I live on the second floor ... ---- sorry, could simply not resist ----.

Have you tried already to do a RegionPlot3D with the equation? This is the surface in question

region plot

This is the companion as surface

contour plot

The goal is a function $x=f(c,a)$ which is as much as possible an analytic expression, right?

P.S.: Originallyl I wrote ParametricPlot3D, which was wrong, of course, I'm sorry about that.

POSTED BY: Udo Krause
POSTED BY: Henrik Schachner
Posted 11 years ago

Hi Henrik,

we'getting there .... thanks for your suggestion :) The Newton's method is working nicely for some values of (x,a). However, sometimes the provided solution is complex and the comparison to the attended values get bad. Would you have suggestion on how to restrict the Newton's method to reals?

POSTED BY: Luca D.

Hi Luca,

I think the complex values show up when x<0. This typically happens when there is no solution at all (e.g. when c>0). Have you ever encountered a complex "solution" when there definitely is a zero crossing?

Ciao Henrik

POSTED BY: Henrik Schachner
POSTED BY: S M Blinder
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard