This is the web version of EJS interface
EJS version 4.2.7
  1. CaptureTools=true
  2. DataTools=true
  3. LanguageTools=true
  4. EmersionSupport=false
  5. UseInterpreter=true
    NameValueTypeDimension
    NameValueTypeDimension

    Init Page

    scrambler(); backColor = new java.awt.Color(redness,greenness,blueness); backgroundColor = backColor;

    Cons Page

    // Force on wire 1 rSquared=(x1-x2)*(x1-x2)+(y1-y2)*(y1-y2); F12x=-mu*(I1*I2)*(x1-x2)/(rSquared); F12y=-mu*(I1*I2)*(y1-y2)/(rSquared); rSquared=(x1-x3)*(x1-x3)+(y1-y3)*(y1-y3); F13x=-mu*(I1*I3)*(x1-x3)/(rSquared); F13y=-mu*(I1*I3)*(y1-y3)/(rSquared); F1x = F12x + F13x; F1y = F12y + F13y; // Force on wire 2 F21x = -F12x; F21y = -F12y; rSquared=(x2-x3)*(x2-x3)+(y2-y3)*(y2-y3); F23x=-mu*(I2*I3)*(x2-x3)/(rSquared); F23y=-mu*(I2*I3)*(y2-y3)/(rSquared); F2x = F21x + F23x; F2y = F21y + F23y; // Force on wire 3 F31x = -F13x; F31y = -F13y; F32x = -F23x; F32y = -F23y; F3x = F31x + F32x; F3y = F31y + F32y; // Setting the colors (red for +, blue for -) if (I1 > 0.0) { redness = 250; greenness = 0; blueness = 0; colorball1 = new java.awt.Color(redness,greenness,blueness); } else { if (I1 < 0.0) { redness = 100; greenness = 100; blueness = 250; colorball1 = new java.awt.Color(redness,greenness,blueness); } else { redness = 200; greenness = 200; blueness = 200; colorball1 = new java.awt.Color(redness,greenness,blueness); } } if (I2 > 0.0) { redness = 250; greenness = 0; blueness = 0; colorball2 = new java.awt.Color(redness,greenness,blueness); } else { if (I2 < 0.0) { redness = 100; greenness = 100; blueness = 250; colorball2 = new java.awt.Color(redness,greenness,blueness); } else { redness = 200; greenness = 200; blueness = 200; colorball2 = new java.awt.Color(redness,greenness,blueness); } } if (I3 > 0.0) { redness = 250; greenness = 0; blueness = 0; colorball3 = new java.awt.Color(redness,greenness,blueness); } else { if (I3 < 0.0) { redness = 100; greenness = 100; blueness = 250; colorball3 = new java.awt.Color(redness,greenness,blueness); } else { redness = 200; greenness = 200; blueness = 200; colorball3 = new java.awt.Color(redness,greenness,blueness); } }

    scramble

    public void scrambler () { scramble = Math.round(0.501+5.998*Math.random()); if ((scramble > 0.99) && (scramble < 1.01)) { I1 = 300.0; I2 = 200.0; I3 = 100.0; } if (scramble == 2) { I1 = 300.0; I2 = 100.0; I3 = 200.0; } if (scramble == 3) { I1 = 200.0; I2 = 300.0; I3 = 100.0; } if (scramble == 4) { I1 = 100.0; I2 = 300.0; I3 = 200.0; } if (scramble == 5) { I1 = 200.0; I2 = 100.0; I3 = 300.0; } if (scramble == 6) { I1 = 100.0; I2 = 200.0; I3 = 300.0; } randnum = Math.random(); if (randnum < 0.5) { I1 = -1.0*I1; } randnum = Math.random(); if (randnum < 0.5) { I2 = -1.0*I2; } randnum = Math.random(); if (randnum < 0.5) { I3 = -1.0*I3; } }
    EJSVIEW: Click link to view it's content
    Control variables:(testing)
    title=Magnetic Force: Three Wires
    layout=border
    visible=true
    location="152,40"
    size="763,592"
    position=east
    layout=border
    background=BLACK
    position=north
    layout=grid:0,1,0,0
    size="240,440"
    background=BLACK
    variable=movableflag
    selected=true
    text=Wires are draggable
    actionoff=x1 = -2.0; y1 = -2.0; x2 = 2.0; y2 = -2.0; x3 = 0.0; y3 = 1.4641;
    background=128,128,0
    foreground=255,192,0
    variable=showlinesflag
    selected=true
    text=Show helpful lines
    background=128,64,0
    foreground=128,192,0
    value=Red means out of the screen.
    editable=false
    background=128,128,0
    foreground=255,192,0
    font=Dialog,BOLD,16
    value=Blue means into the screen.
    editable=false
    background=128,64,0
    foreground=128,192,0
    font=Dialog,BOLD,16
    text=Get new currents
    action=backgroundColor = backColor; feedback = "Look for feedback here"; scrambler();
    background=BLACK
    foreground=128,0,128
    font=Dialog,BOLD,16
    text=Check Answer
    action=if (Math.abs(scramble-answerchoice) < 0.1) { backgroundColor = java.awt.Color.GREEN; feedback = "Correct!"; } else { backgroundColor = java.awt.Color.RED; feedback = "Sorry - please try again."; }
    background=BLACK
    foreground=128,0,128
    font=Dialog,BOLD,16
    text=Reset Simulation
    action=_reset()
    background=BLACK
    foreground=128,0,128
    font=Dialog,BOLD,16
    text=%helpLabel%
    action=if (helpFlag) { helpFlag = false; helpLabel = "Show Help"; } else { helpFlag = true; helpLabel = "Hide Help"; }
    background=BLACK
    foreground=128,192,0
    font=Dialog,BOLD,16
    position=center
    autoscaleX=false
    autoscaleY=false
    minimumX=-5.0
    maximumX=5.0
    minimumY=-5.0
    maximumY=5.0
    square=true
    title=Magnetic Force: Three Wires
    titleX=x-position (m)
    majorTicksX=true
    titleY=y-position (m)
    majorTicksY=true
    interiorBackground=GRAY
    background=BLACK
    foreground=192,192,0
    x=-3.0
    y=-2.0
    sizex=6.0
    sizey=0.0
    visible=showlinesflag
    enabled=false
    style=SEGMENT
    color=255,128,0
    secondaryColor=255,128,0
    stroke=2
    x=0.5
    y=2.33
    sizex=-3.0
    sizey=-5.196152
    visible=showlinesflag
    enabled=false
    style=SEGMENT
    color=255,128,0
    secondaryColor=255,128,0
    stroke=2
    x=-0.5
    y=2.33
    sizex=3.0
    sizey=-5.196152
    visible=showlinesflag
    enabled=false
    style=SEGMENT
    color=255,128,0
    secondaryColor=255,128,0
    stroke=2
    x=0.0
    y=centery
    sizex=0.0
    sizey=2.3094
    scalex=1.5
    scaley=1.5
    visible=showlinesflag
    enabled=false
    style=SEGMENT
    color=255,128,0
    secondaryColor=255,128,0
    stroke=2
    x=0.0
    y=centery
    sizex=2.0
    sizey=-1.1547
    scalex=1.5
    scaley=1.5
    visible=showlinesflag
    enabled=false
    style=SEGMENT
    color=255,128,0
    secondaryColor=255,128,0
    stroke=2
    x=0.0
    y=centery
    sizex=-2.0
    sizey=-1.1547
    scalex=1.5
    scaley=1.5
    visible=showlinesflag
    enabled=false
    style=SEGMENT
    color=255,128,0
    secondaryColor=255,128,0
    stroke=2
    x=x1
    y=y1
    sizex=0.5
    sizey=0.5
    enabled=movableflag
    secondaryColor=128,128,0
    color=128,128,0
    x=x2
    y=y2
    sizex=0.5
    sizey=0.5
    enabled=movableflag
    secondaryColor=128,128,0
    color=128,128,0
    x=x3
    y=y3
    sizex=0.5
    sizey=0.5
    enabled=movableflag
    secondaryColor=128,128,0
    color=128,128,0
    x=x1
    y=y1
    sizex=F1x
    sizey=F1y
    scalex=120.0
    scaley=120.0
    enabledSecondary=false
    enabled=false
    style=ARROW
    color=128,0,192
    secondaryColor=128,0,192
    stroke=2
    x=x2
    y=y2
    sizex=F2x
    sizey=F2y
    scalex=120.0
    scaley=120.0
    enabledSecondary=false
    enabled=false
    style=ARROW
    color=192,64,0
    secondaryColor=192,64,0
    stroke=2
    x=x3
    y=y3
    sizex=F3x
    sizey=F3y
    scalex=120.0
    scaley=120.0
    enabledSecondary=false
    enabled=false
    style=ARROW
    color=64,192,0
    secondaryColor=64,192,0
    stroke=2
    x=x1
    y=y1
    enabled=false
    text=1
    color=128,255,0
    x=x2
    y=y2
    enabled=false
    text=2
    color=128,255,0
    x=x3
    y=y3
    enabled=false
    text=3
    color=128,255,0
    position=south
    layout=grid:4,2,3,3
    size=300,120
    border=50
    borderType=MATTE
    borderColor=CYAN
    background=BLACK
    foreground=128,192,0
    value=Rank the magnitudes of the currents
    editable=false
    size=200,40
    background=192,128,0
    foreground=128,0,128
    font=Dialog,BOLD,18
    variable=feedback
    editable=false
    background=192,128,0
    foreground=128,0,128
    font=Dialog,BOLD,18
    selected=true
    text=|I1| > |I2| > |I3|
    actionon=answerchoice = 1
    foreground=128,192,0
    font=Times New Roman,BOLD,20
    variable=true
    text=|I1| > |I3| > |I2|
    actionon=answerchoice = 2;
    foreground=128,192,0
    font=Times New Roman,BOLD,20
    variable=true
    text=|I2| > |I1| > |I3|
    actionon=answerchoice = 3;
    foreground=128,192,0
    font=Times New Roman,BOLD,20
    variable=true
    text=|I2| > |I3| > |I1|
    actionon=answerchoice = 4;
    font=Times New Roman,BOLD,20
    variable=true
    text=|I3| > |I1| > |I2|
    actionon=answerchoice = 5;
    foreground=128,192,0
    font=Times New Roman,BOLD,20
    variable=false
    text=|I3| > |I2| > |I1|
    actionon=answerchoice = 6;
    font=Times New Roman,BOLD,20
    layout=grid:0,1,0,0
    visible=helpFlag
    onClosing=helpFlag = false; helpLabel = "Show Help";
    location="167,12"
    size="700,268"
    background=BLACK
    foreground=128,192,0
    value=At first, you can click-and-drag the wires around the screen.
    editable=false
    font=Dialog,BOLD,16
    value=Red indicates a current out of the screen, while blue indicates a current into the screen.
    editable=false
    font=Dialog,BOLD,16
    value=Each wire has an arrow representing the net force acting on it.
    editable=false
    font=Dialog,BOLD,16
    value=We assume that the only forces come from magnetic interactions between the wires.
    editable=false
    font=Dialog,BOLD,16
    value=Drag the wires around until you determine how the magnitudes of the currents compare.
    editable=false
    font=Dialog,BOLD,16
    value="Choose your ranking from the list at the bottom, and press the Check Answer button."
    editable=false
    font=Dialog,BOLD,16
    value=If you are wrong, keep trying until you come up with a good system for ranking the currents.
    editable=false
    font=Dialog,BOLD,16
    value="At any time, use the Get new currents button to generate a new set of currents."
    editable=false
    font=Dialog,BOLD,16
    value="As an extra challenge, un-check the Wires are draggable button."
    editable=false
    font=Dialog,BOLD,16
    value=See if you can rank the current magnitudes without moving them.
    editable=false
    font=Dialog,BOLD,16
    value="Check the Show helpful lines checkbox to help you with this challenge."
    editable=false
    font=Dialog,BOLD,16