This is the web version of EJS interface
EJS version 4.3.0
  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
  6. EmersionSupport=false
  7. UseInterpreter=true
    NameValueTypeDimension
    NameValueTypeDimension
    NameValueTypeDimension

    Init Page

    t=0; x2=x20; y2=y20; x=x0; y=y0-R02; vx=vy=0; vx2=vy2=0; code=0; g1=g*sc0*sc0; d=(y20-(y0-R))/r; dmsg="h="+dvalue(d)+"R"; E=(vx2*vx2+vy2*vy2)/2+g*(y2-y0-R02); g2=0; c=c2=0; w=w2=0;

    Evol Page

    Indep. Var. Increment
    d x2 /dt=vx2
    d vx2 /dt=g1
    d y2 /dt=vy2
    d vy2 /dt=-g1
    d c2 /dt=w2
    d w2 /dt=-g*Math.sin(c2)/R02
    d c /dt=w
    d w /dt=-g*Math.sin(c)/r
    d x /dt=vx
    d y /dt=vy
    d vy /dt=-g2
    SolverRungeKutta AbsoluteTolerance=0.00001

    Name:E,active=E,條件:Method:E,(誤差範圍E),stopatEvent=E
    E


    動作
    E

    Name:t,active=t,條件:Method:t,(誤差範圍t),stopatEvent=t
    t


    動作
    t

    Name:,active=,條件:Method:,(誤差範圍),stopatEvent=


    動作

    FixRel Page

    if(code==1){//circular orbit x2=x0+R02*Math.sin(c2); y2=y0-R02*Math.cos(c2); vx2=R02*w2*Math.cos(c2); vy2=R02*w2*Math.sin(c2); vx=vy=0; K=m2*(vx2*vx2+vy2*vy2)/2; P=m2*g*(y2-y0+R02); c=0; x=x0; y=y0-R02; }else if(code==2){// string or rod x=x0+r*Math.sin(c); y=y0-R02+r-r*Math.cos(c); vx=r*w*Math.cos(c); vy=r*w*Math.sin(c); x2=x0-size2; y2=y0-R02; cst=1; vx2=vy2=0; K=m*(vx*vx+vy*vy)/2; P=m*g*(y-y0+R02); }else{ K=m2*(vx2*vx2+vy2*vy2)/2; P=m2*g*(y2-y0+R02); } E=K+P; if(code==3)T=-m*g; else T=m*r*w*w;

    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)
    title="Frame"
    layout=border
    visible=true
    size="897,484"
    position=center
    autoscaleX=false
    autoscaleY=false
    minimumX=xmin
    maximumX=xmax
    minimumY=ymin
    maximumY=ymax
    square=true
    x=x1
    y=y1
    sizeX=xmin*1.5-x1
    sizeY=x1-xmin*1.5
    lineWidth=stroke
    points=50
    min=0
    max=pi/4
    variable="t"
    functionx="-(R0+size2)*Math.sin(t)+x0"
    functiony="-(R0+size2)*Math.cos(t)+y0"
    javaSyntax=true
    lineWidth=stroke
    x=x0+size2
    y=y0
    sizeX=x-x0
    sizeY=y-y0
    x=x+size2
    y=y
    sizeX=size
    sizeY=size
    elementposition=CENTERED
    x=x20
    y=y20
    sizeX=size
    sizeY=size
    fillColor=null
    x=x2
    y=y2
    sizeX=size
    sizeY=size
    transformation=c2
    enabledPosition=ENABLED_ANY
    dragAction=if(x2<x10){ y2=y10-(x2-x10); }else{ x2=x10; y2=y10; } x20=x2; y20=y2; vx2=vy2=0; c=c2=0; w=w2=0; code=0; d=(y20-(y0-R))/r; dmsg="h="+dvalue(d)+"R";
    style=WHEEL
    lineColor=GRAY
    fillColor=GRAY
    x=x20+size
    y=y20
    pixelSize=true
    text=%dmsg%
    font=Monospaced,PLAIN,18
    elementposition=SOUTH_WEST
    x=x+size2
    y=y
    sizeX=vx
    sizeY=vy
    scalex=vcst
    scaley=vcst
    lineColor=RED
    fillColor=RED
    x=x2
    y=y2
    sizeX=vx2
    sizeY=vy2
    scalex=vcst
    scaley=vcst
    lineColor=RED
    fillColor=RED
    x=x20
    y=y20
    sizeX=2*xmax-xmin
    sizeY=0
    lineColor=128,128,128,128
    x=x+size2
    y=y
    sizeX=0
    sizeY=-m*g
    scalex=0.2
    scaley=0.2
    visible=code==3
    lineColor=BLACK
    fillColor=BLACK
    lineWidth=stroke
    x=x+size2
    y=y
    sizeX=-T*Math.sin(c)
    sizeY=T*Math.cos(c)
    scalex=0.2
    scaley=0.2
    visible=tension && code!=3
    lineWidth=stroke
    x=x+size2
    y=y+size
    pixelSize=true
    visible=code==3
    text="free falll"
    font=Monospaced,PLAIN,16
    elementposition=SOUTH
    x=x+size2
    y=y
    visible=string
    maxpoints=npt
    active=string
    norepeat=true
    connected=string
    x=x20+size
    y=y20-size
    pixelSize=true
    visible=t==0
    text="drag me to change height"
    font=Monospaced,PLAIN,16
    elementposition=NORTH_WEST
    position=south
    layout=border
    position=west
    layout=FLOW:center,0,0
    borderType=LOWERED_ETCHED
    image=/org/opensourcephysics/resources/controls/images/reset.gif
    action=_reset()
    text="init"
    enabled=_isPaused()
    action=_initialize()
    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
    layout=HBOX
    variable=rod
    text="rod"
    variable=string
    text="string"
    action=rod=!string;
    variable=tension
    text="show Tension"
    variable=E
    minimum=0.0
    maximum=xmax*xmax
    format="E=0.00"
    variable=T
    minimum=0.0
    maximum=10.0
    format="T=0.0"