MaxwellSolver

Struct MaxwellSolver 

Source
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

Source

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.
Source

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.
Source

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.

Source

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.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.