This is the web version of EJS interface
EJS version 4.1
  1. Title=position vs time
  2. Author=weelookang@gmail.com
  3. Keywords=position
  4. Level=secondary
  5. Language=english
  6. Abstract=a virtual experience of the displacement, velocity acceleration vs time
  7. CaptureTools=true
  8. DataTools=true
  9. LanguageTools=true

    Var Table

    NameValueTypeDimension

    Init Page

    //You can add //x=xs=0; //(your initial value) at the Initialization page.
    Indep. Var. Increment
    d x /dt=v
    d v /dt=a
    SolverMidPointTolerance=0.001

    FixRel Page

    //If you want to calculate velocity, you need to save previous x, //suppose we save it as xs (define xs first). //Add the following line in the Fixed relations Page: v=(x-xs)/dt; // x is the new value , and xs is the previous one. xs=x;// save x value to xs a=(v-vs)/dt; // x is the new value , and xs is the previous one. vs=v;// save x value to xs

    Lib Page

    public void drag () { // x1 = x; // after adding this, the simulation seems more smooth in time t t = t +dt; // need to counter the fact that the simulation runs slow when on drag() //x2 = x+v*dt; //v = (x2 - x1)/dt; }
    EJSVIEW: Click link to view it's content
    Control variables:(testing)
    title="frame"
    layout=border
    visible=true
    location="31,1"
    size="635,805"
    position=south
    layout=HBOX
    position=center
    variable=_isPaused
    imageOn="/org/opensourcephysics/resources/controls/images/play.gif"
    actionOn=_play()
    imageOff="/org/opensourcephysics/resources/controls/images/pause.gif"
    actionOff=_pause()
    position=north
    image="/org/opensourcephysics/resources/controls/images/reset.gif"
    action=_reset()
    position=west
    layout=VBOX
    position=center
    variable=x
    format="x=0.00"
    variable=xs
    format="xs=0.00"
    position=north
    variable=y
    format="y=0.00"
    variable=t
    format="t=0.00"
    variable=v
    format="v=0.00"
    variable=a
    format="a = 0.00"
    variable=x1
    format="x1=0.00"
    variable=x-xs
    format="x-xs = 0.00000"
    variable=x2
    format="x2=0.00"
    position=center
    layout=VBOX
    position=north
    autoscaleX=true
    autoscaleY=true
    title="position vs time"
    axesType=CARTESIAN3
    inputX=t
    inputY=x
    connected=true
    lineColor=BLUE
    lineWidth=size*10
    position=center
    autoscaleX=true
    autoscaleY=true
    title="velocity vs time"
    axesType=CARTESIAN3
    inputX=t
    inputY=v
    connected=true
    lineColor=MAGENTA
    lineWidth=size*1
    position=south
    autoscaleX=true
    autoscaleY=true
    title="acceleration vs time"
    axesType=CARTESIAN3
    inputX=t
    inputY=a
    connected=true
    lineColor=RED
    lineWidth=size*1
    position=north
    layout=border
    position=center
    autoscaleX=false
    autoscaleY=false
    minimumX=-1.0
    maximumX=1.0
    minimumY=-1.0
    maximumY=1.0
    square=true
    x=mx
    y=my
    dragaction=drag=true;
    action=drag=false;
    size="0,50"
    x=x
    y=y
    sizeX=size
    sizeY=size
    visible=true
    enabledPosition=true
    dragAction=y =0; drag();
    lineColor=BLUE
    fillColor=BLUE