The site’s own reference code for this law, in TypeScript. It computes the numbers above when the page runs it, and it is what the page uses wherever a FrankenSim result is not available.
evaluateSr13 · src/physics/reference/electron.ts · this site’s source, as built · sha256:bb62046b9943f0fd874f6cf4023f1baf428e741c5f1cbd01923fbbab5921bad3
This function computes the listed outputs when it runs.
In words
It returns the longitudinal mass, the transverse mass in the comoving convention and the transverse mass in the laboratory convention, along with the kinetic energy, the accelerating potential, the radius of curvature in a magnetic and in an electric field, and the trajectory. At six tenths of the light speed an electron's three masses are 1.7792, 1.4233 and 1.1387 times 10^-30 kg: the longitudinal is the rest mass times gamma cubed, the comoving transverse times gamma squared, and the laboratory transverse times gamma.
Implementation
export function evaluateSr13(input: Sr13Input): Readonly<Record<string, ScientificResult>> {
const charge =
input.particle === "custom" && input.customCharge !== undefined
? input.customCharge
: -ELEMENTARY_CHARGE;
const mass =
input.particle === "custom" && input.customMass !== undefined
? input.customMass
: ELECTRON_MASS;
const beta = Math.abs(input.initialSpeed);
if (beta >= 1) {
return Object.freeze({
longitudinalMass: asOutside(
"longitudinalMass",
"kg",
"mass",
"superluminal-speed",
"Speed must be less than c.",
),
transverseMassComoving: asOutside(
"transverseMassComoving",
"kg",
"mass",
"superluminal-speed",
"Speed must be less than c.",
),
transverseMassLaboratory: asOutside(
"transverseMassLaboratory",
"kg",
"mass",
"superluminal-speed",
"Speed must be less than c.",
),
kineticEnergy: asOutside(
"kineticEnergy",
"J",
"energy",
"superluminal-speed",
"Speed must be less than c.",
),
kineticEnergyNewtonian: asOutside(
"kineticEnergyNewtonian",
"J",
"energy",
"superluminal-speed",
"Speed must be less than c.",
),
acceleratingPotential: asOutside(
"acceleratingPotential",
"V",
"electric-potential",
"superluminal-speed",
"Speed must be less than c.",
),
acceleratingPotentialNewtonian: asOutside(
"acceleratingPotentialNewtonian",
"V",
"electric-potential",
"superluminal-speed",
"Speed must be less than c.",
),
radiusCurvatureMagnetic: asOutside(
"radiusCurvatureMagnetic",
"m",
"length",
"superluminal-speed",
"Speed must be less than c.",
),
radiusCurvatureElectric: asOutside(
"radiusCurvatureElectric",
"m",
"length",
"superluminal-speed",
"Speed must be less than c.",
),
lorentzFactor: asOutside(
"lorentzFactor",
"1",
"dimensionless",
"superluminal-speed",
"Speed must be less than c.",
),
speedRatio: asOutside(
"speedRatio",
"1",
"ratio",
"superluminal-speed",
"Speed must be less than c.",
),
trajectoryPositions: asOutside(
"trajectoryPositions",
"m",
"trajectory-xy",
"superluminal-speed",
"Speed must be less than c.",
),
});
}
const gRes = gamma(beta);
const g = gRes.status === "value" ? gRes.value : 1;
const longM = longitudinalMass(mass, beta);
const transMComov = transverseMassComoving(mass, beta);
const transMLab = transverseMassLaboratory(mass, beta);
const ke = kineticEnergy(mass, beta);
const pot = acceleratingPotential(beta, Math.abs(charge), mass);
const bMag = Math.hypot(input.magneticFieldX, input.magneticFieldY, input.magneticFieldZ);
const rm =
bMag > 0
? magneticRadius(beta, bMag, Math.abs(charge), mass).exact
: asOutside(
"radiusCurvatureMagnetic",
"m",
"length",
"zero-field",
"Magnetic field magnitude is zero.",
);
const eMag = Math.hypot(input.electricFieldX, input.electricFieldY, input.electricFieldZ);
const re =
eMag > 0
? electricRadius(beta, eMag, Math.abs(charge), mass).exact
: asOutside(
"radiusCurvatureElectric",
"m",
"length",
"zero-field",
"Electric field magnitude is zero.",
);
return Object.freeze({
longitudinalMass: longM,
transverseMassComoving: transMComov,
transverseMassLaboratory: transMLab,
kineticEnergy: ke.exact,
kineticEnergyNewtonian: ke.newtonian,
acceleratingPotential: pot.exact,
acceleratingPotentialNewtonian: pot.newtonian,
radiusCurvatureMagnetic: rm,
radiusCurvatureElectric: re,
lorentzFactor: asValue("lorentzFactor", "1", "dimensionless", g),
speedRatio: asValue("speedRatio", "1", "ratio", beta),
trajectoryPositions: sr13Trajectory(input, beta, charge, mass),
});
}