This is the web version of EJS interface
EJS version 4.3.7
  1. Title=Oscilloscope
  2. Author=Fu-Kwun Hwang - Dept. of Physics,National Taiwan normal Univ.
  3. Abstract=http://www.phy.ntnu.edu.tw/ntnujava/ hwang@phy.ntnu.edu.tw
  4. CaptureTools=true
  5. DataTools=false
  6. LanguageTools=true
  7. EmersionSupport=false
  8. AppletColSupport=false
  9. UseMacMenuBar=false
  10. UseInterpreter=true
    NameValueTypeDimension
    NameValueTypeDimension
    NameValueTypeDimension
    NameValueTypeDimension
    NameValueTypeDimension
    NameValueTypeDimension
    NameValueTypeDimension
    NameValueTypeDimension

    Init Page

    for(int i=0;i<n;i++){ xp[i]=xmin2+i*dx; yp[i]=ymin2+i*dy; } C1=1./cc; for(int i=0;i<n2;i++){ xp2[i]=xmin2+i*dx2; yp2[i]=ymin2+i*dy2; }

    Evol Page

    Indep. Var. Increment
    SolverRungeKutta AbsoluteTolerance=0.00001

    FixRel Page

    if(xtype.equals("C*t+D")){ xfun=dvalue(C1)+"*t + "+dvalue(D1); xfun2=xfun; tmin=D1; tmax=D1+n*dx/C1; }else{ xfun=dvalue(A1)+"*sin("+dvalue(w1)+"*t + "+dvalue(B1)+")"; xfun2="("+xfun+")/(cc*4.)+xmax2/2+D1"; tmin=0; tmax=20; } if(ytype.equals("C*t+D")){ yfun=dvalue(C2)+"*t + "+dvalue(D2); }else{ yfun=dvalue(A2)+"*sin("+dvalue(w2)+"*t + "+dvalue(B2)+") "; //yfun=dvalue(A2)+"*sin("+dvalue(w2)+"*t + "+dvalue(B2)+") "+dvalue(v0); } title="X(t) = "+xfun+", Y(t) = "+yfun; title2="X2(t) = "+xfun2+", Y2(t) = "+yfun2; s1=dvalue(cc)+""; s2=dvalue(vdiv)+""; s3=dvalue(D1)+""; s4=dvalue(v0)+""; // yfun2="("+yfun+")/vdiv+v0"; yfun2="("+yfun+")/vdiv*dy+v0";

    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,double,double,double,double
    title="Cathode Ray Oscilloscope CRO Model"
    layout=BORDER:0,0
    visible=true
    location="0,0"
    size="700,500"
    position=center
    layout=BORDER:0,0
    position=center
    autoscaleX=false
    autoscaleY=false
    minimumX=xmin
    maximumX=xmax
    minimumY=ymin
    maximumY=ymax
    square=true
    background=0,100,0,255
    points=npt
    min=tmin
    max=tmax
    variable="t"
    functionx=%xfun2%
    functiony=%yfun2%
    javaSyntax=false
    lineColor=GREEN
    lineWidth=stroke
    x=xmax2
    y=0
    sizeX=xmax
    sizeY=ymax-ymin
    visible=false
    style=RECTANGLE
    elementposition=WEST
    lineColor=null
    fillColor=LIGHTGRAY
    numberOfElements=n
    x=xp
    y=ymin2
    sizeX=0
    sizeY=ymax2-ymin2
    lineWidth=2
    numberOfElements=n
    x=xmin2
    y=yp
    sizeX=xmax2-xmin2
    sizeY=0
    lineWidth=2
    numberOfElements=n2
    x=xp2
    y=-dx2/2
    sizeX=0
    sizeY=dx2
    lineColor=BLUE
    numberOfElements=n2
    x=5*dx-dy2/2
    y=yp2
    sizeX=dy2
    sizeY=0
    lineColor=BLUE
    y=ymax
    pixelSize=true
    visible=false
    text=%title%
    font=Monospaced,BOLD,16
    elementposition=NORTH_WEST
    lineColor=BLUE
    position=east
    position=center
    layout=VBOX
    position=east
    layout=HBOX
    layout=VBOX
    layout=BORDER:0,0
    borderType=RAISED_BEVEL
    position=center
    layout=HBOX
    position=center
    variable=v0
    minimum=ymin2
    maximum=ymax2
    minimumAngle=-360*a2c
    maximumAngle=360*a2c
    size="100,100"
    tooltip="Offset in Y axis"
    position=south
    layout=HBOX
    position=north
    text=" Y offset = "
    alignment=CENTER
    tooltip="Offset in Y axis"
    position=south
    variable=v0
    format="00.00"
    tooltip="Offset in Y axis"
    layout=BORDER:0,0
    borderType=RAISED_BEVEL
    position=center
    layout=border
    position=center
    variable=vdiv
    minimum=0.1
    maximum=100
    minimumAngle=0
    maximumAngle=720*a2c
    size="100,100"
    tooltip=" Volt per Division"
    position=south
    layout=HBOX
    position=north
    text=" Volt/Div = "
    alignment=CENTER
    tooltip=" Volt per Division"
    variable=vdiv
    format="00.00"
    tooltip=" Volt per Division"
    layout=VBOX
    layout=BORDER:0,0
    borderType=RAISED_BEVEL
    position=center
    layout=border
    position=center
    variable=D1
    minimum=0
    maximum=dx*5*cc
    minimumAngle=0
    maximumAngle=720*a2c
    dragAction=//if(vtype.equals("X=")&&type.equals("C*t+D"))D=D1; if(vtype.equals("X="))D=D1;
    size="100,100"
    tooltip="Offset in X axis"
    position=south
    layout=HBOX
    position=north
    text=" X offset = "
    alignment=CENTER
    tooltip="Offset in X axis"
    variable=D1
    format="00.00"
    tooltip="Offset in X axis"
    layout=BORDER:0,0
    borderType=RAISED_BEVEL
    position=west
    layout=border
    position=center
    variable=cc
    minimum=0.05
    maximum=1.
    minimumAngle=-90*a2c
    maximumAngle=630*a2c
    dragAction=C1=1./cc; //if(vtype.equals("X=") && type.equals("C*t+D"))C=1./cc; if(vtype.equals("X="))C=1./cc;
    size="100,100"
    tooltip="time per division"
    position=south
    layout=HBOX
    position=north
    text=" Time/Div = "
    alignment=CENTER
    tooltip="time per division"
    variable=cc
    format="00.00"
    tooltip="time per division"
    position=south
    layout=VBOX
    position=north
    layout=HBOX
    variable=expertshow
    text="change inputs"
    position=north
    variable=%title%
    variable=%title2%
    visible=false
    layout=HBOX
    borderType=LOWERED_ETCHED
    image=/org/opensourcephysics/resources/controls/images/reset.gif
    action=_reset()
    layout=HBOX
    visible=expertshow
    layout=HBOX
    options="X=;Y="
    variable=%vtype%
    value="X="
    action=//if(vtype=="X=")xtype=type; //else ytype=type; if(vtype.equals("X="))type=xtype; else if(vtype.equals("Y="))type=ytype;
    options="A*sin(w*t+B);C*t+D"
    variable=%type%
    value="C*t+D"
    action=if(vtype.equals("X="))xtype=type; else if(vtype.equals("Y="))ytype=type;
    layout=HBOX
    position=center
    layout=HBOX
    layout=HBOX
    visible=type.equals("C*t+D")
    variable=C
    minimum=1.0
    maximum=cmax
    format="C=0.00"
    dragaction=if(xtype.equals("C*t+D"))C1=C; if(ytype.equals("C*t+D"))C2=C;
    variable=D
    minimum=0.0
    maximum=dx*5*cc
    format="D=0.00"
    dragaction=if(xtype.equals("C*t+D"))D1=D; if(ytype.equals("C*t+D"))D2=D;
    layout=HBOX
    visible=type.equals("A*sin(w*t+B)")
    variable=A
    minimum=0.0
    maximum=amax
    format="A=0.00"
    dragaction=if(xtype.equals("A*sin(w*t+B)"))A1=A; if(ytype.equals("A*sin(w*t+B)"))A2=A;
    variable=w
    minimum=0.1
    maximum=6.0
    format="w=0.00"
    ticks=60
    closest=true
    dragaction=if(vtype.equals("X=")&&xtype.equals("A*sin(w*t+B)"))w1=w; if(vtype.equals("Y=")&&ytype.equals("A*sin(w*t+B)"))w2=w;
    variable=B
    minimum=0.0
    maximum=bmax
    format="B=0.00"
    dragaction=if(xtype.equals("A*sin(w*t+B)"))B1=B*a2c; if(ytype.equals("A*sin(w*t+B)"))B2=B*a2c;
    variable=v0
    minimum=ymin2
    maximum=ymax2
    format="C=0.00"
    visible=false
    position=west
    layout=VBOX
    visible=false
    position=center
    variable=C1
    format="C1=0.00"
    position=north
    variable=cc
    format="cc=0.00"
    position=south
    variable=dx
    format="dx=0.00"
    variable=D1
    format="D1=0.00"
    variable=vdiv
    format="vdiv=0.00"
    variable=v0
    format="vo=0.00"
    position=west
    variable=dy
    format="dy=0.00"
    variable=A2
    format="A2=0.00"
    variable=dy
    format="dy=0.00"
    variable=dy
    format="dy=0.00"
    variable=dy
    format="dy=0.00"