GeometricSolutions
Documentation for GeometricSolutions.
GeometricSolutions.EnsembleSolutionGeometricSolutions.GeometricSolutionGeometricSolutions.arraysGeometricSolutions.compute_differenceGeometricSolutions.compute_error_driftGeometricSolutions.compute_invariantGeometricSolutions.compute_invariantGeometricSolutions.compute_invariant_errorGeometricSolutions.compute_invariant_errorGeometricSolutions.compute_momentum_errorGeometricSolutions.compute_one_formGeometricSolutions.compute_relative_errorGeometricSolutions.relative_maximum_error
GeometricSolutions.EnsembleSolution — Type
EnsembleSolution: Collection of solutions for an ensemble of geometric differential equations
Contains all fields necessary to store the solutions of an EnsembleProblem, which represents multiple instances of a geometric differential equation with different initial conditions and/or parameters. Each solution in the ensemble is stored as a GeometricSolution.
Fields
t: common time series shared across all solutions in the ensembles: vector ofGeometricSolutionobjects, one for each problem instanceproblem: the originalEnsembleProblem
Type Parameters
dType: data type for solution values (e.g.,Float64)tType: data type for time values (e.g.,Float64)sType: type of the solution vectorprobType: type of the ensemble problem
Constructor
EnsembleSolution(problem::EnsembleProblem, step::Int = 1)Creates an EnsembleSolution from an EnsembleProblem. The optional parameter step determines the intervals for storing each solution, i.e., if step > 1 only every step'th solution point is stored for each ensemble member.
Usage
An EnsembleSolution can be iterated over to access individual solutions:
for sol in ensemble_solution
# sol is a GeometricSolution
process_solution(sol)
endIndividual solutions can be accessed by index:
first_solution = ensemble_solution[1]
last_solution = ensemble_solution[end]The number of solutions in the ensemble:
n_solutions = nsamples(ensemble_solution)Convert all solutions to arrays for analysis:
solution_arrays = arrays(ensemble_solution)See Also
GeometricSolution: Individual solution typeEnsembleProblem: Ensemble problem typearrays: Convert solutions to arrays for analysisrelative_maximum_error: Compare ensemble solutions
GeometricSolutions.GeometricSolution — Type
GeometricSolution: Solution of a geometric differential equation
Contains all fields necessary to store the solution of a GeometricProblem.
Fields
t: time stepss: NamedTuple of DataSeries for each solution componentstep: store every step'th time step (default: 1)nstore: number of time steps to storeoffset: offset of current time step
Constructors
GeometricSolution(problem, step = 1)The usual way to initialise a Solution is by passing a GeometricEquations.EquationProblem, which can for example be an GeometricEquations.ODEProblem or GeometricEquations.PODEProblem. The optional parameter step determines the intervals for storing the solution, i.e., if step > 1 only every step'th solution is actually stored.
GeometricSolutions.arrays — Method
Convert solutions to arrays for analysis
GeometricSolutions.compute_difference — Method
Computes the difference of two DataSeries.
Arguments: (x::DataSeries{DT}, y::DataSeries{DT})
Returns a DataSeries similar to x and y holding the time series of the difference between x and y.
GeometricSolutions.compute_error_drift — Method
Computes the drift in an invariant error.
Arguments: (t::TimeSeries, invariant_error::DataSeries{T,1}, interval_length=100)
The time series of the solution is split into intervals of interval_length time steps. In each interval, the maximum of the absolute value of the invariant error is determined. Returns a tuple of a TimeSeries that holds the centers of all intervals and a ScalarDataSeries that holds the maxima.
This is useful to detect drifts in invariants that are not preserved exactly but whose error is oscillating such as the energy error of Hamiltonian systems with symplectic integrators.
GeometricSolutions.compute_invariant — Method
Compute an invariant for the solution of a partitioned ODE or DAE system.
Arguments: (t::TimeSeries, q::DataSeries{T}, p::DataSeries{T}, invariant::Base.Callable)
The invariant functions needs to take three arguments (t,q,p) and return the corresponding value of the invariant.
Returns a ScalarDataSeries holding the time series of the invariant.
GeometricSolutions.compute_invariant — Method
Compute an invariant for the solution of an ODE or DAE system.
Arguments: (t::TimeSeries, q::DataSeries{T}, invariant::Base.Callable)
The invariant functions needs to take two arguments (t,q) and return the corresponding value of the invariant.
Returns a ScalarDataSeries holding the time series of the invariant.
GeometricSolutions.compute_invariant_error — Method
Compute the relative error of an invariant for the solution of an ODE or DAE system.
Arguments: (t::TimeSeries, q::DataSeries{T}, invariant::Base.Callable)
The invariant functions needs to take two arguments (t,q) and return the corresponding value of the invariant.
Returns a tuple of two 1d DataSeries holding the time series of the invariant and the relativ error, respectively.
GeometricSolutions.compute_invariant_error — Method
Compute the relative error of an invariant for the solution of a partitioned ODE or DAE system.
Arguments: (t::TimeSeries, q::DataSeries{T}, p::DataSeries{T}, invariant::Base.Callable)
The invariant functions needs to take three arguments (t,q,p) and return the corresponding value of the invariant.
Returns a tuple of two ScalarDataSeries holding the time series of the invariant and the relativ error, respectively.
GeometricSolutions.compute_momentum_error — Method
Computes the difference of the momentum and the one-form of an implicit ODE or DAE system.
Arguments: (sol::GeometricSolution)
The problem type of the solution must be a subtype of IODEProblem, LODEProblem, IDAEProblem, or LDAEProblem.
Returns a DataSeries similar to sol.p holding the time series of the difference between the momentum and the one-form.
GeometricSolutions.compute_one_form — Method
Compute the one-form (symplectic potential) for the solution of a Lagrangian system.
Arguments: (sol::GeometricSolution)
The problem type of the solution must be a subtype of IODEProblem, LODEProblem, IDAEProblem, or LDAEProblem.
Returns a DataSeries similar to sol.p holding the time series of the one-form.
GeometricSolutions.compute_relative_error — Method
Takes a ScalarDataSeries holding an invariant and computes the relative error (inv(t)-inv(0))/inv(0).
Returns a ScalarDataSeries similar to the argument holding the time series of the relativ errors.
GeometricSolutions.relative_maximum_error — Method
Compute the relative maximum error between two ensemble solutions.