This is the web version of EJS interface
EJS version 4.3.5
  1. Author=Andrew Duffy - Boston University
  2. Abstract=aduffy@bu.edu
  3. CaptureTools=true
  4. DataTools=true
  5. LanguageTools=true
  6. EmersionSupport=false
  7. AppletColSupport=false
  8. UseInterpreter=true

    variables

    NameValueTypeDimension

    Init Page

    //_view.resetTraces(); t = 0; accln[0]= -10; accln[1] = -26; accln[2] = -1.6; resetValues(); setValuesEarth(); setValuesJupiter(); setValuesMoon(); counter = 0.0; index = 1;

    Evol Page

    Indep. Var. Increment
    d y_pos /dt=vel
    d vel /dt=accln
    d counter /dt=inversedt
    SolverMidPoint AbsoluteTolerance=0.001

    Cons Page

    if ((y_pos[0] <= 0.001)) { y_pos[0] = 0.0; _pause(); } if ((y_pos[1] <= 0.001)) { y_pos[1] = 0.0; _pause(); } if ((y_pos[2] <= 0.001)) { y_pos[2] = 0.0; _pause(); } if (counter >= maxCount) { index = index + 1; counter = 0.0; }

    restart

    public void restart () { resetValues (); // Earth Variable; vel[0] = velEarthInitial; y_pos[0] = heightEarthInitial; weight[0] = massEarth*accln[0]; //Jupiter Variable vel[1] = velJupiterInitial; y_pos[1] = heightJupiterInitial; weight[1] = massJupiter*accln[1]; //Moon Variable vel[2] = velMoonInitial; y_pos[2] = heightMoonInitial; weight[2] = massMoon*accln[2]; t = 0; //v2 = v2i; counter = 0.0; index = 1; _view.resetTraces(); // _play(); } public void resetValues () { velEarthInitial = 10; heightEarthInitial = 5; massEarth = 5; velJupiterInitial = 0; heightJupiterInitial = 8; massJupiter = 20; velMoonInitial = -3; heightMoonInitial = 10; massMoon = 3; } public void setValuesEarth () { _view.resetTraces(); t = 0; // Earth Variable; vel[0] = velEarthInitial; y_pos[0] = heightEarthInitial; weight[0] = massEarth*accln[0]; } public void setValuesJupiter () { //Jupiter Variable vel[1] = velJupiterInitial; y_pos[1] = heightJupiterInitial; weight[1] = massJupiter*accln[1]; } public void setValuesMoon () { //Moon Variable vel[2] = velMoonInitial; y_pos[2] = heightMoonInitial; weight[2] = massMoon*accln[2]; }
    EJSVIEW: Click link to view it's content
    Control variables:(testing)
    double,double,double,double,double,double,double,double,double
    title="Freefall"
    layout=border
    visible=true
    location="0,0"
    size="913,557"
    position=east
    layout=border
    position=north
    layout=grid:0,1,0,0
    size="100,500"
    variable=_isPaused
    font=Tahoma,BOLD,12
    textOn=Play
    actionOn=_play()
    foreground=BLUE
    background=ORANGE
    textOff=Pause
    actionOff=_pause()
    foregroundOff=BLUE
    backgroundOff=ORANGE
    text="Step"
    action=_step()
    background=ORANGE
    foreground=BLUE
    font=Tahoma,BOLD,12
    text="Restart"
    action=restart()
    background=ORANGE
    foreground=BLUE
    font=Tahoma,BOLD,12
    variable=t
    format="t = 0.00 s"
    editable=false
    font=Arial,BOLD,16
    position=center
    layout=GRID:1,2,0,0
    layout=VBOX
    position=east
    autoscaleX=true
    autoscaleY=true
    minimumX=0
    maximumX=1
    minimumY=0.0
    maximumY=22.0
    square=true
    title="Earth"
    titleX="Earth"
    majorTicksX=true
    majorTicksY=true
    x=0.5
    y=y_pos[0]
    sizex=massEarth/20
    sizey=massEarth/20
    enabled=false
    x=0.0
    y=0.0
    sizeX=4.0
    sizeY=0.5
    style=RECTANGLE
    elementposition=NORTH
    fillColor=GRAY
    x=-1.5
    y=20
    pixelSize=true
    text=_format(vel[0],"0.0") + " m/s"
    font=Arial,BOLD,14
    lineColor=BLUE
    fillColor=BLUE
    drawingFill=true
    x=0.5
    y=y_pos[0]
    sizeX=0
    sizeY=accln[0]/8
    lineWidth=2
    x=-1.5
    y=19
    pixelSize=true
    text=_format(y_pos[0],"0.0") + " m"
    font=Arial,BOLD,14
    lineColor=BLUE
    fillColor=BLUE
    drawingFill=true
    x=-1.5
    y=18
    pixelSize=true
    text=_format(massEarth,"0.0") + " kg"
    font=Arial,BOLD,14
    lineColor=BLUE
    fillColor=BLUE
    drawingFill=true
    x=2
    y=y_pos[0]
    pixelSize=true
    text=_format(weight[0],"0") + " N"
    font=Arial,BOLD,14
    lineColor=BLUE
    fillColor=BLUE
    drawingFill=true
    layout=grid:0,1,0,0
    size="50,50"
    background=GREEN
    position=north
    text="Setting the Initial Velocity"
    alignment=CENTER
    foreground=BLUE
    font=Arial,PLAIN,14
    position=south
    text=_format(velEarthInitial,"0.0")+" m/s"
    alignment=CENTER
    foreground=BLUE
    font=Arial,PLAIN,14
    position=center
    variable=velEarthInitial
    value=0.0
    minimum=-10
    maximum=10
    action=setValuesEarth ()
    layout=GRID:0,1,0,0
    size="50,50"
    background=YELLOW
    position=south
    text="Setting the Initial Height"
    alignment=CENTER
    foreground=BLUE
    font=Arial,PLAIN,14
    position=north
    text=_format(heightEarthInitial,"0.0")+" m"
    alignment=CENTER
    foreground=BLUE
    font=Arial,PLAIN,14
    position=center
    variable=heightEarthInitial
    value=5
    minimum=0.0
    maximum=20
    action=setValuesEarth ()
    layout=GRID:0,1,0,0
    size="50,50"
    background=GREEN
    position=south
    text="Setting the Mass"
    alignment=CENTER
    foreground=BLUE
    font=Arial,PLAIN,14
    position=north
    text=_format(massEarth,"0.0")+" kg"
    alignment=CENTER
    foreground=BLUE
    font=Arial,PLAIN,14
    position=center
    variable=massEarth
    value=15
    minimum=10
    maximum=25
    action=setValuesEarth ()
    layout=VBOX
    position=center
    autoscaleX=true
    autoscaleY=true
    minimumX=0
    maximumX=1
    minimumY=0.0
    maximumY=22.0
    square=true
    title="Jupiter"
    titleX=Position
    majorTicksX=true
    majorTicksY=true
    x=0.5
    y=y_pos[1]
    sizex=massJupiter/20
    sizey=massJupiter/20
    enabled=false
    x=0.0
    y=0.0
    sizeX=4.0
    sizeY=0.5
    style=RECTANGLE
    elementposition=NORTH
    fillColor=GRAY
    x=0.5
    y=y_pos[1]
    sizeX=0
    sizeY=accln[1]/8
    lineColor=BLACK
    fillColor=BLACK
    lineWidth=2
    x=-1
    y=20
    pixelSize=true
    text=_format(vel[1],"0.0") + " m/s"
    font=Arial,BOLD,14
    lineColor=BLUE
    fillColor=BLUE
    drawingFill=true
    x=-1.5
    y=19
    pixelSize=true
    text=_format(y_pos[1],"0.0") + " m"
    font=Arial,BOLD,14
    lineColor=BLUE
    fillColor=BLUE
    drawingFill=true
    x=-1.5
    y=18
    pixelSize=true
    text=_format(massJupiter,"0.0") + " kg"
    font=Arial,BOLD,14
    lineColor=BLUE
    fillColor=BLUE
    drawingFill=true
    x=2
    y=y_pos[1]
    pixelSize=true
    text=_format(weight[1],"0") + " N"
    font=Arial,BOLD,14
    lineColor=BLUE
    fillColor=BLUE
    drawingFill=true
    position=north
    layout=grid:0,1,0,0
    size="50,50"
    background=YELLOW
    position=north
    text="Setting the Initial Velocity"
    alignment=CENTER
    foreground=BLUE
    font=Arial,PLAIN,14
    position=south
    text=_format(velJupiterInitial,"0.0")+" m/s"
    alignment=CENTER
    foreground=BLUE
    font=Arial,PLAIN,14
    position=center
    variable=velJupiterInitial
    value=0.0
    minimum=-10
    maximum=10
    action=setValuesJupiter ()
    layout=GRID:0,1,0,0
    size="50,50"
    background=GREEN
    position=south
    text="Setting the Initial Height"
    alignment=CENTER
    foreground=BLUE
    font=Arial,PLAIN,14
    position=north
    text=_format(heightJupiterInitial,"0.0")+" m"
    alignment=CENTER
    foreground=BLUE
    font=Arial,PLAIN,14
    position=center
    variable=heightJupiterInitial
    value=5
    minimum=0.0
    maximum=20
    action=setValuesJupiter ()
    layout=GRID:0,1,0,0
    size="50,50"
    background=YELLOW
    position=south
    text="Setting the Mass"
    alignment=CENTER
    foreground=BLUE
    font=Arial,PLAIN,14
    position=north
    text=_format(massJupiter,"0.0")+" kg"
    alignment=CENTER
    foreground=BLUE
    font=Arial,PLAIN,14
    position=center
    variable=massJupiter
    value=15
    minimum=10
    maximum=25
    action=setValuesJupiter ()
    layout=VBOX
    position=center
    autoscaleX=true
    autoscaleY=true
    minimumX=0
    maximumX=1
    minimumY=0.0
    maximumY=22.0
    square=true
    title="Moon"
    titleX=Position
    majorTicksX=true
    majorTicksY=true
    x=0.5
    y=y_pos[2]
    sizex=massMoon/20
    sizey=massMoon/20
    enabled=false
    x=0.0
    y=0.0
    sizeX=4.0
    sizeY=0.5
    style=RECTANGLE
    elementposition=NORTH
    fillColor=GRAY
    x=0.5
    y=y_pos[2]
    sizeX=0
    sizeY=accln[2]/8
    lineWidth=2
    x=-1
    y=20
    pixelSize=true
    text=_format(vel[2],"0.0") + " m/s"
    font=Arial,BOLD,14
    lineColor=BLUE
    fillColor=BLUE
    drawingFill=true
    x=-1.5
    y=19
    pixelSize=true
    text=_format(y_pos[2],"0.0") + " m"
    font=Arial,BOLD,14
    lineColor=BLUE
    fillColor=BLUE
    drawingFill=true
    x=-1.5
    y=18
    pixelSize=true
    text=_format(massMoon,"0.0") + " kg"
    font=Arial,BOLD,14
    lineColor=BLUE
    fillColor=BLUE
    drawingFill=true
    x=2
    y=y_pos[2]
    pixelSize=true
    text=_format(weight[2],"0") + " N"
    font=Arial,BOLD,14
    lineColor=BLUE
    fillColor=BLUE
    drawingFill=true
    layout=grid:0,1,0,0
    size="50,50"
    background=GREEN
    position=north
    text="Setting the Initial Velocity"
    alignment=CENTER
    foreground=BLUE
    font=Arial,PLAIN,14
    position=south
    text=_format(velMoonInitial,"0.0")+" m/s"
    alignment=CENTER
    foreground=BLUE
    font=Arial,PLAIN,14
    position=center
    variable=velMoonInitial
    value=0.0
    minimum=-10
    maximum=10
    action=setValuesMoon ()
    layout=GRID:0,1,0,0
    size="50,50"
    background=YELLOW
    position=south
    text="Setting the Initial Height"
    alignment=CENTER
    foreground=BLUE
    font=Arial,PLAIN,14
    position=north
    text=_format(heightMoonInitial,"0.0")+" m"
    alignment=CENTER
    foreground=BLUE
    font=Arial,PLAIN,14
    position=center
    variable=heightMoonInitial
    value=5
    minimum=0.0
    maximum=20
    action=setValuesMoon ()
    layout=GRID:0,1,0,0
    size="50,50"
    background=GREEN
    position=south
    text="Setting the Mass"
    alignment=CENTER
    foreground=BLUE
    font=Arial,PLAIN,14
    position=north
    text=_format(massMoon,"0.0")+" kg"
    alignment=CENTER
    foreground=BLUE
    font=Arial,PLAIN,14
    position=center
    variable=massMoon
    value=15
    minimum=10
    maximum=25
    action=setValuesMoon ()