System

The WeberSystem encapsulates the symbolic and compiled Weber Hamiltonian for a given (n_particles, dims) configuration. Construct it once and reuse it across many WeberProblem instances.

WeberElectrodynamics.WeberSystemType
WeberSystem

Symbolic and compiled representation of the n-body Weber Hamiltonian.

Constructed once for a given (n_particles, dims) pair via WeberSystem(n_particles, dims). The compiled equations of motion are reused across many WeberProblem instances with different physical parameters. Construction involves symbolic differentiation and code generation via Symbolics.jl; expect a few seconds for the first call.

Fields

  • n_particles::Int: Number of charged particles.
  • dims::Int: Spatial dimension (1, 2, or 3).
  • q_symbols::Vector{Num}: Symbolic coordinate variables [x1, y1, ..., xN, yN, ...].
  • p_symbols::Vector{Num}: Symbolic momentum variables [px1, py1, ...].
  • param_symbols: Symbolic parameter vector [m1…mN, q1…qN, c, κ12, κ13, …].
  • hamiltonian_symbolic: Full symbolic Weber Hamiltonian expression.
  • dq_dt_symbolic, dp_dt_symbolic: Symbolic Hamilton's equations.
  • dq_dt_compiled, dp_dt_compiled: In-place compiled equations of motion.
  • hamiltonian_compiled: Compiled scalar Hamiltonian function.
  • degrees_of_freedom::Int: Total DOF = n_particles × dims.
source
WeberElectrodynamics.WeberSystemMethod
WeberSystem(n_particles::Int, dims::Int) -> WeberSystem

Build and compile the symbolic Weber Hamiltonian for n_particles particles in dims dimensions.

Uses Symbolics.jl to derive Hamilton's equations analytically, then compiles them to efficient in-place Julia functions via build_function. The resulting WeberSystem can be reused across multiple WeberProblem instances.

Arguments

  • n_particles: Number of particles (≥ 1).
  • dims: Spatial dimension; must be 1, 2, or 3.

Returns

  • WeberSystem with compiled equations of motion ready for WeberProblem.
source