@physletName|EField
@code|eField4.EField.class
@archive|EField4_.jar,STools4.jar
@appletSize|250|250
@embedParam|b|ShowControls|false|show controls:
@embedParam|i|FPS|10|animation frames per second:
@embedParam|d|Dt|0.02|time step per frame:
@embedParam|b|PointChargeMode|true| point charge force law:
@embedParam|b|ShowContours|true|show potential contours:
@embedParam|b|ShowFieldVectors|true|show vector field:
@embedParam|b|ShowFieldLines|false|show vector lines:
@embedParam|b|ShowLabels|false|show contour labels:
@embedParam|b|ShowCharge|true|show charges as circles:
@embedParam|s|Potential|0|the potential:
@embedParam|s|Range|-5,5,-5,5|the x and y scale:
@embedParam|i|GridSize|64|the grid size used to calcualate the contours:
addObject|id
#FF707D
>>> tt >>>
A static charge
at position x,y with charge q and mass m, display radius r (pixels)
>>> tt >>>
Add charge
s|name|charge|HIDDEN
$
.|d|x|0|x:
.|d|y|0|y:
.|d|q|1.0|q:
.|d|m|1.0|m:
.|i|r|10|r:
addObject|id
#FF707D
>>> tt >>>
A dynamic test charge
at position x,y with initial velocity vx, vy, charge q and mass m, display radius r (pixels)
It will move according to fields from static charges and potentials without influencing these external fields.
Motion takes place after "forward()" (see below) is invoked.
>>> tt >>>
Add test charge
s|name|testcharge|HIDDEN
$
.|d|x|1|x:
.|d|y|2|y:
.|d|vx||vx:
.|d|vy||vy:
.|d|q|1.0|q:
.|d|m|1.0|m:
.|i|r|5|r:
forward|
#E9D3FF
>>> tt >>>
Start the animation clock.
This is necessary before any object will move.
For other correspondent methods (pause, step forward...) see below
>>> tt >>>
forward
deleteObject|
#FF707D
>>> tt >>>
This deletes a single object from the running applet, after it has appeared for a while.
To remove an object totally, simply delete the correspondent line from the script below and press "Update".
>>> tt >>>
Delete
o|id||<- Please read information (i) first! Delete this object at run-time:
setBz|
#FF707D
>>> tt >>>
An external magnetic field perpendicular to the visible plain.
External fields affect the motion of test charges.
>>> tt >>>
Set Bz
d|bz|10|external field Bz:
setPotential|
#FF707D
>>> tt >>>
Change the external electric potential and scale from what was set with the embedding parameters. External fields affect the motion of test charges.
>>> tt >>>
Set potential
s|ps||ps:
d|xmin|-5.0|xmin:
d|xmax|5.0|xmax:
d|ymin|-5.0|ymin:
d|ymax|5.0|ymax:
setShowContours|
#FFDA92
>>> tt >>>
Show (default) or hide the contour lines.
For other methods of display options see below (scroll down).
>>> tt >>>
Show potential
b|sc|true|Show equipotential (contour) lines:
setShowFieldLines|
#FFDA92
>>> tt >>>
Show field lines.
Caution, may fail for external potentials with non-zero divergence!
- See field vectors.
- See below "Field line click" which displays one single field line per mouse click.
>>> tt >>>
Show field lines
b|sfl|true|Show field lines:
setShowFieldVectors|
#FFDA92
>>> tt >>>
Draw field vectors. The color of the arrows indicates the strength of the field.
For other methods of display options see below.
>>> tt >>>
Show field vectors
b|sfv|false|Show field vectors:
setShowFVector|
#FFDA92
>>> tt >>>
Show the force vector on a test charge.
For other methods of display options see below.
>>> tt >>>
F vector
o|id||This test charge:
b|sf|true|displays its force vector:
setShowVVector|
#FFDA92
>>> tt >>>
Show the velocity vector of a test charge.
For other methods of display options see below.
>>> tt >>>
v vector
o|id||This test charge:
b|sv|false|displays its velocity vector:
setDragable|
#FFFF99
>>> tt >>>
Make an object dragable with the mouse.
Dragable test charges will not move according to the field any longer.
Instead, the force acting on them can be displayed while dragging (see below)
>>> tt >>>
Make dragable
o|id||This object:
b|drag|true|can be dragged with the mouse:
setDampOnMousePressed|
#FFFF99
>>> tt >>>
Set the velocity of all test charges to zero when the mouse is pressed.
See below for setting a constant damping coefficent.
>>> tt >>>
Damp motion
b|damp|true|Damp motion on mouse pressed:
setTrajectory|
#FFFF99
>>> tt >>>
Force an object to move along an analytic trajectory, x(t) and y(t).
>>> tt >>>
setTrajectory
o|id||This object:
s|xStr||x(t):
s|yStr||y(t):
setAnimationSlave|
#FFFF99
>>> tt >>>
Combine a master object and a slave object so that the slave follows the master.
Slave could be a text - often in combination with a "display offset" for the text (see below)
>>> tt >>>
Animation Slave
o|masterID||master object:
o|slaveID||following object:
setSticky|
#FFFF99
>>> tt >>>
Make an object sticky. A collision between two sticky objects will stop a calculation.
>>> tt >>>
Make sticky
o|id||This object:
b|isSticky|true|will stop the animation when colliding with other sticky objects:
addObject|id
#CCFFCC
>>> tt >>>
Graphics shapes without physical interaction.
You can use their ID to change their color with an appropriate command (see list).
>>> tt >>>
Add shape
s|name|rectangle;box;circle;shell|name:
$
.|d|x|-1.0|x:
.|d|y|-1.0|y:
.|i|w|10|width:
.|i|h|10|height:
.|i|r||radius:
addObject|id
#CCFFCC
>>> tt >>>
An arrow starting from point (x,y).
The horizontal and vertical length (h,v) can be a function of t, x, y, vx, vy, ax, and ay.
The starting point can follow another object (see animation slave)
(See line.)
>>> tt >>>
Add arrow
s|name|arrow|HIDDEN
$
.|d|x|0|x:
.|d|y|0|y:
.|s|h|1|horizontal size h:
.|s|v|1|vertical:
addObject|id
#CCFFCC
>>> tt >>>
A line segment starting from point (x,y).
The horizontal and vertical length (h,v) can be a function of t, x, y, vx, vy, ax, and ay.
The starting point can follow another object (see animation slave)
(See arrow.)
>>> tt >>>
Add line
s|name|line|HIDDEN
$
.|d|x|0.3|x:
.|d|y|0.3|y:
.|s|h|1|horizontal size h:
.|s|v|1|vertical:
addObject|id
#CCFFCC
>>> tt >>>
a straight line segment or a spring connecting two objects.
This object is "cosmetics". No additional physical interactions are created.
>>> tt >>>
Add line connecting
s|name|connectorline;connectorspring|name:
$
.|o|id1|0.3|first object:
.|o|id2|0.3|second object:
addObject|id
#CCFFCC
>>> tt >>>
A cross-hair cursor for making measurements.
>>> tt >>>
Add cursor
s|name|cursor|HIDDEN
$
.|d|x|0.3|x:
.|d|y|0.3|y:
.|i|r|5|r:
addObject|id
#CCFFCC
>>> tt >>>
Display an image file at position x,y.
>>> tt >>>
Add image
s|name|image|HIDDEN
$
.|d|x|3.0|At position x:
.|d|y|0.5|y:
.|s|file|smile.gif|display image file (.gif or .jpg):
addObject|id
#CCFFCC
>>> tt >>>
Text followed by a calculated value. The calculation is expressed as a function string, f(t,x,y,vx,vy,ax,ay,m,p,f).
(See page 88 of the Physlets book.)
>>> tt >>>
Add text
s|name|text|HIDDEN
$
.|d|x|0.3|x:
.|d|y|0.3|y:
.|s|text||text:
.|s|calc||calculation:
setSketchMode|id
#CCFFCC
>>> tt >>>
Set sketch mode. A mouse drag will now draw a curve.
>>> tt >>>
Sketch mode
b|sketch|true|Allow drawing with the mouse pointer:
setVisibility|
#B3EFFF
>>> tt >>>
Makes an object visible or invisible. The object is not destroyed; it is hidden and can be made visible at any time.
>>> tt >>>
Show/Hide
o|id||This object:
b|show|false|is visible:
setDisplayOffset|
#B3EFFF
>>> tt >>>
Offset the drawing position from the x,y location of the object. This can also be a text as animation slave of a moving object
>>> tt >>>
Display offset
o|id||This object:
i|xOff|5|is displayed shifted by dx:
i|yOff|5|(pixels) dy:
setRGB|
#B3EFFF
>>> tt >>>
Set the color of an object using a mixture of red (r), green (g), and blue (b). Primary colors are in the range 0...255.
>>> tt >>>
object color
o|id||This object:
i|r|3|r:
i|g|3|g:
i|b|3|b:
setTrail|
#B3EFFF
>>> tt >>>
Draw a trail of points as an object moves. (See also set foot prints and set ghosts.)
>>> tt >>>
Trail
o|id||This moving object:
i|pts|300|leaves a trail behind with length:
setFootPrints|
#B3EFFF
>>> tt >>>
Draw a mark on the screen every n trail markings as the test charge moves.
(A trail must be set first, see above.)
>>> tt >>>
Foot prints
o|id||This moving object:
i|n|20|leaves footprints, every n trail markings:
setGhost|
#B3EFFF
>>> tt >>>
Draw a pale copy on the screen at every footprint.
(A trail and foot prints must be set first, see above.)
>>> tt >>>
Ghost
o|id||This moving object:
b|ghost|true|leaves pale ghost images as footprints:
setChargeTrail|
#B3EFFF
>>> tt >>>
Draw a trail of points as an charge moves. (See also set foot prints and set ghosts.)
>>> tt >>>
Charge trail
i|t|300|leaves a trail behind with length:
setShowFOnDrag|
#FFDA92
>>> tt >>>
Show the magnitude of the force on a test charge that is dragged with the mouse in the yellow message box.
This test charge must be made dragable first (see above)
>>> tt >>>
Display F on drag
o|id||The force on this test charge:
b|sfm|true|will be displayed on mouse drag:
setShowEOnDrag|
#FFDA92
>>> tt >>>
Show or hide the electric field magnitude on mouse drag.
>>> tt >>>
Display E on drag
b|se|true|Display local field magnitude E on mouse drag:
setShowVOnDrag|
#FFDA92
>>> tt >>>
Show the potential in the yellow message box on a mouse drag.
>>> tt >>>
Display Pot. on drag
b|sv|true|Display potential on mouse-drag:
setShowFieldLineOnClick|
#FFDA92
>>> tt >>>
Draw an electric field line on a mouse click.
>>> tt >>>
Field line click
b|sfl|true|Draw a field line on every mouse click:
setShowEquipotentialOnDoubleClick|
#FFDA92
>>> tt >>>
Draw an equipotential line on a mouse double click.
>>> tt >>>
Contour dblClick
b|sp|true|Draw a equipotential line on every mouse double click::
setShowLabels|
#FFDA92
>>> tt >>>
Display numerical values at equipotential lines.
>>> tt >>>
Contour labels
b|sl|true|Show equipotential lines:
setShowTime|
#FFDA92
>>> tt >>>
Show the animation time
>>> tt >>>
Display time
b|st|false|Display animation time:
pause|
#E9D3FF
>>> tt >>>
Pause the animation clock.
>>> tt >>>
Pause
reset|
#E9D3FF
>>> tt >>>
Reset the animation clock to time=0.
>>> tt >>>
Reset time
reverse|
#E9D3FF
>>> tt >>>
Run the animation backward.
>>> tt >>>
Reverse time
stepBack|
#E9D3FF
>>> tt >>>
Set the animation back by dt.
>>> tt >>>
Step back
stepForward|
#E9D3FF
>>> tt >>>
Set the animation forward by dt.
>>> tt >>>
Step forward
setMaxTime|
#E9D3FF
>>> tt >>>
Set the maximum time that the animation will run.
>>> tt >>>
Max time
d|max|0.3|Stop animation at t:
s|msg||and display message:
setTimeCycle|
#E9D3FF
>>> tt >>>
Cycle the animation time.
>>> tt >>>
Time cycle
d|max|10|Restart from t=0 after t:
setConstrainR|
#FFFF99
>>> tt >>>
Constrain an object to motion along a circle or radius r.
>>> tt >>>
Circle constraint
o|id||Constrain this object:
d|r|0.3|on circle with radius r:
d|x|0.3|centered at x:
d|y|0.3|and y:
setConstraintStr|
#FFFF99
>>> tt >>>
Constrain the motion along a function path, f(x).
>>> tt >>>
Function constraint
o|id||Constrain this object:
s|str||on f(x):
d|xmin|-5.0|from xmin:
d|xmax|5.0|to xmax:
setConstrainX|
#FFFF99
>>> tt >>>
Constrain an object to motion with constant x or within a range from xmin and/or to xmax
>>> tt >>>
x constraint
o|id||Constrain motion of this object:
d|x||to constant x:
d|xmin||or from to xmin:
d|xmax||to xmax:
setConstrainY|
#FFFF99
>>> tt >>>
Constrain an object to motion with constant y or within a range from ymin and/or to ymax
>>> tt >>>
y constraint
o|id||Constrain motion of this object:
d|y||to constant y:
d|ymin||or from ymin:
d|ymax||to ymax:
setShowConstraintPath|
#FFFF99
>>> tt >>>
Show the constraining path.
>>> tt >>>
Show constraint
o|id||This constraint:
b|sc|true|will be displayed with a line:
setChargeMagnitude|
#FF707D
>>> tt >>>
Change the charge on a charge object. Does not apply to geometric shapes or images.
>>> tt >>>
Set charge
o|id||Set charge of this object:
d|mag|2|to q:
setMass|
#FF707D
>>> tt >>>
Set the inertial mass of a test charge.
>>> tt >>>
Set mass
o|id||Set mass of this object:
d|m|0.3|to m:
setDamping|
#FF707D
>>> tt >>>
Damp the motion of test charges.
>>> tt >>>
Set damping
o|id||Set damping coefficient (="friction") for this test charge:
d|d|0.3|to d:
setXY|
#FF707D
>>> tt >>>
Set the location of an object.
>>> tt >>>
Set x and y
o|id||This object:
d|x|0.3|x:
d|y|0.3|y:
setSpeed|
#FF707D
>>> tt >>>
Set the speed of a test charge. Direction is unchanged.
>>> tt >>>
Set speed
o|id||Set the speed of this test charge:
d|speed|0.3|to v:
setDefault|
#FF707D
>>> tt >>>
Remove all charges and set default conditions.
This method is usually called at the beginning of a script for some browsers may not ensure well-defined initial conditions.
>>> tt >>>
Set default
@physletName|DataGraph
@code|dataGraph.DataGraph.class
@archive|DataGraph4_.jar,STools4.jar
@appletSize|400|200
@scriptHeader|setAutoRefresh(false);
@scriptFooter|setAutoRefresh(true);
@embedParam|b|ShowControls|false|show controls:
@embedParam|b|AutoScaleX|false|AutoScaleX:
@embedParam|b|AutoScaleY|false|AutoScaleY:
getGraphID|graph
#FF707D
>>> tt >>>
This command gives you a handle (ID) for the graph in this applet in a variable called "graph.."
>>> tt >>>
Get graph
addObject|id
#FFDA92
>>> tt >>>
Add a graph of an analytic function.
f - String of the function. Usually f(x) or f(x,t).
var - String the independent variable
Functions can be explicit functions of time. The function will animate if the clock is running.
xmin - minimum value for the independent variable
xmax - maximum value for the independent variable
A function will use the graph's current xmin and xmax values if the following are not specified.
n - int the number of evaluation points
>>> tt >>>
function
s|name|function|HIDDEN
$
.|s|f|0.3|function:
.|s|var|x|independent var:
.|d|xmin||
xmin:
.|d|xmax||xmax:
.|i|n|100|points:
setRGB|
#FFDA92
>>> tt >>>
Set the color of the object.
>>> tt >>>
color
o|id||id:
i|r|1|r:
i|g|1|g:
i|b|1|b:
setMinMaxX|
#FFFF99
>>> tt >>>
Set the x axis minimum and maximum values. No effect if AutoscaleX is true.
>>> tt >>>
x range
d|xmin|-10|xmin:
d|xmax|10|xmax:
setMinMaxY|
#FFFF99
>>> tt >>>
Set the y axis minimum and maximum values. No effect if autoscale is true.
>>> tt >>>
y range
d|ymin|-10|ymin:
d|ymax|10|ymax:
setAutoscaleX|
#FFFF99
>>> tt >>>
Default: X axis extends automatically when values get out of range.
Set AutoscaleY to false to fix the initial range limits.
>>> tt >>>
Autoscale x
b|autoOn|true|Autoscale on:
setAutoscaleY|
#FFFF99
>>> tt >>>
Default: Y axis extends automatically when values get out of range.
Set AutoscaleY to false to fix the initial range limits.
>>> tt >>>
Autoscale y
b|autoOn|true|Autoscale on:
clearAllSeries|
#CCFFCC
>>> tt >>>
Clear all data from the graph.
>>> tt >>>
clear
setSeriesRGB|
#CCFFCC
>>> tt >>>
Set the series line and marker color.
>>> tt >>>
series color
i|id|1|series number:
i|r|1|r:
i|g|1|g:
i|b|1|b:
setSeriesStyle|
#CCFFCC
>>> tt >>>
Set the series style.
points can be connected or not.
marker: 0 for no marker, 1 for crosses, 2 for squares (default), 3 for circles
>>> tt >>>
series style
i|id|1|series number:
b|conPts|true|connect points:
i|m|1|marker:
setAutoReplaceData|
#CCFFCC
>>> tt >>>
Disables the clearSeries function so that new data will replace a dataset when the addData method is called.
>>> tt >>>
AutoReplaceData
i|id|1|series number:
b|auto|true|auto:
setTitle|
#B3EFFF
>>> tt >>>
Set title.
>>> tt >>>
Title
s|title||text:
setLabelX|
#B3EFFF
>>> tt >>>
Set label of x axis.
>>> tt >>>
x label
s|xlabel||text:
setLabelY|
#B3EFFF
>>> tt >>>
Set label of y axis.
>>> tt >>>
Y label
s|ylabel||text:
setShowAxes|
#B3EFFF
>>> tt >>>
Show or hide the the X and Y axes on the graph.
>>> tt >>>
show axes
b|show|true|show:
setStripChart|
#B3EFFF
>>> tt >>>
Set strip chart mode (moving window of a given width) paced by the specified series.
>>> tt >>>
setStripChart
i|sid|1|series:
i|numPts|10|width (data points):
b|stripChart|true|enabled:
setAutoRefresh|
#E9D3FF
>>> tt >>>
Set the autoRefresh property. Automatic repaint if true.
>>> tt >>>
AutoRefresh
b|auto|true|Automatic repaint: