0
$\begingroup$
EQ = 
  {R''[l] == 0.9897  R[l],  R'[0] == 0, R[0] == 1, 
   Z'[l] == Sqrt[1 - R'[l]^2], Z[0] == 0}; 

NDSolve[EQ, {R, Z}, {l, 0, 2}];

{z[u_], r[u_]} = {Z[u], R[u]} /. First[%];

ParametricPlot[{z[l], r[l]}, {l, 0, 2}, 
  PlotStyle -> {Red, Thick},  
  AspectRatio -> Automatic, 
  GridLines -> Automatic] 

Table[{l, z[l], r[l], r'[l]}, {l, 0, 2, .2}] // TableForm

The output above first plot seems to succeed for portions of z[l] and r[l] for as long as they are real, however, it does not plot on real axes with r[l] and r'[l] even if they are real.

So, what is a numerical workaround to plot them? Taking the real part with zero imaginary part is not so elegant an option I feel.

(As remote connected background I refer to Zeeman/ R. Thom's views, but in mathematics, perhaps, there is no such catastrophe. We know what happens in a geometric singularity.)

$\endgroup$
  • 1
    $\begingroup$ Related (duplicates?): (17202), (34365), (75405) -- In V10.1, everything works fine without using Re or Chop, but in earlier versions, that's the solution you find in these links. $\endgroup$ – Michael E2 Jul 10 '15 at 15:29
2
$\begingroup$

Is this what you want to plot?

 ParametricPlot[Chop @ {z[l], r[l]}, {l, 0, 2},
   PlotStyle -> {Red, Thick},
   AspectRatio -> Automatic,
   GridLines -> Automatic]

zr

ParametricPlot[Chop @ {r[l], r'[l]}, {l, 0, 2},
  PlotStyle -> {Red, Thick},
  AspectRatio -> Automatic,
  GridLines -> Automatic]

rdr

$\endgroup$
  • $\begingroup$ When the imaginary component is very small making it numeric real, why cannot it be made really real by automatic chopping off the imaginary part inside the software? $\endgroup$ – Narasimham Jul 10 '15 at 18:35
  • $\begingroup$ As noted in the comments to your question, in V10.1, the explicit application of Chop is not needed, so the problem you encountered seems to be fixed. $\endgroup$ – m_goldberg Jul 10 '15 at 21:36
  • $\begingroup$ thanks. ( no future cusp catastrophes !) $\endgroup$ – Narasimham Jul 11 '15 at 13:12

Your Answer

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

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