This is the web version of EJS interface
EJS version 5.0
  1. Abstract=http://www.phy.ntnu.edu.tw/ntnujava/ hwang@phy.ntnu.edu.tw
  2. CaptureTools=true
  3. DataTools=false
  4. LanguageTools=true
  5. AppletColSupport=false
  6. UseMacMenuBar=false
  7. RunInBrowserFirst=false
  8. UseInterpreter=true
  9. Author=Fu-Kwun Hwang - Dept. of Physics,National Taiwan normal Univ.
  10. ManifestLines=Permissions: sandbox Codebase: * Caller-Allowable-Codebase: *
    NameValueTypeDimension
    NameValueTypeDimension
    NameValueTypeDimension

    初始值

    t=0; for(int i=0;i<n;i++){ d=(xmax-xmin)/(n-1); x[i]=xmin+i*d; y[i]=0;vy[i]=0; if(i==id){ xi=x[i]; yi=y[i]; } x1[i]=x2[i]=x[i]; y1[i]=y0;vy1[i]=0; y2[i]=-y0;vy2[i]=0; }

    關係式

    if(_isPlaying())t=t+dt; for(int i=0;i<n;i++){ if(x[i]-xmin>v*t){ y[i]=0; vy[i]=0; }else{ c=k*(x[i]-xmin)-w*t; y[i]=-h*Math.sin(c); vy[i]=h*w*Math.cos(c); } if(xmax-x[i]>v*t){ y1[i]=y0; vy1[i]=0; }else{ c=-k*(xmax-x[i])+w*t; y1[i]=y0-h*Math.sin(c); vy1[i]=-h*w*Math.cos(c); } y2[i]=y[i]+y1[i]-2*y0; vy2[i]=vy1[i]+vy[i]; } yi=y[id];

    dvalue

    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.; }
    EJSVIEW: Click link to view it's content
    Control variables:(testing)
    double,double,double,int
    title="Frame"
    layout=border
    visible=true
    location="66,67"
    size="820,440"
    position=center
    autoscaleX=false
    autoscaleY=false
    minimumX=xmin
    maximumX=xmax
    minimumY=ymin
    maximumY=ymax
    square=true
    numberOfElements=n
    x=x
    y=y
    sizeX=size
    sizeY=size
    fillColor=LIGHTGRAY
    numberOfElements=n
    x=x
    y=y
    sizeX=0
    sizeY=vy
    scaley=vscale
    visible=showv
    lineColor=RED
    fillColor=RED
    x=xi
    y=yi
    sizeX=size*1.5
    sizeY=size*1.5
    lineColor=BLUE
    fillColor=0,0,255,128
    x=xt
    y=yt
    sizeX=size*1.5
    sizeY=size*1.5
    visible=_isPaused() && dt2!=0
    fillColor=YELLOW
    x=xt
    y=yt
    sizeX=0
    sizeY=vyt
    scalex=vscale
    visible=_isPaused() && dt2!=0 &&showv
    lineColor=RED
    fillColor=RED
    numberOfElements=n
    x=x1
    y=y1
    sizeX=size
    sizeY=size
    fillColor=LIGHTGRAY
    numberOfElements=n
    x=x1
    y=y1
    sizeX=0
    sizeY=vy1
    scaley=vscale
    visible=showv
    lineColor=RED
    fillColor=RED
    numberOfElements=n
    x=x2
    y=y2
    sizeX=size
    sizeY=size
    fillColor=GRAY
    numberOfElements=n
    x=x2
    y=y2
    sizeX=0
    sizeY=vy2
    scaley=vscale
    visible=showv
    lineColor=RED
    fillColor=RED
    numberOfElements=3
    x=xmin-size
    y=ty
    pixelSize=true
    text=%ys%
    font=Monospaced,PLAIN,20
    elementposition=EAST
    position=south
    layout=border
    position=east
    layout=HBOX
    borderType=LOWERED_ETCHED
    variable=_isPaused
    imageOn=/org/opensourcephysics/resources/controls/images/play.gif
    actionOn=_play()
    imageOff=/org/opensourcephysics/resources/controls/images/pause.gif
    actionOff=_pause()
    text="step"
    action=t=t+dt; _step();
    image=/org/opensourcephysics/resources/controls/images/reset.gif
    action=_reset()
    position=center
    layout=HBOX
    variable=T
    minimum=5.0
    maximum=20.0
    format="T=0.00"
    dragaction=w=2*pi/T; k=w/v;
    action=_initialize()
    variable=v
    minimum=xmax/20
    maximum=xmax/2
    format="v=0.0"
    dragaction=k=w/v;
    action=_initialize()
    variable=dt2
    minimum=-T/4
    maximum=T/4
    format="dt2=0.00"
    enabled=_isPaused()
    dragaction=xt=x[id]; t2=t+dt2; if(xt-xmin>v*t2){ yt=0;vyt=0; }else{ c=k*(xt-xmin)-w*t2; yt=-h*Math.sin(c); vyt=h*w*Math.cos(c); }
    variable=showv
    text="Vy"
    position=north
    variable=id
    minimum=0
    maximum=n
    format="id=0"
    dragaction=yi=y[id]; xi=x[id];