This is the web version of EJS interface
EJS version 4.2.7
  1. CaptureTools=true
  2. DataTools=true
  3. LanguageTools=true
  4. EmersionSupport=true
  5. UseInterpreter=true
  6. AuxiliaryFiles=_examples/_data/paco.gif;_data/pause.gif;_data/play.gif;_data/init.gif;_data/reset.gif;
    NameValueTypeDimension
    NameValueTypeDimension

    Init Page

    dt = maxDt; _setDelay(delay);
    Indep. Var. Increment
    d y /dt=vy
    d vy /dt=g
    SolverMidPoint
    if (y<radius) { double t0 = (-vyPrev-Math.sqrt(vyPrev*vyPrev-2*(yPrev-radius)*g))/g; t = t - dt + t0; vy = -(vyPrev+g*t0); y = radius; }
    Commet:Using the closed form solution of the equation for the movement
    if (y<radius && dt>minDt) { // Go back to previous state and decrease dt y = yPrev; vy = vyPrev; t = t - dt; dt = dt*0.5; plotY = false; // this is so that we don't plot too many points _setDelay(0); // Run as fast as possible now } else { plotY = true; if (vy>0.0 && dt<maxDt) { dt = maxDt; _setDelay(delay); // Run at normal speed } } if (y<=radius) { y = diameter-y; y = radius; vy = -vy; }
    Commet:Adapting the speed and step of the computation when close to rebounding

    freeze

    public void freeze () { vy = 0.0; }
    EJSVIEW: Click link to view it's content
    Control variables:(testing)
    title=mainFrame
    layout=border
    visible=true
    size="372,300"
    position=west
    layout=border
    background=DARKGRAY
    position=north
    layout=grid:0,1,0,0
    image="_data/play.gif"
    enabled=_isPaused
    action=_play()
    size="90,35"
    image="_data/pause.gif"
    enabled=_isPlaying
    action=_pause()
    size="90,35"
    image="_data/reset.gif"
    action=_reset()
    size="90,35"
    image="_data/init.gif"
    action=_initialize()
    size="90,35"
    variable=plot
    selected=false
    text=Plot
    background=GRAY
    foreground=192,255,0
    position=center
    autoscaleX=false
    autoscaleY=false
    minimumX=-10.0
    maximumX=10.0
    minimumY=-0.1
    maximumY=20.0
    background=BLACK
    x=-10.0
    y=0.0
    sizex=20.0
    sizey=0.0
    style=SEGMENT
    color=CYAN
    secondaryColor=CYAN
    x=0.0
    y=y
    sizex=diameter
    sizey=diameter
    pressaction=freeze()
    secondaryColor=192,255,0
    color=255,64,0
    layout=border
    visible=plot
    location=400,0
    size="394,300"
    position=center
    autoscaleX=true
    autoscaleY=false
    minimumY=0.0
    maximumY=20.0
    title=plottingPanel
    interiorBackground=128,192,0
    background=DARKGRAY
    foreground=255,192,0
    x=t
    y=y
    maxpoints=400
    connected=true
    color=128,0,255
    stroke=1.25