This is the web version of EJS interface
EJS version 4.1
  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

    t=0; omega=0; I=m*R*R;

    Evol Page

    Indep. Var. Increment
    d c /dt=omega
    d omega /dt=calAlpha(c)+g*Math.cos(c)-b*omega/m
    SolverRungeKuttaTolerance=0.001

    FixRel Page

    x=x2-R*Math.cos(c); y=y2-R*Math.sin(c); vx=R*omega*Math.sin(c); vy=-R*omega*Math.cos(c); cta=Math.atan2(y-y1,x-x1);
    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 calAlpha (double c) { cs=Math.cos(c); sc=Math.sin(c); x=x2-R*cs; y=y2-R*sc; L=Math.sqrt((x-x1)*(x-x1)+(y-y1)*(y-y1)); f=-k*(L-L0); fx=f*(x-x1); fy=f*(y-y1); n=-fx*cs-fy*sc; nx=-n*cs; ny=-n*sc; fx=fx-nx; fy=fy-ny; if(c>0)sign=-1; else sign=1; return sign*Math.sqrt(fx*fx+fy*fy)/I; }
    EJSVIEW: Click link to view it's content
    Control variables:(testing)
    int,double,double,double,double
    title="Frame"
    layout=border
    visible=true
    location="23,19"
    size="521,521"
    position=center
    autoscaleX=false
    autoscaleY=false
    minimumX=xmin
    maximumX=xmax
    minimumY=ymin
    maximumY=ymax
    square=true
    x=x1
    y=y1
    sizeX=x-x1
    sizeY=y-y1
    enabledPosition=true
    radius=size2
    x=x1
    y=y1
    sizeX=L0
    sizeY=size
    transformation=cta
    style=RECTANGLE
    elementposition=WEST
    lineColor=192,192,192,128
    fillColor=192,192,192,128
    x=x2
    y=y2
    sizeX=x-x2
    sizeY=y-y2
    enabledPosition=true
    dragAction=R=Math.sqrt((x2-x)*(x2-x)+(y2-y)*(y2-y)); c=Math.atan2(y2-y,x2-x); I=m*R*R;
    lineWidth=stroke
    x=x
    y=y
    sizeX=size
    sizeY=size
    enabledPosition=true
    dragAction=R=Math.sqrt((x2-x)*(x2-x)+(y2-y)*(y2-y)); c=Math.atan2(y2-y,x2-x); I=m*R*R;
    x=x
    y=y
    sizeX=vx
    sizeY=vy
    scalex=vscale
    scaley=vscale
    lineColor=RED
    fillColor=RED
    position=south
    layout=border
    position=west
    layout=GRID:0,2,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()
    text="step"
    action=_step()
    position=center
    layout=GRID:0,2,0,0
    variable=m
    minimum=1
    maximum=10
    format="m=0"
    variable=k
    minimum=1.0
    maximum=100.0
    format="k=0.0"
    variable=b
    minimum=0.0
    maximum=2.0
    format="b=0.00"
    variable=L0
    minimum=size
    maximum=xmax
    format="L=0.0"
    position=east
    variable=g
    minimum=0.0
    maximum=10
    format="g=0.0"
    orientation=VERTICAL
    size="50,0"