This is the web version of EJS interface
EJS version 4.2
  1. Author=Fu-Kwun Hwang - Dept. of Physics, National Taiwan Normal Univ.
  2. Abstract=hwang@phy.ntnu.edu.tw
  3. CaptureTools=true
  4. DataTools=true
  5. LanguageTools=true
    NameValueTypeDimension
    NameValueTypeDimension

    Init Page

    for(int i=0;i<n;i++){ py[i]=ymin+i*d; pvy[i]=0; } t=0; yc=0.8*ymax; vys=100;

    Evol Page

    Indep. Var. Increment
    d yc /dt=vyc
    d vyc /dt=getF(-1,vyc)/m
    d py[i] /dt=pvy[i]
    d pvy[i] /dt=getF(i,pvy[i])/m
    SolverMidPoint AbsoluteTolerance=0.00001

    FixRel Page

    if(bgmove){ vy=-pvy[0]; for(int i=0;i<n;i++){ if(py[i]>ymin+i*d){ py[i]-=d; } } }else{ vy=vyc; if(yc<ymin)yc+=(ymax-ymin); } if(t>5 && Math.abs(vy-vys)<1.e-5){ if(!bgmove){ if(yc<0.8*ymin)_pause(); }else _pause(); } vys=vy;
    double dv; public double dvalue (double v) { if(v>0)dv=0.5; else if(v<0)dv=-0.5; else dv=0; return (int)(v*100+dv)/100.; }
    public double getF (int i,double vy) { if(i<0){ if(!bgmove)return -m*g+b*vy*vy; }else{ if(bgmove)return m*g-b*vy*vy; } return 0; }
    EJSVIEW: Click link to view it's content
    Control variables:(testing)
    double
    title="Frame"
    layout=border
    visible=true
    size="499,526"
    position=south
    layout=border
    position=east
    layout=GRID:0,1,0,0
    borderType=LOWERED_ETCHED
    image=/org/opensourcephysics/resources/controls/images/reset.gif
    action=_reset()
    variable=_isPaused
    imageOn=/org/opensourcephysics/resources/controls/images/play.gif
    actionOn=_play()
    imageOff=/org/opensourcephysics/resources/controls/images/pause.gif
    actionOff=_pause()
    position=center
    layout=HBOX
    variable=bgmove
    text="back ground moving"
    variable=b
    minimum=0.0
    maximum=1.0
    format="b=0.00"
    enabled=_isPaused()
    action=_initialize()
    position=center
    layout=border
    position=west
    autoscaleX=false
    autoscaleY=false
    minimumX=xmin
    maximumX=xmax
    minimumY=ymin
    maximumY=ymax
    square=true
    size="100,0"
    x=xc
    y=yc
    sizeX=size
    sizeY=size
    lineColor=GRAY
    fillColor=GRAY
    numberOfElements=n
    x=x1
    y=py
    sizeX=size
    sizeY=size
    fillColor=LIGHTGRAY
    numberOfElements=n
    x=x2
    y=py
    sizeX=size
    sizeY=size
    fillColor=LIGHTGRAY
    numberOfElements=n
    x=x1
    y=py
    sizeX=0
    sizeY=pvy
    visible=bgmove
    lineColor=RED
    fillColor=RED
    numberOfElements=n
    x=x2
    y=py
    sizeX=0
    sizeY=pvy
    visible=bgmove
    lineColor=RED
    fillColor=RED
    x=xc
    y=yc
    sizeX=0
    sizeY=vyc
    visible=!bgmove
    lineColor=RED
    fillColor=RED
    position=center
    autoscaleX=true
    autoscaleY=true
    title="F=m*g-b*v^2"
    x=t
    y=vy
    memory=5
    memorycolor=LIGHTGRAY
    maxpoints=npt
    active=_isPlaying()
    norepeat=true
    connected=_isPlaying()