Electrostatics
These are Apas Cloud services: they run on our servers for a signed-in member. The examples below are shown already made; sign in to edit and run your own.
position Apas Cloud
A point in space for the electrostatics functions. Coordinates are metres, or quantities of length. With one argument, position(t) is the turtle's position instead.
x (number or quantity) -- x coordinate
y (number or quantity) -- y coordinate
z (number or quantity) -- z coordinate
pointCharge Apas Cloud
A point charge at a position. Read it with c.x, c.y, c.z and c.q.
position (record) -- Where the charge is, from position()
q (number or quantity) -- The charge, in C or as a quantity
chargeCollection Apas Cloud
Several point charges as one model, for the field, potential and energy functions.
charges... (record) -- Any number of point charges
electricPotentialAt Apas Cloud
The potential at a point due to a collection of point charges, V = sum of k q / r, zero at infinity. The result is a quantity in volts.
charges (record) -- A charge collection
at (record) -- The point, from position()
k (number) -- Optional Coulomb constant in N m^2/C^2. Left out, the physical constant is used and the result is approximate (it contains pi); k = 1 gives an exact classroom model
electricFieldAt Apas Cloud
The electric field at a point due to a collection of point charges, by superposition. The result has .x, .y, .z (N/C) and .units.
charges (record) -- A charge collection
at (record) -- The point, away from every charge
k (number) -- Optional Coulomb constant in N m^2/C^2. Left out, the physical constant is used and the result is approximate (it contains pi); k = 1 gives an exact classroom model
electricForceOn Apas Cloud
The force on a charge in a field, F = q E. The result has .x, .y, .z in newtons.
q (number or quantity) -- The charge
field (record) -- A field, as electricFieldAt gives it
potentialExpression Apas Cloud
The potential of a collection of point charges as a formula in x, y and z.
charges (record) -- A charge collection
k (number) -- Optional Coulomb constant in N m^2/C^2. Left out, the physical constant is used and the result is approximate (it contains pi); k = 1 gives an exact classroom model
fieldExpression Apas Cloud
The electric field of a collection of point charges as formulas in x, y and z: E = -grad V, worked symbolically. Read the components with E.x, E.y, E.z.
charges (record) -- A charge collection
k (number) -- Optional Coulomb constant in N m^2/C^2. Left out, the physical constant is used and the result is approximate (it contains pi); k = 1 gives an exact classroom model
configurationEnergy Apas Cloud
The electrostatic energy of a collection of point charges: the sum of k q1 q2 / r over every pair. The result is a quantity in joules.
charges (record) -- A charge collection
k (number) -- Optional Coulomb constant in N m^2/C^2. Left out, the physical constant is used and the result is approximate (it contains pi); k = 1 gives an exact classroom model
workByField Apas Cloud
The work done by the field of a collection of charges on a test charge moved from one point to another, W = q (V_from - V_to). The result is a quantity in joules.
q (number or quantity) -- The test charge
charges (record) -- The charges making the field
from (record) -- Starting point
to (record) -- End point
k (number) -- Optional Coulomb constant in N m^2/C^2. Left out, the physical constant is used and the result is approximate (it contains pi); k = 1 gives an exact classroom model
dipoleMoment Apas Cloud
The dipole moment of a collection of charges about a point, p = sum of q r. The result has .x, .y, .z in C m.
charges (record) -- A charge collection
origin (record) -- Optional reference point; the origin when left out
dipoleTorque Apas Cloud
The torque on a dipole in a uniform field, the cross product p x E. The result has .x, .y, .z in N m.
p (record or vector) -- Dipole moment, in C m
E (record or vector) -- Field, in N/C
dipolePotentialEnergy Apas Cloud
The energy of a dipole in a uniform field, U = -p . E. The result is a quantity in joules.
p (record or vector) -- Dipole moment, in C m
E (record or vector) -- Field, in N/C
gaussFlux Apas Cloud
The electric flux through a closed surface around a charge, by Gauss's law: Q / eps0. The result is a quantity in N m^2/C.
Q (number or quantity) -- Enclosed charge
sphericalField Apas Cloud
The field at a distance from a spherically symmetric charge, by Gauss's law: Q / (4 pi eps0 r^2). The result is a quantity in N/C.
Q (number or quantity) -- Enclosed charge
r (number or quantity) -- Distance from the centre
infiniteLineField Apas Cloud
The field at a distance from a long straight line of charge: lambda / (2 pi eps0 r). The result is a quantity in N/C.
lambda (number or quantity) -- Charge per unit length, C/m
r (number or quantity) -- Distance from the line
infiniteSheetField Apas Cloud
The field of a large flat sheet of charge: sigma / (2 eps0), the same at every distance. The result is a quantity in N/C.
sigma (number or quantity) -- Charge per unit area, C/m^2
sphericalShellPotential Apas Cloud
The potential of a thin charged spherical shell: k Q / R everywhere inside, k Q / r outside. The result is a quantity in volts.
Q (number or quantity) -- Total charge, in C or as a quantity
R (number or quantity) -- Radius of the shell or sphere
r (number or quantity) -- Distance of the point from the centre
k (number) -- Optional Coulomb constant in N m^2/C^2. Left out, the physical constant is used and the result is approximate (it contains pi); k = 1 gives an exact classroom model
sphericalShellField Apas Cloud
The radial field of a thin charged spherical shell: zero inside, k Q / r^2 outside. The result is a quantity in N/C.
Q (number or quantity) -- Total charge, in C or as a quantity
R (number or quantity) -- Radius of the shell or sphere
r (number or quantity) -- Distance of the point from the centre
k (number) -- Optional Coulomb constant in N m^2/C^2. Left out, the physical constant is used and the result is approximate (it contains pi); k = 1 gives an exact classroom model
solidSpherePotential Apas Cloud
The potential of a uniformly charged solid sphere: k Q (3 R^2 - r^2) / (2 R^3) inside, k Q / r outside. The result is a quantity in volts.
Q (number or quantity) -- Total charge, in C or as a quantity
R (number or quantity) -- Radius of the shell or sphere
r (number or quantity) -- Distance of the point from the centre
k (number) -- Optional Coulomb constant in N m^2/C^2. Left out, the physical constant is used and the result is approximate (it contains pi); k = 1 gives an exact classroom model
solidSphereField Apas Cloud
The radial field of a uniformly charged solid sphere: k Q r / R^3 inside, k Q / r^2 outside. The result is a quantity in N/C.
Q (number or quantity) -- Total charge, in C or as a quantity
R (number or quantity) -- Radius of the shell or sphere
r (number or quantity) -- Distance of the point from the centre
k (number) -- Optional Coulomb constant in N m^2/C^2. Left out, the physical constant is used and the result is approximate (it contains pi); k = 1 gives an exact classroom model
ringAxialPotential Apas Cloud
The potential on the axis of a uniformly charged ring: k Q / sqrt(R^2 + z^2). The result is a quantity in volts.
Q (number or quantity) -- Total charge, in C or as a quantity
R (number or quantity) -- Radius of the ring, which lies in the xy plane
z (number or quantity) -- Signed distance along the axis
k (number) -- Optional Coulomb constant in N m^2/C^2. Left out, the physical constant is used and the result is approximate (it contains pi); k = 1 gives an exact classroom model
ringAxialField Apas Cloud
The field along the axis of a uniformly charged ring: k Q z / (R^2 + z^2)^(3/2). The result is a quantity in N/C.
Q (number or quantity) -- Total charge, in C or as a quantity
R (number or quantity) -- Radius of the ring, which lies in the xy plane
z (number or quantity) -- Signed distance along the axis
k (number) -- Optional Coulomb constant in N m^2/C^2. Left out, the physical constant is used and the result is approximate (it contains pi); k = 1 gives an exact classroom model
finiteRodAxisPotential Apas Cloud
The potential on the line of a uniformly charged rod, beyond its end. It contains a logarithm, so the value is approximate. The result is a quantity in volts.
Q (number or quantity) -- Total charge, in C or as a quantity
L (number or quantity) -- Length of the rod, which lies along the x axis centred at the origin
x (number or quantity) -- Position on the x axis, beyond the end of the rod
k (number) -- Optional Coulomb constant in N m^2/C^2. Left out, the physical constant is used and the result is approximate (it contains pi); k = 1 gives an exact classroom model
finiteRodAxisField Apas Cloud
The field on the line of a uniformly charged rod, beyond its end: k (Q/L) (1/|x - L/2| - 1/|x + L/2|). The result is a quantity in N/C.
Q (number or quantity) -- Total charge, in C or as a quantity
L (number or quantity) -- Length of the rod, which lies along the x axis centred at the origin
x (number or quantity) -- Position on the x axis, beyond the end of the rod
k (number) -- Optional Coulomb constant in N m^2/C^2. Left out, the physical constant is used and the result is approximate (it contains pi); k = 1 gives an exact classroom model
finiteRodPerpendicularPotential Apas Cloud
The potential on the perpendicular bisector of a uniformly charged rod. It contains an inverse hyperbolic sine, so the value is approximate. The result is a quantity in volts.
Q (number or quantity) -- Total charge, in C or as a quantity
L (number or quantity) -- Length of the rod, which lies along the x axis centred at the origin
y (number or quantity) -- Distance from the rod along its perpendicular bisector, not zero
k (number) -- Optional Coulomb constant in N m^2/C^2. Left out, the physical constant is used and the result is approximate (it contains pi); k = 1 gives an exact classroom model
finiteRodPerpendicularField Apas Cloud
The field on the perpendicular bisector of a uniformly charged rod: k Q / (y sqrt(y^2 + (L/2)^2)). The result is a quantity in N/C.
Q (number or quantity) -- Total charge, in C or as a quantity
L (number or quantity) -- Length of the rod, which lies along the x axis centred at the origin
y (number or quantity) -- Distance from the rod along its perpendicular bisector, not zero
k (number) -- Optional Coulomb constant in N m^2/C^2. Left out, the physical constant is used and the result is approximate (it contains pi); k = 1 gives an exact classroom model
diskAxialPotential Apas Cloud
The potential on the axis of a uniformly charged disk: sigma (sqrt(R^2 + z^2) - |z|) / (2 eps0). The result is a quantity in volts.
sigma (number or quantity) -- Charge per unit area, C/m^2
R (number or quantity) -- Radius of the disk, which lies in the xy plane
z (number or quantity) -- Signed distance along the axis
diskAxialField Apas Cloud
The field along the axis of a uniformly charged disk: sigma (1 - |z| / sqrt(R^2 + z^2)) / (2 eps0), pointing away from a positive disk. The result is a quantity in N/C.
sigma (number or quantity) -- Charge per unit area, C/m^2
R (number or quantity) -- Radius of the disk, which lies in the xy plane
z (number or quantity) -- Signed distance along the axis
infiniteLinePotentialDifference Apas Cloud
The potential at distance r from a long line of charge, measured from a reference distance r0: V(r) - V(r0) = -lambda ln(r / r0) / (2 pi eps0). Approximate (a logarithm). The result is a quantity in volts.
lambda (number or quantity) -- Charge per unit length, C/m
r (number or quantity) -- Distance of the point from the line
r0 (number or quantity) -- Reference distance, where the potential is taken as zero
infiniteSheetPotentialDifference Apas Cloud
The potential at distance z from a large flat sheet of charge, measured from a reference distance z0: V(z) - V(z0) = -sigma (|z| - |z0|) / (2 eps0). The result is a quantity in volts.
sigma (number or quantity) -- Charge per unit area, C/m^2
z (number or quantity) -- Distance of the point from the sheet
z0 (number or quantity) -- Reference distance
infiniteSolidCylinderField Apas Cloud
The radial field of a long uniformly charged solid cylinder: lambda r / (2 pi eps0 R^2) inside, lambda / (2 pi eps0 r) outside. The result is a quantity in N/C.
lambda (number or quantity) -- Charge per unit length of the cylinder, C/m
R (number or quantity) -- Radius of the cylinder
r (number or quantity) -- Distance of the point from the axis
infiniteSolidCylinderPotentialFromSurface Apas Cloud
The potential of a long uniformly charged solid cylinder, measured from its surface (V = 0 at r = R). The result is a quantity in volts.
lambda (number or quantity) -- Charge per unit length of the cylinder, C/m
R (number or quantity) -- Radius of the cylinder
r (number or quantity) -- Distance of the point from the axis
infiniteCylindricalShellField Apas Cloud
The radial field of a long thin charged cylindrical shell: zero inside, lambda / (2 pi eps0 r) outside. The result is a quantity in N/C.
lambda (number or quantity) -- Charge per unit length of the cylinder, C/m
R (number or quantity) -- Radius of the cylinder
r (number or quantity) -- Distance of the point from the axis
infiniteCylindricalShellPotentialFromSurface Apas Cloud
The potential of a long thin charged cylindrical shell, measured from its surface: zero inside, -lambda ln(r / R) / (2 pi eps0) outside. The result is a quantity in volts.
lambda (number or quantity) -- Charge per unit length of the cylinder, C/m
R (number or quantity) -- Radius of the cylinder
r (number or quantity) -- Distance of the point from the axis
parallelPlateCapacitance Apas Cloud
The capacitance of two parallel plates, eps A / d, ignoring the fringe field. The result is a quantity in farads.
A (number or quantity) -- Plate area, m^2
d (number or quantity) -- Gap between the plates
eps (number) -- Optional absolute permittivity in F/m; the vacuum's when left out (eps = 1 gives an exact classroom model)
dielectricCapacitance Apas Cloud
The capacitance with a dielectric filling the gap: kappa times the vacuum capacitance. The result is a quantity in farads.
C0 (number or quantity) -- Capacitance without the dielectric
kappa (number) -- Relative permittivity (dielectric constant)
capacitorCharge Apas Cloud
The charge on a capacitor, Q = C V. The result is a quantity in coulombs.
C (number or quantity) -- Capacitance
V (number or quantity) -- Voltage across it
capacitorVoltage Apas Cloud
The voltage across a capacitor, V = Q / C. The result is a quantity in volts.
Q (number or quantity) -- Charge
C (number or quantity) -- Capacitance
capacitorEnergy Apas Cloud
The energy stored in a capacitor, U = Q^2 / (2 C). The result is a quantity in joules.
Q (number or quantity) -- Charge
C (number or quantity) -- Capacitance
seriesCapacitance Apas Cloud
Capacitors in series: 1 / C = 1 / C1 + 1 / C2 + ... The result is a quantity in farads.
C1, C2, ... (number or quantity) -- The capacitances
parallelCapacitance Apas Cloud
Capacitors in parallel: C = C1 + C2 + ... The result is a quantity in farads.
C1, C2, ... (number or quantity) -- The capacitances
dielectricConnected Apas Cloud
A capacitor that stays connected to its battery while a dielectric is put in: the voltage is fixed, the charge and energy rise. The result has .capacitance, .charge, .voltage and .energy, each a quantity.
C0 (number or quantity) -- Capacitance before
V (number or quantity) -- Battery voltage
kappa (number) -- Relative permittivity of the dielectric
dielectricDisconnected Apas Cloud
A charged capacitor that is disconnected before a dielectric is put in: the charge is fixed, the voltage and energy fall. The result has .capacitance, .charge, .voltage and .energy, each a quantity.
C0 (number or quantity) -- Capacitance before
Q (number or quantity) -- Charge on the plates
kappa (number) -- Relative permittivity of the dielectric
electricEnergyDensity Apas Cloud
The energy per unit volume of an electric field, u = eps E^2 / 2. The result is a quantity in J/m^3.
eps (number or quantity) -- Absolute permittivity, F/m
E (number or quantity) -- Field strength, N/C
isolatedSphereCapacitance Apas Cloud
The capacitance of a conducting sphere on its own, R / k = 4 pi eps0 R. The result is a quantity in farads.
R (number or quantity) -- Radius of the sphere
k (number) -- Optional Coulomb constant in N m^2/C^2. Left out, the physical constant is used and the result is approximate (it contains pi); k = 1 gives an exact classroom model
sphericalCapacitorCapacitance Apas Cloud
The capacitance of two concentric conducting spheres, a b / (k (b - a)). The result is a quantity in farads.
a (number or quantity) -- Inner radius
b (number or quantity) -- Outer radius, larger than a
connectedSphereCharges Apas Cloud
The charges on two distant conducting spheres after they are joined by a thin wire: the total charge is shared in proportion to the radii. The result has .first and .second, each a quantity in coulombs.
R1 (number or quantity) -- Radius of the first sphere
R2 (number or quantity) -- Radius of the second sphere
Q1 (number or quantity) -- Charge on the first before joining
Q2 (number or quantity) -- Charge on the second before joining
idealDipolePotential Apas Cloud
The potential of a point dipole, V = k (p . r) / r^3. The result is a quantity in volts.
p (record or vector) -- Dipole moment, in C m
r (record) -- The point, measured from the dipole, from position()
k (number) -- Optional Coulomb constant in N m^2/C^2. Left out, the physical constant is used and the result is approximate (it contains pi); k = 1 gives an exact classroom model
idealDipoleField Apas Cloud
The field of a point dipole, E = k (3 (p . r) r / r^5 - p / r^3). The result has .x, .y, .z in N/C.
p (record or vector) -- Dipole moment, in C m
r (record) -- The point, measured from the dipole, from position()
k (number) -- Optional Coulomb constant in N m^2/C^2. Left out, the physical constant is used and the result is approximate (it contains pi); k = 1 gives an exact classroom model
partiallyFilledAreaCapacitance Apas Cloud
A parallel-plate capacitor with a dielectric covering a fraction of the plate area (the two parts act in parallel): C0 (1 - f + kappa f). The result is a quantity in farads.
C0 (number or quantity) -- Capacitance without the dielectric
kappa (number) -- Relative permittivity
f (number) -- Fraction of the plate area covered, from 0 to 1
dielectricSlabCapacitance Apas Cloud
A parallel-plate capacitor with a dielectric slab thinner than the gap (the slab and the remaining gap act in series): eps A / (d - t + t / kappa). The result is a quantity in farads.
A (number or quantity) -- Plate area, m^2
d (number or quantity) -- Gap between the plates
t (number or quantity) -- Thickness of the slab, at most d
kappa (number) -- Relative permittivity of the slab
eps (number) -- Optional absolute permittivity in F/m; the vacuum's when left out (eps = 1 gives an exact classroom model)
cylindricalCapacitorCapacitance Apas Cloud
The capacitance of a long coaxial pair of cylinders, 2 pi eps L / ln(b / a), ignoring the ends. Approximate (a logarithm). The result is a quantity in farads.
a (number or quantity) -- Inner radius
b (number or quantity) -- Outer radius, larger than a
L (number or quantity) -- Length
eps (number) -- Optional absolute permittivity in F/m; the vacuum's when left out (eps = 1 gives an exact classroom model)