pub struct MaxwellSolver;Expand description
A standard solver for Maxwell’s Equations in Geometric Algebra.
This solver provides methods to derive electromagnetic properties from potentials and fields in a coordinate-free manner, suitable for relativistic electrodynamics.
§Theoretical Basis
In Geometric Algebra (Space-Time Algebra), Maxwell’s equations are unified into a single equation: $\nabla F = J$ where:
- $F = \nabla A$ is the electromagnetic field bivector.
- $A$ is the vector potential.
- $J$ is the source current density.
- $\nabla$ is the vector derivative (gradient).
Implementations§
Source§impl MaxwellSolver
impl MaxwellSolver
Sourcepub fn calculate_field_tensor(
gradient: &CausalMultiVector<f64>,
potential: &CausalMultiVector<f64>,
) -> Result<CausalMultiVector<f64>, PhysicsError>
pub fn calculate_field_tensor( gradient: &CausalMultiVector<f64>, potential: &CausalMultiVector<f64>, ) -> Result<CausalMultiVector<f64>, PhysicsError>
Calculates the Electromagnetic Field Tensor $F$ from the Potential $A$.
$F = \nabla \wedge A$
This represents the “Faraday bivector” containing both Electric (E) and Magnetic (B) fields.
§Arguments
gradient- The vector derivative operator $\nabla$ (or directional derivatives).potential- The vector potential $A$.
§Returns
Ok(CausalMultiVector)- The field bivector $F$ (Grade 2).Err(PhysicsError)- If dimensions or metrics mismatch.
Sourcepub fn calculate_potential_divergence(
gradient: &CausalMultiVector<f64>,
potential: &CausalMultiVector<f64>,
) -> Result<f64, PhysicsError>
pub fn calculate_potential_divergence( gradient: &CausalMultiVector<f64>, potential: &CausalMultiVector<f64>, ) -> Result<f64, PhysicsError>
Calculates the Lorenz Gauge scalar.
$L = \nabla \cdot A$
In the Lorenz gauge, this value should be zero (or near zero).
§Returns
Ok(f64)- The scalar divergence.Err(PhysicsError)- If inputs are not pure grade-1 vectors.
Sourcepub fn calculate_current_density(
gradient: &CausalMultiVector<f64>,
field: &CausalMultiVector<f64>,
) -> Result<CausalMultiVector<f64>, PhysicsError>
pub fn calculate_current_density( gradient: &CausalMultiVector<f64>, field: &CausalMultiVector<f64>, ) -> Result<CausalMultiVector<f64>, PhysicsError>
Calculates the Source Current Density $J$ from the Field Tensor $F$.
$J = \nabla \cdot F$ (Vector part of $\nabla F$)
Note: The full source equation is $\nabla F = J$. Since $F$ is a bivector, $\nabla F$ has a vector part ($\nabla \cdot F$) and a trivector part ($\nabla \wedge F$). The trivector part is zero $\nabla \wedge F = 0$ (Bianchi identity) if F comes from a potential. Thus $J$ corresponds to the vector part.
Sourcepub fn calculate_poynting_flux(
e_field: &CausalMultiVector<f64>,
b_field: &CausalMultiVector<f64>,
) -> Result<CausalMultiVector<f64>, PhysicsError>
pub fn calculate_poynting_flux( e_field: &CausalMultiVector<f64>, b_field: &CausalMultiVector<f64>, ) -> Result<CausalMultiVector<f64>, PhysicsError>
Calculates the Poynting Flux Vector $S$.
$S = E \times B$
Computes the energy flux density from separated Electric and Magnetic field vectors.
§Arguments
e_field- Electric field vector E.b_field- Magnetic field vector B.