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; vx=0;

    Evol Page

    Indep. Var. Increment
    d x /dt=vx
    d vx /dt=getF(x,vx)/m
    SolverRungeKuttaTolerance=0.001

    FixRel Page

    K=m*vx*vx/2; if(_isPaused()){ if(showL0)msg="drag spring to change original length"; else msg="Drag block to move away from equilibrium"; }else msg="constant friction force fr= mu*m*g"; if(t>10 && Math.abs(vx)<1.e-3)_pause();

    getF

    public double getF (double x,double v) { return -k*(x-xmin-L0)-m*g*mu*v; }
    EJSVIEW: Click link to view it's content
    Control variables:(testing)
    double,double
    title="Frame"
    layout=border
    visible=true
    size="605,537"
    position=south
    layout=HBOX
    borderType=LOWERED_ETCHED
    variable=mu
    minimum=0.0
    maximum=2.0
    format="friction coefficient mu=0.0"
    ticks=21
    closest=true
    variable=k
    minimum=10
    maximum=100.0
    format="spring constant k=0.0"
    ticks=10
    closest=true
    layout=GRID:0,2,0,0
    position=center
    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()
    variable=showL0
    text="show L0"
    position=center
    layout=border
    position=north
    autoscaleX=false
    autoscaleY=false
    minimumX=xmin
    maximumX=xmax
    minimumY=ymin
    maximumY=ymax
    square=true
    size="0,100"
    x=0
    y=0
    sizeX=xmax-xmin
    sizeY=ymax
    style=RECTANGLE
    elementposition=NORTH
    lineColor=200,220,208
    fillColor=200,220,208
    x=x
    y=size2+0
    sizeX=size
    sizeY=size
    enabledPosition=_isPaused()
    sensitivity=0
    releaseAction=t=0; vx=0; _play();
    style=RECTANGLE
    elementposition=WEST
    lineColor=GRAY
    fillColor=GRAY
    lineWidth=stroke
    x=xmin
    y=size2
    sizeX=x-xmin
    sizeY=0
    radius=size2
    loops=20
    x=x0
    y=0+0
    sizeX=0+0
    sizeY=ymax+0
    visible=false
    enabledPosition=_isPaused()
    enabledSize=false
    dragAction=L0=x0-xmin;
    x=xmin+0
    y=-size
    sizeX=L0
    sizeY=0+0
    visible=showL0
    enabledSize=true
    radius=size2
    loops=20
    x=xmax
    y=ymin/2
    pixelSize=true
    text=%msg%
    elementposition=EAST
    position=center
    autoscaleX=true
    autoscaleY=true
    title="x(t):black, vx(t):red, K(t):blue"
    titleX="t(s)"
    x=t
    y=K/scale
    maxpoints=npt
    active=_isPlaying() && vx!=0
    norepeat=true
    connected=_isPlaying() && vx!=0
    color=BLUE
    memory=ntrace
    x=t
    y=x-xmin-L0
    maxpoints=npt
    active=_isPlaying() && vx!=0
    norepeat=true
    connected=_isPlaying() && vx!=0
    memory=ntrace
    x=t
    y=vx
    maxpoints=npt
    active=_isPlaying() && vx!=0
    norepeat=true
    connected=_isPlaying() && vx!=0
    color=RED
    memory=ntrace