This is the web version of EJS interface
EJS version 4.2
  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. DetectedFiles=./_data/earth.gif;./_data/graspingHand.gif;./_data/moon.gif;
    NameValueTypeDimension
    NameValueTypeDimension
    NameValueTypeDimension

    Init Page

    t=0; x2=x=xs; y2=y=ys; vx2=vx=vxs; vy2=vy=vys; release2=release=false; //_view.trace.clear(); //_view.trace2.clear();

    Evol Page

    Indep. Var. Increment
    d x /dt=vx
    d y /dt=vy
    d vx /dt=getF(x,y)/m
    d vy /dt=getF(y,x)/m
    d x2 /dt=vx2
    d y2 /dt=vy2
    d vx2 /dt=getF2(x2,y2)/m
    d vy2 /dt=getF2(y2,x2)/m
    SolverRungeKuttaFehlberg AbsoluteTolerance=0.001

    FixRel Page

    if(release && (x<xmin || x>xmax || y<ymin || y>ymax))_pause();
    double r2,r3; public double getF (double dx,double dy) { if(release)return 0.; r2=dx*dx+dy*dy; r3=r2*Math.sqrt(r2); return -GMm*dx/r3;// F=G*M*m/r^2 But Fx=F*x/r; here we need to return fx } public double getF2 (double dx,double dy) { if(release2)return 0.; r2=dx*dx+dy*dy; r3=r2*Math.sqrt(r2); return -GMm*dx/r3;// F=G*M*m/r^2 But Fx=F*x/r; here we need to return fx }
    public void dragpt () { x2=xs=x; y2=ys=y; vx2=vxs=vx; vy2=vys=vy; } public void dragpt2 () { x=xs=x2; y=ys=y2; vx=vxs=vx2; vy=vys=vy2; }
    EJSVIEW: Click link to view it's content
    Control variables:(testing)
    title="Frame"
    layout=border
    visible=true
    size="865,483"
    position=south
    layout=FLOW:left,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="earth disappear and release ball"
    enabled=!release && !release2
    action=release=release2=true;
    text="earth dispappear"
    enabled=!release2
    action=release2=true;
    text="release ball"
    enabled=!release
    action=release=true;
    variable=showv
    selected=false
    text="show velocity"
    enabled=_isPlaying()
    variable=showtrace
    text="show trace"
    position=center
    layout=GRID:1,0,0,0
    autoscaleX=false
    autoscaleY=false
    minimumX=xmin
    maximumX=xmax
    minimumY=ymin
    maximumY=ymax
    x=0+0
    y=0+0
    trueSize=false
    sizeX=esize
    sizeY=esize
    scalex=0.5
    scaley=0.5
    visible=!release2
    imageFile="./_data/earth.gif"
    x=x2
    y=y2
    sizeX=size2*1.5
    sizeY=size2*1.5
    enabledPosition=_isPaused()
    dragAction=dragpt2 ()
    imageFile="./_data/moon.gif"
    x=x2
    y=y2
    sizeX=vx2
    sizeY=vy2
    visible=showv || _isPaused()
    enabledSize=_isPaused()
    dragAction=if(!release){ vx=vx2; vy=vy2; }
    lineColor=RED
    fillColor=RED
    x=x2
    y=y2
    memory=3
    memorycolor=LIGHTGRAY
    visible=showtrace
    maxpoints=npt
    active=_isPlaying()&& t>dt
    norepeat=true
    connected=_isPlaying()
    position=center
    autoscaleX=false
    autoscaleY=false
    minimumX=xmin
    maximumX=xmax
    minimumY=ymin
    maximumY=ymax
    x=size2
    y=-size2/2
    sizeX=size*1.2
    sizeY=size2*1.2
    transformation=-0.5
    imageFile="./_data/graspingHand.gif"
    x=x
    y=y
    sizeX=size
    sizeY=size
    enabledPosition=_isPaused()
    pressAction=dragpt ()
    x=x
    y=y
    memory=3
    memorycolor=LIGHTGRAY
    visible=showtrace
    maxpoints=npt
    active=_isPlaying() && t>dt
    norepeat=true
    connected=_isPlaying()
    x=x
    y=y
    sizeX=vx
    sizeY=vy
    visible=showv|| _isPaused()
    enabledSize=_isPaused()
    dragAction=if(!release2){ vx2=vx; vy2=vy; }
    lineColor=RED
    fillColor=RED
    x=0
    y=0
    sizeX=x
    sizeY=y
    visible=!release
    radius=size2/6
    loops=20