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.
evaluateSr10 · src/physics/reference/waves.ts · this site’s source, as built · sha256:ad778c144088027bf765a7708142de80d198481e20d810dad7ba4d4e62bca5e2
This function computes the listed outputs when it runs.
In words
A light complex carries an energy, occupies a volume and has an amplitude, and all three change together under a boost. The function returns the transformed energy, volume and amplitude, and the three factors relating them, for a bundle travelling at a stated angle. The energy factor is the same Doppler factor the previous instrument returns, which is § 8's result: the energy of a light complex transforms exactly as its frequency does.
Implementation
export function evaluateSr10(input: Sr10Input): Sr10EvaluationResult {
const beta = input.beta;
const thetaDeg = input.propagationAngleDeg;
const thetaRad = (thetaDeg * Math.PI) / 180;
const initialEnergyJ = input.initialEnergyJ ?? 1.0;
const initialVolumeM3 = input.initialVolumeM3 ?? 1.0;
const initialAmplitude = input.initialAmplitude ?? 1.0;
if (!Number.isFinite(beta) || Math.abs(beta) >= 1) {
return Object.freeze({
beta,
gamma: Number.NaN,
propagationAngleStationaryDeg: thetaDeg,
propagationAngleStationaryRad: thetaRad,
propagationAngleMovingDeg: Number.NaN,
propagationAngleMovingRad: Number.NaN,
cosThetaStationary: Number.NaN,
sinThetaStationary: Number.NaN,
cosThetaMoving: Number.NaN,
sinThetaMoving: Number.NaN,
initialEnergyJ,
transformedEnergyJ: Number.NaN,
initialVolumeM3,
transformedVolumeM3: Number.NaN,
initialAmplitude,
transformedAmplitude: Number.NaN,
energyFactor: Number.NaN,
energyDensityFactor: Number.NaN,
volumeFactor: Number.NaN,
amplitudeFactor: Number.NaN,
materialVolumeFactor: Number.NaN,
countermodelEnergyJ: Number.NaN,
countermodelVolumeM3: Number.NaN,
countermodelEnergyFactor: Number.NaN,
countermodelVolumeFactor: Number.NaN,
numericVolumeM3: Number.NaN,
results: [
sr10Outside("frameSpeed", "c", "speed"),
sr10Outside("propagationAngleStationary", "deg", "angle"),
sr10Outside("propagationAngleMoving", "deg", "angle"),
sr10Outside("lightComplexEnergyStationary", "J", "energy"),
sr10Outside("lightComplexEnergyMoving", "J", "energy"),
sr10Outside("lightComplexVolumeStationary", "m^3", "space-geometry"),
sr10Outside("lightComplexVolumeMoving", "m^3", "space-geometry"),
sr10Outside("lightAmplitudeStationary", "V/m", "field"),
sr10Outside("lightAmplitudeMoving", "V/m", "field"),
sr10Outside("dopplerFactor", "1", "ratio"),
sr10Outside("lorentzFactor", "1", "lorentz-factor"),
sr10Outside("energyDensityFactor", "1", "ratio"),
sr10Outside("volumeFactor", "1", "ratio"),
sr10Outside("materialVolumeFactor", "1", "ratio"),
],
countermodelComparison: Object.freeze({
modelId: "countermodel-material-contraction",
results: Object.freeze([]),
}),
status: "outside-domain",
});
}
const gResult = gamma(beta);
const g = gResult.status === "value" ? gResult.value : Number.NaN;
const cosThetaK = Math.cos(thetaRad);
const sinThetaK = Math.sin(thetaRad);
const factors = lightComplexFactors(beta, thetaRad);
const q = factors.energyFactor;
const q2 = factors.energyDensityFactor;
const volFactor = factors.volumeFactor;
const ab = aberration(beta, thetaRad);
let theta_k_deg = (ab.thetaPrimeRad * 180) / Math.PI;
if (theta_k_deg < 0) theta_k_deg += 360;
const transformedEnergyJ = initialEnergyJ * q;
const transformedVolumeM3 = initialVolumeM3 * volFactor;
const transformedAmplitude = initialAmplitude * q;
const countermodel = lightComplexMaterialContractionCountermodel(beta, thetaRad);
const countermodelEnergyFactor = countermodel.factor;
const countermodelVolumeFactor = countermodel.volumeFactor;
const countermodelEnergyJ = initialEnergyJ * countermodelEnergyFactor;
const countermodelVolumeM3 = initialVolumeM3 * countermodelVolumeFactor;
const materialVolumeFactor = 1 / g;
const numericVolRatio = lightComplexVolumeNumeric(beta, thetaRad);
const numericVolumeM3 = initialVolumeM3 * numericVolRatio;
const val = (
quantityId: string,
unit: string,
semanticKind: string,
v: number,
): ScientificResult =>
Object.freeze({
quantityId,
unit,
semanticKind,
ownerId: OWNER_ID,
status: "value" as const,
value: v,
});
const results: readonly ScientificResult[] = [
val("frameSpeed", "c", "speed", beta),
val("propagationAngleStationary", "deg", "angle", thetaDeg),
val("propagationAngleMoving", "deg", "angle", theta_k_deg),
val("lightComplexEnergyStationary", "J", "energy", initialEnergyJ),
val("lightComplexEnergyMoving", "J", "energy", transformedEnergyJ),
val("lightComplexVolumeStationary", "m^3", "space-geometry", initialVolumeM3),
val("lightComplexVolumeMoving", "m^3", "space-geometry", transformedVolumeM3),
val("lightAmplitudeStationary", "V/m", "field", initialAmplitude),
val("lightAmplitudeMoving", "V/m", "field", transformedAmplitude),
val("dopplerFactor", "1", "ratio", q),
val("lorentzFactor", "1", "lorentz-factor", g),
val("energyDensityFactor", "1", "ratio", q2),
val("volumeFactor", "1", "ratio", volFactor),
val("materialVolumeFactor", "1", "ratio", materialVolumeFactor),
];
// The countermodel is a named wrong model: a reader's numbers never come from it, so it is
// returned beside the accepted outputs, under its model id, and never among them.
const countermodelComparison = Object.freeze({
modelId: countermodel.modelId,
results: Object.freeze([
val("countermodelEnergyMoving", "J", "energy", countermodelEnergyJ),
val("countermodelVolumeMoving", "m^3", "space-geometry", countermodelVolumeM3),
val("countermodelEnergyFactor", "1", "ratio", countermodelEnergyFactor),
val("countermodelVolumeFactor", "1", "ratio", countermodelVolumeFactor),
]),
});
return Object.freeze({
beta,
gamma: g,
propagationAngleStationaryDeg: thetaDeg,
propagationAngleStationaryRad: thetaRad,
propagationAngleMovingDeg: theta_k_deg,
propagationAngleMovingRad: ab.thetaPrimeRad,
cosThetaStationary: cosThetaK,
sinThetaStationary: sinThetaK,
cosThetaMoving: ab.cosThetaPrime,
sinThetaMoving: ab.sinThetaPrime,
initialEnergyJ,
transformedEnergyJ,
initialVolumeM3,
transformedVolumeM3,
initialAmplitude,
transformedAmplitude,
energyFactor: q,
energyDensityFactor: q2,
volumeFactor: volFactor,
amplitudeFactor: q,
materialVolumeFactor,
countermodelEnergyJ,
countermodelVolumeM3,
countermodelEnergyFactor,
countermodelVolumeFactor,
numericVolumeM3,
results,
countermodelComparison,
status: "value",
});
}