This is the web version of EJS interface
EJS version 4.3.0
  1. CaptureTools=false
  2. DataTools=false
  3. LanguageTools=false
  4. EmersionSupport=false
  5. UseInterpreter=true
  6. AuxiliaryFiles=_data/reset.gif;_data/init.gif;_data/pause.gif;_data/play.gif;
  7. DetectedFiles=_data/init.gif;_data/pause.gif;_data/play.gif;_data/reset.gif;
    NameValueTypeDimension
    NameValueTypeDimension
    NameValueTypeDimension

    Init Page

    for(int i=0;i<n;i++){ x[i]=xmin-i*wavelength; } for(int i=0;i<n;i++){ d[i]=0; v[i]=0; } vx=wavelength/T; loop=loop2=false;

    Evol Page

    Indep. Var. Increment
    d x[i] /dt=vx
    d d[i] /dt=v[i]
    SolverEuler AbsoluteTolerance=0.001

    FixRel Page

    for(int i=0;i<n;i++){ if(loop){ if(x[i]>x1-i*wavelength)x[i]-=wavelength; }else if(x[0]>x1){ loop=true; v[0]=2*vx; x[0]-=wavelength; } } for(int i=0;i<n2;i++){ if(v[i]>0){ if(d[i]>(n2-i)*wavelength*2)d[i]-=2*wavelength; } if(d[i]>wavelength*2){ if(i<n2-1)v[i+1]=2*vx; else loop2=true; } }

    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)
    double,double
    title="Double slit interference"
    layout=border
    visible=true
    location="2,143"
    size="762,342"
    position=center
    layout=GRID:1,0,0,0
    position=center
    autoscaleX=false
    autoscaleY=false
    minimumX=xmin
    maximumX=xmax
    minimumY=ymin
    maximumY=ymax
    square=true
    background=200,220,208
    numberOfElements=n2
    x=x1
    y=y1
    sizeX=d
    sizeY=d
    lineColor=255,128,0
    fillColor=null
    numberOfElements=n2
    x=x1
    y=y2
    sizeX=d
    sizeY=d
    lineColor=255,128,0
    fillColor=null
    x=x1-size/10
    y=0
    sizeX=(x1-xmin)*2
    sizeY=(ymax-ymin)*1.2
    style=RECTANGLE
    elementposition=EAST
    lineColor=null
    fillColor=GRAY
    x=x1
    y=ymax
    sizeX=0
    sizeY=(y1+size2)-ymax
    lineColor=CYAN
    lineWidth=stroke
    x=x1
    y=y1-size2
    sizeX=0
    sizeY=y2-y1+size
    lineColor=CYAN
    lineWidth=stroke
    x=x1
    y=y2-size2
    sizeX=0
    sizeY=ymin-y2+size2
    lineColor=CYAN
    lineWidth=stroke
    numberOfElements=n
    x=x
    y=ymax
    sizeX=0
    sizeY=ymin-ymax
    lineColor=128,0,255
    position=south
    layout=border
    position=east
    layout=FLOW:center,0,0
    borderType=LOWERED_ETCHED
    background=DARKGRAY
    image="_data/reset.gif"
    action=_reset()
    size="90,35"
    image="_data/init.gif"
    enabled=_isPaused()
    action=_initialize()
    size="90,35"
    variable=_isPaused
    size="90,35"
    imageOn="_data/play.gif"
    actionOn=_play()
    imageOff="_data/pause.gif"
    actionOff=_pause()
    position=center
    layout=HBOX
    background=DARKGRAY
    variable=wavelength
    minimum=0.1
    maximum=0.30
    format="wavelength=0.00 m"
    ticks=21
    enabled=_isPaused()
    action=_initialize()
    foreground=192,255,0
    variable=T
    minimum=0.5
    maximum=2.0
    format="period=0.0s"
    ticks=10
    enabled=_isPaused()
    action=_initialize()
    foreground=192,255,0
    variable=vx
    minimum=0.0
    maximum=1.0
    format="wave speed=0.0 m/s"
    background=BLACK
    foreground=192,128,0