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

    Init Page

    for(int i=0;i<n;i++){ y1[i]=-b+D*i; y3[i]=b-D*i; x2[i]=a-D*i; x4[i]=-a+D*i; } for(int i=0;i<4;i++){ x5s[i]=a+8*R-i*D; x6s[i]=a+i*D; } setparam ();

    Evol Page

    Indep. Var. Increment
    d cta /dt=omega
    d omega /dt=getAlpha(cta) -bf*omega
    d y1[i] /dt=vy1*sign
    d y3[i] /dt=vy3*sign
    d x2[i] /dt=vx2*sign
    d x4[i] /dt=vx4*sign
    d x5s[i] /dt=-v0*sign
    d x6s[i] /dt=v0*sign
    SolverMidPoint AbsoluteTolerance=0.001

    FixRel Page

    //if(_isPlaying()){ cs=Math.cos(cta); sc=Math.sin(cta); vb[1]=2*b*sc; vb[2]=2*b*cs; y2s=y2*sc; z2s=y2*cs; y4s=y4*sc; z4s=y4*cs; for(int i=0;i<n;i++){ if(y1[i]>-b+D*(i+1))y1[i]-=D; else if(y1[i]<-b+D*i)y1[i]+=D; if(y3[i]<b-D*(i+1))y3[i]+=D; else if(y3[i]>b-D*i)y3[i]-=D; if(x2[i]<a-D*(i+1))x2[i]+=D; else if(x2[i]>a-D*i)x2[i]-=D; if(x4[i]>-a+D*(i+1))x4[i]-=D; else if(x4[i]<-a+D*i)x4[i]+=D; y1s[i]=y1[i]*sc; z1s[i]=y1[i]*cs; y3s[i]=y3[i]*sc; z3s[i]=y3[i]*cs; if((y1[i]-R)*(y1[i]+R)<0)s1[i]=false; else s1[i]=true; } for(int i=0;i<4;i++){ if(x5s[i]<a+8*R-(i+1)*D)x5s[i]+=D; else if(x5s[i]>a+8*R-i*D)x5s[i]-=D; if(x6s[i]>a+(i+1)*D)x6s[i]-=D; else if(x6s[i]<a+i*D)x6s[i]+=D; } //}
    public void setparam () { a2=I*L*B;//*b/Inertia; v0=4*size*I; vy1=vx4=v0; vx2=-v0; vy3=-v0; BZ0=-(zmin+(B+2)*range/4); }
    public double getAlpha (double cta) { if(Math.cos(cta)>0)sign=1; else sign=-1; sign2=sign; if(!Is)sign=-sign; return a2*Math.abs(Math.cos(cta)); }
    EJSVIEW: Click link to view it's content
    Control variables:(testing)
    double,double,double
    title="Frame"
    layout=border
    visible=true
    location="25,39"
    size="636,638"
    position=center
    minimumX=xmin
    maximumX=xmax
    minimumY=ymin
    maximumY=ymax
    minimumZ=zmin
    maximumZ=zmax
    cameraAzimuth=-0.6999999999999982
    cameraAltitude=0.36031596330733323
    cameraFocusX=0.0
    cameraFocusY=0.0
    cameraFocusZ=0.0
    cameraRotation=0.0
    cameraDistanceToScreen=5.0
    firstDirection=va
    secondDirection=vb
    lineColor=GRAY
    fillColor=null
    lineWidth=stroke
    numberOfElements=n
    x=x1s
    y=y1s
    z=z1s
    sizeX=size
    sizeY=size
    sizeZ=size
    visible=s1
    lineColor=clr
    fillColor=clr2
    numberOfElements=n
    x=x2
    y=y2s
    z=z2s
    sizeX=size
    sizeY=size
    sizeZ=size
    lineColor=clr
    fillColor=clr2
    numberOfElements=n
    x=x3s
    y=y3s
    z=z3s
    sizeX=size
    sizeY=size
    sizeZ=size
    lineColor=clr
    fillColor=clr2
    numberOfElements=n
    x=x4
    y=y4s
    z=z4s
    sizeX=size
    sizeY=size
    sizeZ=size
    lineColor=clr
    fillColor=clr2
    numberOfElements=4
    x=x5s
    y=R*sc
    z=R*cs
    sizeX=size
    sizeY=size
    sizeZ=size
    lineColor=clr
    fillColor=clr2
    numberOfElements=4
    x=x6s
    y=-R*sc
    z=-R*cs
    sizeX=size
    sizeY=size
    sizeZ=size
    lineColor=clr
    fillColor=clr2
    numberOfElements=n
    x=x2
    y=y2s
    z=z2s
    sizeX=0
    sizeY=a2*sign2
    sizeZ=0
    visible=showF
    lineColor=DARKGRAY
    fillColor=DARKGRAY
    numberOfElements=n
    x=x4
    y=y4s
    z=z4s
    sizeX=0
    sizeY=-a2*sign2
    sizeZ=0
    visible=showF
    lineColor=DARKGRAY
    fillColor=DARKGRAY
    numberOfElements=4
    x=x6s
    y=-R*sc
    z=-R*cs
    sizeX=0
    sizeY=-a2*sign2
    sizeZ=0
    visible=showF
    lineColor=DARKGRAY
    fillColor=DARKGRAY
    numberOfElements=4
    x=x5s
    y=R*sc
    z=R*cs
    sizeX=0
    sizeY=a2*sign2
    sizeZ=0
    visible=showF
    lineColor=DARKGRAY
    fillColor=DARKGRAY
    numberOfElements=n
    x=x1
    y=y1s
    z=z1s
    sizeX=0
    sizeY=vy1*sign*sc
    sizeZ=vy1*sign*cs
    visible=showV
    lineColor=RED
    fillColor=RED
    numberOfElements=n
    x=x2
    y=y2s
    z=z2s
    sizeX=vx2*sign
    sizeY=0
    sizeZ=0
    visible=showV
    lineColor=RED
    fillColor=RED
    numberOfElements=n
    x=x3
    y=y3s
    z=z3s
    sizeX=0
    sizeY=vy3*sign*sc
    sizeZ=vy3*sign*cs
    visible=showV
    lineColor=RED
    fillColor=RED
    numberOfElements=n
    x=x4
    y=y4s
    z=z4s
    sizeX=vx4*sign
    sizeY=0
    sizeZ=0
    visible=showV
    lineColor=RED
    fillColor=RED
    points=17
    min=cta1
    max=cta2
    variable="c"
    functionx="a+8*R"
    functiony="R*sin(c)"
    functionz="R*cos(c)"
    lineColor=RED
    lineWidth=stroke*1.2
    points=17
    min=cta1
    max=cta2
    variable="c"
    functionx="a+8*R"
    functiony="R*sin(c)"
    functionz="-R*cos(c)"
    lineColor=BLACK
    lineWidth=stroke*1.2
    x=a
    y=R*sc
    z=R*cs
    sizeX=8.5*R
    sizeY=0
    sizeZ=0
    lineColor=GRAY
    lineWidth=stroke
    x=a
    y=-R*sc
    z=-R*cs
    sizeX=8.5*R
    sizeY=0
    sizeZ=0
    lineColor=GRAY
    lineWidth=stroke
    minimumX=xmin
    maximumX=xmax
    minimumY=ymin
    maximumY=ymax
    minimumZ=BZ0
    maximumZ=0
    xcomponent=bfx
    ycomponent=bfy
    zcomponent=bfz
    length=xmax*B
    visible=showBF
    mincolor=0,255,255,128
    z=zmax*1.2
    text=%l_current%
    lineWidth=stroke
    position=south
    layout=GRID:0,1,0,0
    position=south
    layout=HBOX
    borderType=LOWERED_ETCHED
    variable=Is
    text=%l_current%
    action=if(Is){ sign=1.; clr=blue; clr2=clr; clabel="+"; l_current="Current flow"; }else{ sign=-1.; clr=green; clr2=green2; clabel="-"; l_current="Elecron flow"; }
    size="100,0"
    text="Show"
    variable=showV
    text="V"
    size="30,0"
    variable=showF
    text="Force"
    size="50,0"
    variable=showBF
    text="Bfield"
    variable=bf
    minimum=0.0
    maximum=1.0
    format="friction force=-0.0*omega"
    position=east
    layout=HBOX
    image=/org/opensourcephysics/resources/controls/images/reset.gif
    action=_reset()
    variable=_isPaused
    imageOn=/org/opensourcephysics/resources/controls/images/play.gif
    actionOn=_play()
    imageOff=/org/opensourcephysics/resources/controls/images/pause.gif
    actionOff=_pause()
    layout=border
    position=center
    layout=GRID:1,0,0,0
    variable=omega
    minimum=0.0
    maximum=pi
    format="omega=0.00"
    position=east
    variable=B
    value=0.8572000000000002
    minimum=-2.0
    maximum=2.0
    format="Bz=0.00"
    dragaction=setparam ()
    variable=I
    minimum=0.0
    maximum=2.0
    format="I=0.00"
    dragaction=setparam ()