TransWikia.com

How can I merge these two graphs?

Mathematica Asked on March 19, 2021

Please I would like to plot, in the same graph, these two curves. How can I do that?

Manipulate[
 ListPlot[Table[
   NIntegrate[
    Sqrt[((2*(Exp[(r)/(2)] - ((v0)^2))    ))/(r*
         Exp[(r)/(2)] - ((2*(Exp[(r)/(2)] - ((v0)^2))    )))], {r, 
(2*(1)*(1 + ( 
          LambertW[((( 0^2  ) - (v0^2))/(Exp[
               1]))]   ))), (2*(1)*(1 + ( 
          LambertW[((( u^2  ) - (v0^2))/(Exp[1]))]   )))}], {u, 0, k, 
    1}], Joined -> True, InterpolationOrder -> 1], {k, 1, 
  20}, {v0, -0.9, 0.9}]

and

Manipulate[
 ListPlot[Table[
   NIntegrate[-Sqrt[((2*(Exp[(r)/(2)] - ((v0)^2))    ))/(r*
          Exp[(r)/(2)] - ((2*(Exp[(r)/(2)] - ((v0)^2))    )))], {r, 
(2*(1)*(1 + ( 
          LambertW[((( 0^2  ) - (v0^2))/(Exp[
               1]))]   ))), (2*(1)*(1 + ( 
          LambertW[((( u^2  ) - (v0^2))/(Exp[1]))]   )))}], {u, 0, k, 
    1}], Joined -> True, InterpolationOrder -> 1], {k, 1, 
  20}, {v0, -0.9, 0.9}]

Source: https://sites.google.com/view/curvedrealityblog/texts-in-physics/mathematica-and-similar-softwares?authuser=0

One Answer

I think you're asking for the following:

Manipulate[
 ListPlot[{Table[NIntegrate[Sqrt[((2*(Exp[(r)/(2)] - ((v0)^2))))/
       (r*Exp[(r)/(2)] - ((2*(Exp[(r)/(2)] - ((v0)^2)))))],
     {r, (2*(1)*(1 + (LambertW[(((0^2) - (v0^2))/(Exp[1]))]))),
      (2*(1)*(1 + (LambertW[(((u^2) - (v0^2))/(Exp[1]))])))}], {u, 0, k, 1}], 
   Table[NIntegrate[-Sqrt[((2*(Exp[(r)/(2)] - ((v0)^2))))/
        (r*Exp[(r)/(2)] - ((2*(Exp[(r)/(2)] - ((v0)^2)))))],
     {r, (2*(1)*(1 + (LambertW[(((0^2) - (v0^2))/(Exp[1]))]))),
      (2*(1)*(1 + (LambertW[(((u^2) - (v0^2))/(Exp[1]))])))}], {u, 0, k, 1}]},
  Joined -> True, InterpolationOrder -> 1],
 {{k, 5}, 1, 20},
 {v0, -0.9, 0.9}
 ]

Two functions plotted in a Manipulate

Correct answer by JimB on March 19, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP