Simulation setup

Geometry (conductor) Ellipse
Conductor shape Ellipse is fast; custom expression uses math.js and is slower.
ellipse
xMinPlot / sampling box
xMaxPlot / sampling box
yMinPlot / sampling box
yMaxPlot / sampling box
x0Ellipse center
y0Ellipse center
REllipse size
a (ellipse anisotropy) Matches MATLAB: (x-x0)^2 + a (y-y0)^2 ≤ R^2 (default a=3)
Charges & dynamics ready
N (free charges) O(N²) interactions; keep N modest for iPad.
Initial free charges All +1 (as in your current MATLAB) or half + / half −.
all +
ε0Arbitrary units
mMass of each free charge
dtTimestep
γDrag: F = −γ m v
asoftSoftening length
nStepsTotal steps (0 = ∞)
Merging / annihilationRemove opposite-sign pairs if close
on
rMergeDistance threshold
External fixed charges
Edit rows before starting. Rows with q=0 are ignored.
q x y  
Visualisation
Field shown Matches MATLAB: free / fixed / total
total
Plot update everySimulation steps
Grid resolutionHeatmap (Nx=Ny)
ColorbarShow magnitude scale
on
|E| saturationClips the heatmap scale
Quiver arrowsE-field direction
on
Arrow strideEvery k grid points
Quiver scaleArrow length factor
Max arrow lengthHard cap
EquipotentialsOptional contour overlay (slower)
off
# contoursEquipotential levels
Runtime
Steps per animation frame Increase to speed up (stability depends on dt)
idle t = 0 step = 0 N = 0
boundary: bisection + normal
If it feels slow: reduce Grid resolution, increase Plot update every, or reduce N.
2D charges in a conductor
Heatmap: |E|, arrows: E, dots: free charges, squares: fixed charges
render: ready