1
$\begingroup$

I simply want to solve:

Reduce[((M*Exp[β*M*(1 - x)])/β)*((1/M) - β*x - Exp[-β*M*(1 - x)]) + (1/M) == 0, x]

where

&& x > 0 && x < 1 && β >= 0  && M > 0 

Apparently, reduce cannot solve and Solve or NSolve gives a warning.

In the end, I just want to plot x versus beta.

$\endgroup$
6
  • 1
    $\begingroup$ There must be a better way than this: expr = ((M*Exp[β*M (1 - x)])/β)*((1/M) - β*x - Exp[-β*M (1 - x)]) + (1/M); ListPlot[Map[{x, β} /.#&, Map[Last,Select[Table[ NMinimize[{Norm[ expr], x == j, β >= 0, M > 0}, {x, β, M}], {j, .02, .98, .02}], #[[1]] < 10^-6 &]]]] It complains about zero denominators but then selects solutions and plots x versus β. $\endgroup$ – Bill Jul 1 '18 at 16:28
  • 1
    $\begingroup$ I doubt the is an analytical solution for your equation. And if you want to use NSolve, you'll have to specify numeric values for all variables (except x, of course) $\endgroup$ – Lukas Lang Jul 1 '18 at 16:49
  • $\begingroup$ If you tighten your conditions with β >= 0.1 then the complaints about zero denominators go away while not seeming to lose any solutions. $\endgroup$ – Bill Jul 1 '18 at 17:30
  • $\begingroup$ I think the solution produced by Solve is satisfactory, despite the warning. $\endgroup$ – Michael E2 Jul 2 '18 at 0:40
  • $\begingroup$ Thanks for that discovery @Bill! I will take a look. Also, @Michael E2, how can we be sure that the solution given by Solve is satisfactory? You don't have to spell everything out, you can just give me an idea. Everyone is very helpful here and non-judgmental it seems. If this was Quora or Reddit, however, I probably would be shamed for such a question. $\endgroup$ – user59026 Jul 2 '18 at 18:48
1
$\begingroup$

As Lukas Lang he said it can't be found analytical solution for your equation,only numerically.

I assume Mvalue. M is in range 1..5and has values:

Table[M, {M, 1, 5, 1/2}] // N
(* {1., 1.5, 2., 2.5, 3., 3.5, 4., 4.5, 5.} *)

func[x_, β_, M_] := 1/M + (E^(M (1 - x) β)M (-E^(-M (1 - x) β) + 1/M - x β))/β

ContourPlot[Evaluate@Table[func[x, β, M] == 0, {M, 1, 5, 1/2}], {β, 0, 1}, {x, 0, 1}, 
FrameLabel -> Automatic, PlotLegends -> {"M=1", "M=1.5", "M=2", "M=2.5", "M=3", "M=3.5", 
"M=4", "M=4.5", "M=5"}]

enter image description here

I will use Bill code with little improved by me.It's slow and give artifacts!.Just for the curiosity and comparison.

expr = ((M*Exp[β*M (1 - x)])/β)*((1/M) - β*x - Exp[-β*M (1 - x)]) + (1/M); 
ListLinePlot[Table[Map[{β, x} /. # &, Map[Last, Select[Table[
NMinimize[{Norm[expr], x == j, β >= 0}, {β, x}, 
Method -> "NelderMead"], {j, 1/100, 1, 1/100}], #[[1]] < 
10^-5 &]]], {M, 1, 5, 1/2}], PlotRange -> {{0, 1}, {0, 1}}, 
PlotLabels -> {"M=1", "M=1.5", "M=2", "M=2.5", "M=3", "M=3.5", 
"M=4", "M=4.5", "M=5"}, AxesLabel -> {"β", "x[β]"}, AspectRatio -> 1] // Quiet

enter image description here


EDITED: 02.07.2018

Approximate solution by series at point x=1/2 of order 3.

eq = ((M*Exp[β*M*(1 - x)])/β)*((1/M) - β*x - Exp[-β*M*(1 - x)]) + (1/M);
eq1 = Series[((M*Exp[β*M*(1 - x)])/β)*((1/M) - β*x -Exp[-β*M*(1 - x)]) + 
(1/M), {x, 1/2, 3}] // Normal
sol = x /. Solve[eq1 == 0, x];(*Only first solution !!! *)

Plot[Evaluate@Table[sol[[1]], {M, 1, 5, 1/2}], {β, 0, 1}, 
PlotRange -> {{0, 1}, {0, 1}}, 
PlotLabels -> {"M=1", "M=1.5", "M=2", "M=2.5", "M=3", "M=3.5", "M=4",
"M=4.5", "M=5"}, AxesLabel -> {"β", "x[β]"}, AspectRatio -> 1]

enter image description here

$\endgroup$
1
  • $\begingroup$ Great plots! Thanks! I appreciate your effort. By the way, I found a potential way to evaluate this expression using a fast Fourier transform (hindawi.com/journals/ijem/2015/523043). I am not sure which way would be ideal, since I haven't used this in practice, but I guess I can just compare the results and see what happens! $\endgroup$ – user59026 Jul 2 '18 at 18:44
0
$\begingroup$

Besides the complete answers other gave you, I would like to add some considerations. Defining

z=Exp[M (1-x) beta]

for the constraints on M, x, beta you have z>=1. This position gives you the equation

beta (1-z M x)==(M-z)

where z depends on M, x, z. One equation in three unknowns of course cannot give a definite answer.

$\endgroup$
1
  • $\begingroup$ Thanks! And, yes, I was aware of this. M is a fixed parameter. One equation and two unknowns, provided I fix the value of M, allows me to express x in terms of beta - which was the aim $\endgroup$ – user59026 Jul 2 '18 at 18:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy