Solver
One-shot interface
CommonSolve.solve — Function
solve(prob::WeberProblem, alg::WeberAlgorithm = SymmetricProjectionIntegrator()) -> WeberSolutionInitialise and run the integrator in a single call.
Convenience wrapper equivalent to solve!(init(prob, alg)).
Returns
WeberSolutionwithretcode ∈ {:Success, :Failure}.
Step-by-step interface
CommonSolve.init — Function
init(prob::WeberProblem, alg::SymmetricProjectionIntegrator = SymmetricProjectionIntegrator()) -> WeberIntegratorInitialise a step-by-step integrator without running any steps.
Pre-allocates all workspace buffers and history arrays sized to hold the full trajectory. Use the returned integrator with step! for fine-grained control, or pass it directly to solve!.
Returns
WeberIntegratoratt = prob.tspan[1]withstep_count = 0.
CommonSolve.step! — Function
step!(integrator::WeberIntegrator) -> BoolAdvance the integrator by one macro time step prob.dt.
Dispatches to the regularized or plain Cartesian integration path based on current particle separations and prob.regularization settings. The final step is automatically shortened to land exactly on prob.tspan[2].
Returns
trueif more steps remain,falsewhen integration is complete.
CommonSolve.solve! — Function
solve!(integrator::WeberIntegrator) -> WeberSolutionRun the integrator to completion and return the full solution.
Repeatedly calls step! until t ≥ t_end. If the fixed-point projection fails to converge, retcode is set to :Failure rather than throwing.
Returns
WeberSolutioncontaining the full time series and regularization diagnostics.
Types
WeberElectrodynamics.WeberIntegrator — Type
WeberIntegratorMutable step-by-step integrator returned by init.
Use step!(integrator) to advance one macro-step, or solve!(integrator) to run to completion. The current state is accessible via integrator.q, integrator.p, and integrator.t.
Fields
prob::WeberProblem: Problem definition.alg::SymmetricProjectionIntegrator: Algorithm parameters.t::Float64: Current time.t_end::Float64: Final time (prob.tspan[2]).q::Vector{Float64}: Current flattened positions.p::Vector{Float64}: Current flattened momenta.step_count::Int: Number of macro-steps completed so far.buffers::SymmetricProjectionBuffers: Pre-allocated workspace (internal).diagnostics::RegularizationDiagnostics: Live regularization statistics.t_history::Vector{Float64}: Pre-allocated time history array.q_history::Vector{Vector{Float64}}: Pre-allocated position history.p_history::Vector{Vector{Float64}}: Pre-allocated momentum history.
WeberElectrodynamics.WeberSolution — Type
WeberSolutionResult returned by solve or solve!.
Supports Julia iteration (for (t, q, p) in sol), integer indexing (sol[i]), and length(sol). Each index returns a (t, q, p) tuple.
Fields
t::Vector{Float64}: Time points.q::Vector{Vector{Float64}}: Flattened position snapshots, one per time point.p::Vector{Vector{Float64}}: Flattened momentum snapshots, one per time point.prob::WeberProblem: The originating problem definition.retcode::Symbol::Successon normal completion,:Failureif the projection fixed-point failed to converge.regularization::RegularizationDiagnostics: Regularization usage statistics.
WeberElectrodynamics.SymmetricProjectionIntegrator — Type
SymmetricProjectionIntegrator(; relaxation=0.25)Symplectic integrator based on Strang-splitting with symmetric projection in extended phase space.
Implements the method of Jayawardana & Ohsawa (2021) for Weber's velocity-dependent Hamiltonian. The projection step solves a fixed-point iteration whose convergence is controlled by relaxation.
Keywords
relaxation=0.25: Fixed-point relaxation factor ω ∈ (0, 1]. Smaller values slow convergence but improve stability near close encounters.
Fields
relaxation::Float64: Stored relaxation factor.