5
$\begingroup$
c = 0.7;
s = 1;
    sol = Solve[
       A == (Exp[(h + 2*c*A)/s] - 
           Exp[-(h + 2*c*A)/s])/(Exp[(h + 2*c*A)/s] + 
           Exp[-(h + 2*c*A)/s]), A, Reals];
    Plot[Evaluate[A /. sol], {h, -1, 1}, Exclusions -> None]

Hi everyone,

If c becomes larger than 0.5 there is a gap in the graph. It must be a kind of s-shape. Does anyone know how to correct this?

Many thanks, Steven

graph

$\endgroup$
3
  • $\begingroup$ Welcome to Mathematica.SE! 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour and check the faqs! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! $\endgroup$
    – user9660
    Commented Dec 15, 2016 at 12:19
  • $\begingroup$ Solve gives me error messages, isn't it the case for you? $\endgroup$
    – Kuba
    Commented Dec 15, 2016 at 12:40
  • $\begingroup$ @Kuba Yes, but then the solve is evaluated in the plot, hence me thinking setdelayed. $\endgroup$
    – Feyre
    Commented Dec 15, 2016 at 12:41

3 Answers 3

11
$\begingroup$

Mindless approach:

ContourPlot[
 A == (Exp[(h + 2*c*A)/s] - Exp[-(h + 2*c*A)/s])/(Exp[(h + 2*c*A)/s] +
      Exp[-(h + 2*c*A)/s]),
 {h, -1, 1},
 {A, -1, 1}
 ]

enter image description here

$\endgroup$
9
$\begingroup$

Because at Abs[h]<=0.1518, there are multiple solutions:

sol[h_] := 
  Solve[A == (Exp[(h + 2*c*A)/s] - 
       Exp[-(h + 2*c*A)/s])/(Exp[(h + 2*c*A)/s] + 
       Exp[-(h + 2*c*A)/s]), A, Reals];

Show[Plot[A /. sol[h], {h, -1, 1}, Exclusions -> None], 
 Plot[{(A /. sol[h])[[#]] & /@ {1,2, 3}}, {h, -0.1518, 0.158}]]

enter image description here

$\endgroup$
1
$\begingroup$

In this particular case, since

(Exp[(h + 2*c*A)/s] - Exp[-(h + 2*c*A)/s])/
(Exp[(h + 2*c*A)/s] + Exp[-(h + 2*c*A)/s]) // ExpToTrig

(* Tanh[(2 A c)/s + h/s] *)

the given equation is (on the assumption that all quantities are real)

h == s ArcTanh[A] - 2 c A

so that ParametricPlot may be used:

c = 0.7; s = 1;
ParametricPlot[{s ArcTanh[A] - 2 c A, A}, {A, -1, 1}, 
PlotRange -> {{-1.05, 1.05}, {-1.05, 1.05}}]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.