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

Intro Page

This is a two mass pendulum connected by a massless bar.

Can you predict what will happed when the simulation starts?

    NameValueTypeDimension
    NameValueTypeDimension

    Init Page

    t=0; I=m1*r1*r1+m2*r2*r2; w=0;

    Evol Page

    Indep. Var. Increment
    d c /dt=w
    d w /dt=(m1*r1-m2*r2)*g*Math.sin(c)/I
    SolverRungeKutta AbsoluteTolerance=0.00001

    FixRel Page

    cs=Math.cos(c); sc=Math.sin(c); x1=-r1*sc; y1=r1*cs; x2=r2*sc; y2=-r2*cs; f1=m1*r1*w*w; f2=m2*r2*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)
    int,int,double,double,double
    title="Frame"
    layout=border
    visible=true
    location="164,10"
    size="499,526"
    position=center
    autoscaleX=false
    autoscaleY=false
    minimumX=xmin
    maximumX=xmax
    minimumY=ymin
    maximumY=ymax
    square=true
    background=BLACK
    x=x1
    y=y1
    sizeX=x2-x1
    sizeY=y2-y1
    lineColor=128,255,64
    x=x1
    y=y1
    sizeX=-r1*w*cs
    sizeY=-r1*w*sc
    visible=showv
    lineColor=255,128,0
    fillColor=255,128,0
    x=x2
    y=y2
    sizeX=r2*w*cs
    sizeY=r2*w*sc
    visible=showv
    lineColor=255,128,0
    fillColor=255,128,0
    x=x1
    y=y1
    sizeX=0
    sizeY=-m1
    visible=showf
    lineColor=128,0,255
    fillColor=128,0,255
    x=x2
    y=y2
    sizeX=0
    sizeY=-m2
    visible=showf
    lineColor=128,0,255
    fillColor=128,0,255
    x=0
    y=0
    sizeX=size2
    sizeY=size2
    lineColor=192,0,0
    fillColor=192,0,0
    x=x1
    y=y1
    sizeX=f1*sc
    sizeY=-f1*cs
    visible=showf
    lineColor=MAGENTA
    fillColor=MAGENTA
    x=x2
    y=y2
    sizeX=-f2*sc
    sizeY=f2*cs
    visible=showf
    lineColor=MAGENTA
    fillColor=MAGENTA
    x=x2
    y=y2
    sizeX=size*Math.sqrt(m2)
    sizeY=size*Math.sqrt(m2)
    transformation=c
    enabledPosition=true
    dragAction=r2=Math.sqrt(x2*x2+y2*y2); x2=r2*Math.sin(c); y2=-r2*Math.cos(c);
    style=RECTANGLE
    lineColor=192,128,0
    fillColor=192,128,0
    x=x1
    y=y1
    sizeX=size*Math.sqrt(m1)
    sizeY=size*Math.sqrt(m1)
    transformation=c
    enabledPosition=true
    dragAction=r1=Math.sqrt(x1*x1+y1*y1); x1=-r1*Math.sin(c); y1=r1*Math.cos(c);
    style=RECTANGLE
    lineColor=192,128,0
    fillColor=192,128,0
    position=south
    layout=border
    position=east
    layout=VBOX
    borderType=LOWERED_ETCHED
    background=192,128,0
    layout=GRID:0,1,0,0
    foreground=128,255,64
    variable=showf
    selected=true
    text="show f"
    variable=showv
    text="show v"
    layout=HBOX
    text="Reset"
    image=/org/opensourcephysics/resources/controls/images/reset.gif
    action=_reset()
    background=BLACK
    foreground=128,0,128
    variable=_isPaused
    textOn="Play"
    imageOn=/org/opensourcephysics/resources/controls/images/play.gif
    actionOn=_play()
    foreground=128,0,128
    background=BLACK
    textOff="Pause"
    imageOff=/org/opensourcephysics/resources/controls/images/pause.gif
    actionOff=_pause()
    foregroundOff=128,0,128
    backgroundOff=BLACK
    position=center
    layout=GRID:2,0,0,0
    background=192,128,0
    foreground=192,0,128
    variable=m1
    minimum=1
    maximum=10
    format="m1=0"
    dragaction=I=m1*r1*r1+m2*r2*r2;
    variable=m2
    minimum=1
    maximum=10
    format="m2=0"
    dragaction=I=m1*r1*r1+m2*r2*r2;
    variable=r1
    minimum=0.0
    maximum=xmax
    format="r1=0.0"
    variable=r2
    minimum=size
    maximum=xmax
    format="r2=0.0"
    position=south
    layout=HBOX
    foreground=128,128,0
    variable=sc
    minimum=0.0
    format="sc = 0.0"
    orientation=HORIZONTAL
    variable=cs
    minimum=0.0
    format="cs = 0.0"
    orientation=HORIZONTAL
    position=east
    variable=c
    minimum=0.0
    maximum=2*pi
    orientation=VERTICAL
    enabled=_isPaused()
    action=_initialize()
    background=192,128,0