diff --git a/latest/.documenter-siteinfo.json b/latest/.documenter-siteinfo.json index 28aeab3..0295e8f 100644 --- a/latest/.documenter-siteinfo.json +++ b/latest/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.10.2","generation_timestamp":"2024-03-21T16:17:31","documenter_version":"1.3.0"}} \ No newline at end of file +{"documenter":{"julia_version":"1.10.2","generation_timestamp":"2024-03-21T19:41:45","documenter_version":"1.3.0"}} \ No newline at end of file diff --git a/latest/abc_flow/10b25f5b.svg b/latest/abc_flow/c0666aea.svg similarity index 93% rename from latest/abc_flow/10b25f5b.svg rename to latest/abc_flow/c0666aea.svg index bbf1c6c..e02a7c4 100644 --- a/latest/abc_flow/10b25f5b.svg +++ b/latest/abc_flow/c0666aea.svg @@ -1,59 +1,59 @@ - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/latest/abc_flow/index.html b/latest/abc_flow/index.html index 9abda8b..8214116 100644 --- a/latest/abc_flow/index.html +++ b/latest/abc_flow/index.html @@ -1,28 +1,16 @@ ABC Flow · GeometricProblems.jl

ABC Flow

The ABC flow (see [1]) is described by a divergence-free differential equation whose flow strongly depends on the initial condition.

using GeometricIntegrators: integrate, ImplicitMidpoint
 using GeometricProblems.ABCFlow
-using GeometricEquations: EnsembleProblem
-using GeometricSolutions: GeometricSolution
 using Plots
 
-ics1 = (q = [0., 0., 0.], )
-ics2 = (q = [0.5, 0., 0.], )
-ics3 = (q = [0.6, 0., 0.], )
-
-ensemble_problem = EnsembleProblem(odeproblem().equation, tspan, tstep, [ics1, ics2, ics3], default_parameters)
-ensemble_solution = integrate(ensemble_problem, ImplicitMidpoint())
-
-function plot_geometric_solution!(p::Plots.Plot, solution::GeometricSolution; kwargs...)
-    plot!(p, solution.q[:, 1], solution.q[:, 2], solution.q[:, 3]; kwargs...)
-end
+ensemble_solution = integrate(odeensemble(), ImplicitMidpoint())
 
 p = plot()
 for solution in ensemble_solution
-    plot_geometric_solution!(p, solution)
+    plot!(p, solution.q[:, 1], solution.q[:, 2], solution.q[:, 3])
 end
-
-p
Example block output

Library functions

GeometricProblems.ABCFlowModule

ABC Flow

\[\begin{aligned} +pExample block output

Library functions

GeometricProblems.ABCFlowModule

ABC Flow

\[\begin{aligned} \dot{x} = A\sin(z) + C\cos(y) \\ \dot{y} = B\sin(x) + A\cos(z) \\ \dot{z} = C\sin(y) + B\cos(x) -\end{aligned}\]

source
[1]
E. Hairer, C. Lubich and G. Wanner. Geometric Numerical integration: structure-preserving algorithms for ordinary differential equations (Springer, Berlin, 2006).
+\end{aligned}\]

source
[1]
E. Hairer, C. Lubich and G. Wanner. Geometric Numerical integration: structure-preserving algorithms for ordinary differential equations (Springer, Berlin, 2006).
diff --git a/latest/coupled_harmonic_oscillator/f9d225a7.svg b/latest/coupled_harmonic_oscillator/f9d225a7.svg deleted file mode 100644 index f835635..0000000 --- a/latest/coupled_harmonic_oscillator/f9d225a7.svg +++ /dev/null @@ -1,264 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/latest/coupled_harmonic_oscillator/index.html b/latest/coupled_harmonic_oscillator/index.html index 85096a0..155d0a8 100644 --- a/latest/coupled_harmonic_oscillator/index.html +++ b/latest/coupled_harmonic_oscillator/index.html @@ -1,14 +1,14 @@ -Coupled Harmonic Oscillator · GeometricProblems.jl

Coupled Harmonic Oscillator

This system describes two harmonic oscillators that are coupled nonlinearly.

The following shows the $q_1$ component of the system for different values of $k$:

n_param_sets = length(params_collection) #hide
Example block output

Library functions

GeometricProblems.CoupledHarmonicOscillatorModule
CoupledHarmonicOscillator

The CoupledHarmonicOscillator module provides functions hodeproblem and lodeproblem each returning a Hamiltonian or Lagrangian problem, respectively, to be solved in the GeometricIntegrators.jl ecosystem. The actual code is generated with EulerLagrange.jl.

The coupled harmonic oscillator is a collection of two point masses that are connected to a fixed wall with spring constants $k_1$ and $k_2$ and are furthermore coupled nonlinearly resulting in the Hamiltonian:

\[H(q_1, q_2, p_1, p_2) = \frac{q_1^2}{2m_1} + \frac{q_2^2}{2m_2} + k_1\frac{q_1^2}{2} + k_2\frac{q_2^2}{2} + k\sigma(q_1)\frac{(q_2 - q_1)^2}{2},\]

where $\sigma(x) = 1 / (1 + e^{-x})$ is the sigmoid activation function.

System parameters:

  • k₁: spring constant of mass 1
  • k₂: spring constant of mass 2
  • m₁: mass 1
  • m₂: mass 2
  • k: coupling strength between the two masses.
source
GeometricProblems.CoupledHarmonicOscillator.hodeproblemFunction
Hamiltonian problem for coupled oscillator

Constructor with default arguments:

hodeproblem(
+Coupled Harmonic Oscillator · GeometricProblems.jl

Coupled Harmonic Oscillator

This system describes two harmonic oscillators that are coupled nonlinearly.

Library functions

GeometricProblems.CoupledHarmonicOscillatorModule
CoupledHarmonicOscillator

The CoupledHarmonicOscillator module provides functions hodeproblem and lodeproblem each returning a Hamiltonian or Lagrangian problem, respectively, to be solved in the GeometricIntegrators.jl ecosystem. The actual code is generated with EulerLagrange.jl.

The coupled harmonic oscillator is a collection of two point masses that are connected to a fixed wall with spring constants $k_1$ and $k_2$ and are furthermore coupled nonlinearly resulting in the Hamiltonian:

\[H(q_1, q_2, p_1, p_2) = \frac{q_1^2}{2m_1} + \frac{q_2^2}{2m_2} + k_1\frac{q_1^2}{2} + k_2\frac{q_2^2}{2} + k\sigma(q_1)\frac{(q_2 - q_1)^2}{2},\]

where $\sigma(x) = 1 / (1 + e^{-x})$ is the sigmoid activation function.

System parameters:

  • k₁: spring constant of mass 1
  • k₂: spring constant of mass 2
  • m₁: mass 1
  • m₂: mass 2
  • k: coupling strength between the two masses.
source
GeometricProblems.CoupledHarmonicOscillator.hodeproblemFunction
Hamiltonian problem for coupled oscillator

Constructor with default arguments:

hodeproblem(
     q₀ = [1.0, 0.0],
     p₀ = [2.0, 0.0];
     tspan = (0.0, 100.0),
     tstep = 0.4,
     params = (m₁ = 2.0, m₂ = 1.0, k₁ = 1.5, k₂ = 0.3, k = 1.0)
-)
source
GeometricProblems.CoupledHarmonicOscillator.lodeproblemFunction
Lagrangian problem for the coupled oscillator

Constructor with default arguments:

lodeproblem(
     q₀ = [1.0, 0.0],
     p₀ = [2.0, 0.0];
     tspan = (0.0, 100.0),
     tstep = 0.4,
     params = (m₁ = 2.0, m₂ = 1.0, k₁ = 1.5, k₂ = 0.3, k = 1.0)
-)
source
+)
source
diff --git a/latest/diagnostics/index.html b/latest/diagnostics/index.html index f095400..d8661c9 100644 --- a/latest/diagnostics/index.html +++ b/latest/diagnostics/index.html @@ -1,2 +1,2 @@ -Diagnostics · GeometricProblems.jl

Diagnostics

GeometricProblems.Diagnostics.compute_error_driftMethod

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.

source
GeometricProblems.Diagnostics.compute_invariantMethod

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.

source
GeometricProblems.Diagnostics.compute_invariantMethod

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.

source
GeometricProblems.Diagnostics.compute_invariant_errorMethod

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.

source
GeometricProblems.Diagnostics.compute_invariant_errorMethod

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.

source
GeometricProblems.Diagnostics.compute_momentum_errorMethod

Computes the difference of the momentum and the one-form of an implicit ODE or DAE system.

Arguments: (p::DataSeries{DT}, ϑ::DataSeries{DT})

Returns a DataSeries similar to p holding the time series of the difference between p and ϑ.

source
GeometricProblems.Diagnostics.compute_one_formMethod

Compute the one-form (symplectic potential) for the solution of a Lagrangian system.

Arguments: (t::TimeSeries, q::DataSeries, one_form::Base.Callable)

The one_form function needs to take three arguments (t,q,k) where k is the index of the one-form component.

Returns a DataSeries similar to q holding the time series of the one-form.

source
+Diagnostics · GeometricProblems.jl

Diagnostics

GeometricProblems.Diagnostics.compute_error_driftMethod

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.

source
GeometricProblems.Diagnostics.compute_invariantMethod

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.

source
GeometricProblems.Diagnostics.compute_invariantMethod

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.

source
GeometricProblems.Diagnostics.compute_invariant_errorMethod

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.

source
GeometricProblems.Diagnostics.compute_invariant_errorMethod

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.

source
GeometricProblems.Diagnostics.compute_momentum_errorMethod

Computes the difference of the momentum and the one-form of an implicit ODE or DAE system.

Arguments: (p::DataSeries{DT}, ϑ::DataSeries{DT})

Returns a DataSeries similar to p holding the time series of the difference between p and ϑ.

source
GeometricProblems.Diagnostics.compute_one_formMethod

Compute the one-form (symplectic potential) for the solution of a Lagrangian system.

Arguments: (t::TimeSeries, q::DataSeries, one_form::Base.Callable)

The one_form function needs to take three arguments (t,q,k) where k is the index of the one-form component.

Returns a DataSeries similar to q holding the time series of the one-form.

source
diff --git a/latest/double_pendulum/index.html b/latest/double_pendulum/index.html index 3398118..b002b76 100644 --- a/latest/double_pendulum/index.html +++ b/latest/double_pendulum/index.html @@ -20,16 +20,16 @@ \end{align*}\]

the Hamiltonian can be obtained via the Legendre transform,

\[H = \sum_{i=1}^2 \dot{\theta}_i p_i - L ,\]

as

\[\begin{align*} H &= \frac{m_2 l_2^2 p^2_{\theta_1} + (m_1 + m_2) l_1^2 p^2_{\theta_2} - 2 m_2 l_1 l_2 p_{\theta_1} p_{\theta_2} \cos(\theta_1 - \theta_2)}{2 m_2 l_1^2 l_2^2 \left[ m_1 + m_2 \sin^2(\theta_1 - \theta_2) \right] } \\ & \qquad\qquad \vphantom{\frac{l}{l}} - g (m_1 + m_2) l_1 \cos\theta_1 - g m_2 l_2 \cos\theta_2 . -\end{align*}\]

Library functions

GeometricProblems.DoublePendulumModule
DoublePendulum

The DoublePendulum module provides functions hodeproblem and lodeproblem each returning a Hamiltonian or Lagrangian problem, respectively, to be solved in the GeometricIntegrators.jl ecosystem. The actual code is generated with EulerLagrange.jl.

The double pendulum consists of two pendula, one attached to the origin at $(x,y) = (0,0)$, and the second attached to the first. Each pendulum consists of a point mass $m_i$ attached to a massless rod of length $l_i$ with $i \in (1,2)$. The dynamics of the system is described in terms of the angles $\theta_i$ between the rods $l_i$ and the vertical axis $y$. All motion is assumed to be frictionless.

System parameters:

  • l₁: length of rod 1
  • l₂: length of rod 2
  • m₁: mass of pendulum 1
  • m₂: mass of pendulum 2
  • g: gravitational constant
source
GeometricProblems.DoublePendulum.hodeproblemFunction
Hamiltonian problem for the double pendulum

Constructor with default arguments:

hodeproblem(
+\end{align*}\]

Library functions

GeometricProblems.DoublePendulumModule
DoublePendulum

The DoublePendulum module provides functions hodeproblem and lodeproblem each returning a Hamiltonian or Lagrangian problem, respectively, to be solved in the GeometricIntegrators.jl ecosystem. The actual code is generated with EulerLagrange.jl.

The double pendulum consists of two pendula, one attached to the origin at $(x,y) = (0,0)$, and the second attached to the first. Each pendulum consists of a point mass $m_i$ attached to a massless rod of length $l_i$ with $i \in (1,2)$. The dynamics of the system is described in terms of the angles $\theta_i$ between the rods $l_i$ and the vertical axis $y$. All motion is assumed to be frictionless.

System parameters:

  • l₁: length of rod 1
  • l₂: length of rod 2
  • m₁: mass of pendulum 1
  • m₂: mass of pendulum 2
  • g: gravitational constant
source
GeometricProblems.DoublePendulum.hodeproblemFunction
Hamiltonian problem for the double pendulum

Constructor with default arguments:

hodeproblem(
     q₀ = [π/4, π/2],
     p₀ = [3.3321622036187746, 7.0685834705770345];
     tspan = (0.0, 10.0),
     tstep = 0.01,
     params = (l₁ = 2.0, l₂ = 3.0, m₁ = 1.0, m₂ = 2.0, g = 9.80665)
-)
source
GeometricProblems.DoublePendulum.lodeproblemFunction
Lagrangian problem for the double pendulum

Constructor with default arguments:

lodeproblem(
     q₀ = [π/4, π/2],
     p₀ = [3.3321622036187746, 7.0685834705770345];
     tspan = (0.0, 10.0),
     tstep = 0.01,
     params = (l₁ = 2.0, l₂ = 3.0, m₁ = 1.0, m₂ = 2.0, g = 9.80665)
-)
source
+)source diff --git a/latest/harmonic_oscillator/index.html b/latest/harmonic_oscillator/index.html index c45211a..8262b28 100644 --- a/latest/harmonic_oscillator/index.html +++ b/latest/harmonic_oscillator/index.html @@ -1,2 +1,2 @@ -Harmonic Oscillator · GeometricProblems.jl +Harmonic Oscillator · GeometricProblems.jl diff --git a/latest/henon_heiles/index.html b/latest/henon_heiles/index.html index a5eb706..f31896f 100644 --- a/latest/henon_heiles/index.html +++ b/latest/henon_heiles/index.html @@ -1,2 +1,2 @@ -Hénon-Heiles System · GeometricProblems.jl +Hénon-Heiles System · GeometricProblems.jl diff --git a/latest/index.html b/latest/index.html index aa8876e..11d2dfb 100644 --- a/latest/index.html +++ b/latest/index.html @@ -11,4 +11,4 @@ year={2020}, howpublished={\url{https://github.com/JuliaGNI/GeometricProblems.jl}}, doi={10.5281/zenodo.4285904} -}

Figure License

Copyright (c) Michael Kraus <michael.kraus@ipp.mpg.de>

All figures are licensed under the Creative Commons CC BY-NC-SA 4.0 License.

Software License

Copyright (c) Michael Kraus <michael.kraus@ipp.mpg.de>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+}

Figure License

Copyright (c) Michael Kraus <michael.kraus@ipp.mpg.de>

All figures are licensed under the Creative Commons CC BY-NC-SA 4.0 License.

Software License

Copyright (c) Michael Kraus <michael.kraus@ipp.mpg.de>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

diff --git a/latest/inner_solar_system/index.html b/latest/inner_solar_system/index.html index 032604e..9232a94 100644 --- a/latest/inner_solar_system/index.html +++ b/latest/inner_solar_system/index.html @@ -1,2 +1,2 @@ -Inner Solar System · GeometricProblems.jl +Inner Solar System · GeometricProblems.jl diff --git a/latest/kepler_problem/index.html b/latest/kepler_problem/index.html index 7bb1c3a..c31d7f0 100644 --- a/latest/kepler_problem/index.html +++ b/latest/kepler_problem/index.html @@ -1,2 +1,2 @@ -Kepler Problem · GeometricProblems.jl +Kepler Problem · GeometricProblems.jl diff --git a/latest/lorenz_attractor/index.html b/latest/lorenz_attractor/index.html index 2acbdca..2eb3c43 100644 --- a/latest/lorenz_attractor/index.html +++ b/latest/lorenz_attractor/index.html @@ -1,2 +1,2 @@ -Lorenz Attractor · GeometricProblems.jl +Lorenz Attractor · GeometricProblems.jl diff --git a/latest/lotka_volterra_2d.svg b/latest/lotka_volterra_2d.svg index aff1558..d2c824f 100644 --- a/latest/lotka_volterra_2d.svg +++ b/latest/lotka_volterra_2d.svg @@ -1,78 +1,78 @@ - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/latest/lotka_volterra_2d/index.html b/latest/lotka_volterra_2d/index.html index 05453e0..8d6ecb0 100644 --- a/latest/lotka_volterra_2d/index.html +++ b/latest/lotka_volterra_2d/index.html @@ -8,13 +8,13 @@ H (q) = a_1 \, q_1 + a_2 \, q_2 + b_1 \, \log q_1 + b_2 \, \log q_2 .\]

Sub-models

The Euler-Lagrange equations of the Lotka-Volterra model can be obtained from different Lagrangians, which are connected by gauge transformations. Although they all lead to the same equations of motion, they lead to different variational integrators. Therefore different models based on different Lagrangians are implemented.

GeometricProblems.LotkaVolterra2dModule

Lotka-Volterra model in 2D

\[\begin{aligned} L (q, \dot{q}) &= \bigg( q_2 + \frac{\log q_2}{q_1} \bigg) \, \dot{q_1} + q_1 \, \dot{q_2} - H(q) , \\ H(q) &= a_1 \, q_1 + a_2 \, q_2 + b_1 \, \log q_1 + b_2 \, \log q_2 -\end{aligned}\]

source
GeometricProblems.LotkaVolterra2dSymmetricModule

Lotka-Volterra model in 2D with symmetric Lagrangian

\[\begin{aligned} L (q, \dot{q}) &= \frac{1}{2} \frac{\log q_2}{q_1} \, \dot{q_1} - \frac{1}{2} \frac{\log q_1}{q_2} \, \dot{q_2} - H(q) , \\ H(q) &= a_1 \, q_1 + a_2 \, q_2 + b_1 \, \log q_1 + b_2 \, \log q_2 -\end{aligned}\]

This Lagrangian is a slight generalization of Equation (5) in José Fernández-Núñez, Lagrangian Structure of the Two-Dimensional Lotka-Volterra System, International Journal of Theoretical Physics, Vol. 37, No. 9, pp. 2457-2462, 1998.

source
GeometricProblems.LotkaVolterra2dSingularModule

Lotka-Volterra model in 2D with "singular" Lagrangian

\[\begin{aligned} +\end{aligned}\]

This Lagrangian is a slight generalization of Equation (5) in José Fernández-Núñez, Lagrangian Structure of the Two-Dimensional Lotka-Volterra System, International Journal of Theoretical Physics, Vol. 37, No. 9, pp. 2457-2462, 1998.

source
GeometricProblems.LotkaVolterra2dSingularModule

Lotka-Volterra model in 2D with "singular" Lagrangian

\[\begin{aligned} L (q, \dot{q}) &= \frac{\log q_2}{q_1} \, \dot{q_1} - H(q) , \\ H(q) &= a_1 \, q_1 + a_2 \, q_2 + b_1 \, \log q_1 + b_2 \, \log q_2 -\end{aligned}\]

This Lagrangian is equivalent to the Lagrangian of the symmetric Lotka-Volterra model. It differs only by a gauge transformation with the term $- 1/2 \, d(\log(q_1) \log(q_2))/dt$. It leads to the same Euler-Lagrange equations but to a different variational integrator.

source
GeometricProblems.LotkaVolterra2dGaugeModule

Lotka-Volterra model in 2D with symmetric Lagrangian with gauge term

\[\begin{aligned} +\end{aligned}\]

This Lagrangian is equivalent to the Lagrangian of the symmetric Lotka-Volterra model. It differs only by a gauge transformation with the term $- 1/2 \, d(\log(q_1) \log(q_2))/dt$. It leads to the same Euler-Lagrange equations but to a different variational integrator.

source
GeometricProblems.LotkaVolterra2dGaugeModule

Lotka-Volterra model in 2D with symmetric Lagrangian with gauge term

\[\begin{aligned} L (q, \dot{q}) &= \bigg( q_2 + \frac{1}{2} \frac{\log q_2}{q_1} \bigg) \, \dot{q_1} + \bigg( q_1 - \frac{1}{2} \frac{\log q_1}{q_2} \bigg) \, \dot{q_2} - H(q) , \\ H(q) &= a_1 \, q_1 + a_2 \, q_2 + b_1 \, \log q_1 + b_2 \, \log q_2 -\end{aligned}\]

This Lagrangian is equivalent to the Lagrangian of the symmetric Lotka-Volterra model. It differs only by a gauge transformation with the term $d(q_1 q_2)/dt$. It leads to the same Euler-Lagrange equations but to a different variational integrator.

source

User Functions

Plotting Functions

GeometricProblems.LotkaVolterra2dPlots.plot_lotka_volterra_2d!Method

Plots the solution of a 2D Lotka-Volterra model together with the energy error.

Arguments:

  • sol <: GeometricSolution
  • equ <: GeometricProblem

Keyword aguments:

  • nplot=1: plot every nplotth time step
  • xlims=:auto: xlims for solution plot
  • ylims=:auto: ylims for solution plot
  • latex=true: use LaTeX guides
source
GeometricProblems.LotkaVolterra2dPlots.plot_lotka_volterra_2d!Method

Plots the solution of a 2D Lotka-Volterra model together with the energy error.

Arguments:

  • sol <: GeometricSolution
  • equ <: GeometricProblem

Keyword aguments:

  • nplot=1: plot every nplotth time step
  • xlims=:auto: xlims for solution plot
  • ylims=:auto: ylims for solution plot
  • latex=true: use LaTeX guides
source
GeometricProblems.LotkaVolterra2dPlots.plot_lotka_volterra_2dMethod

Plots the solution of a 2D Lotka-Volterra model together with the energy error.

Arguments:

  • sol <: GeometricSolution
  • equ <: GeometricProblem

Keyword aguments:

  • nplot=1: plot every nplotth time step
  • xlims=:auto: xlims for solution plot
  • ylims=:auto: ylims for solution plot
  • latex=true: use LaTeX guides
source
+\end{aligned}\]

This Lagrangian is equivalent to the Lagrangian of the symmetric Lotka-Volterra model. It differs only by a gauge transformation with the term $d(q_1 q_2)/dt$. It leads to the same Euler-Lagrange equations but to a different variational integrator.

source

User Functions

Plotting Functions

GeometricProblems.LotkaVolterra2dPlots.plot_lotka_volterra_2d!Method

Plots the solution of a 2D Lotka-Volterra model together with the energy error.

Arguments:

  • sol <: GeometricSolution
  • equ <: GeometricProblem

Keyword aguments:

  • nplot=1: plot every nplotth time step
  • xlims=:auto: xlims for solution plot
  • ylims=:auto: ylims for solution plot
  • latex=true: use LaTeX guides
source
GeometricProblems.LotkaVolterra2dPlots.plot_lotka_volterra_2d!Method

Plots the solution of a 2D Lotka-Volterra model together with the energy error.

Arguments:

  • sol <: GeometricSolution
  • equ <: GeometricProblem

Keyword aguments:

  • nplot=1: plot every nplotth time step
  • xlims=:auto: xlims for solution plot
  • ylims=:auto: ylims for solution plot
  • latex=true: use LaTeX guides
source
GeometricProblems.LotkaVolterra2dPlots.plot_lotka_volterra_2dMethod

Plots the solution of a 2D Lotka-Volterra model together with the energy error.

Arguments:

  • sol <: GeometricSolution
  • equ <: GeometricProblem

Keyword aguments:

  • nplot=1: plot every nplotth time step
  • xlims=:auto: xlims for solution plot
  • ylims=:auto: ylims for solution plot
  • latex=true: use LaTeX guides
source
diff --git a/latest/lotka_volterra_3d/index.html b/latest/lotka_volterra_3d/index.html index a3a79ac..121208d 100644 --- a/latest/lotka_volterra_3d/index.html +++ b/latest/lotka_volterra_3d/index.html @@ -7,4 +7,4 @@ 0 & - q_{1} q_{2} & \hphantom{-} q_{1} q_{3} \\ \hphantom{-} q_{1} q_{2} & 0 & - q_{2} q_{3} \\ - q_{1} q_{3} & \hphantom{-} q_{2} q_{3} & 0 \\ -\end{pmatrix} ,\]

and Hamiltonian

\[H(q) = a_{1} q_{1} + a_{2} q_{2} + a_{3} q_{3} + b_{1} \ln q_{1} + b_{2} \ln q_{2} + b_{3} \ln q_{3} .\]

References:

  • A. M. Perelomov. Selected topics on classical integrable systems, Troisième cycle de la physique, expanded version of lectures delivered in May 1995.

  • Yuri B. Suris. Integrable discretizations for lattice systems: local equations of motion and their Hamiltonian properties, Rev. Math. Phys. 11, pp. 727–822, 1999.

source +\end{pmatrix} ,\]

and Hamiltonian

\[H(q) = a_{1} q_{1} + a_{2} q_{2} + a_{3} q_{3} + b_{1} \ln q_{1} + b_{2} \ln q_{2} + b_{3} \ln q_{3} .\]

References:

  • A. M. Perelomov. Selected topics on classical integrable systems, Troisième cycle de la physique, expanded version of lectures delivered in May 1995.

  • Yuri B. Suris. Integrable discretizations for lattice systems: local equations of motion and their Hamiltonian properties, Rev. Math. Phys. 11, pp. 727–822, 1999.

source diff --git a/latest/lotka_volterra_4d/index.html b/latest/lotka_volterra_4d/index.html index 957ea5f..3166322 100644 --- a/latest/lotka_volterra_4d/index.html +++ b/latest/lotka_volterra_4d/index.html @@ -1,2 +1,2 @@ -Lotka-Volterra 4d · GeometricProblems.jl +Lotka-Volterra 4d · GeometricProblems.jl diff --git a/latest/massless_charged_particle.svg b/latest/massless_charged_particle.svg index fc30cd4..08593c8 100644 --- a/latest/massless_charged_particle.svg +++ b/latest/massless_charged_particle.svg @@ -1,74 +1,74 @@ - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/latest/massless_charged_particle/index.html b/latest/massless_charged_particle/index.html index 40ed701..4b386e9 100644 --- a/latest/massless_charged_particle/index.html +++ b/latest/massless_charged_particle/index.html @@ -8,4 +8,4 @@ \end{aligned}\]

The Hamiltonian form of the equations of motion reads

\[\dot{x} = \frac{1}{B(x)} \begin{pmatrix} \hphantom{-} 0 & + 1 \\ - 1 & \hphantom{+} 0 \\ -\end{pmatrix} \nabla \phi (x) .\]

source

+\end{pmatrix} \nabla \phi (x) .\]

source

diff --git a/latest/nonlinear_oscillators/index.html b/latest/nonlinear_oscillators/index.html index 7683fa1..b8f0823 100644 --- a/latest/nonlinear_oscillators/index.html +++ b/latest/nonlinear_oscillators/index.html @@ -1,2 +1,2 @@ -Nonlinear Oscillators · GeometricProblems.jl +Nonlinear Oscillators · GeometricProblems.jl diff --git a/latest/objects.inv b/latest/objects.inv index 2599bde..07811d7 100644 Binary files a/latest/objects.inv and b/latest/objects.inv differ diff --git a/latest/outer_solar_system/index.html b/latest/outer_solar_system/index.html index f721db4..cdeeb40 100644 --- a/latest/outer_solar_system/index.html +++ b/latest/outer_solar_system/index.html @@ -1,2 +1,2 @@ -Outer Solar System · GeometricProblems.jl +Outer Solar System · GeometricProblems.jl diff --git a/latest/pendulum/index.html b/latest/pendulum/index.html index 7e355f0..01cea52 100644 --- a/latest/pendulum/index.html +++ b/latest/pendulum/index.html @@ -1,2 +1,2 @@ -Mathematical Pendulum · GeometricProblems.jl +Mathematical Pendulum · GeometricProblems.jl diff --git a/latest/point_vortices/index.html b/latest/point_vortices/index.html index 48ddf1b..6eba326 100644 --- a/latest/point_vortices/index.html +++ b/latest/point_vortices/index.html @@ -1,2 +1,2 @@ -Point Vortices · GeometricProblems.jl +Point Vortices · GeometricProblems.jl diff --git a/latest/releasenotes/index.html b/latest/releasenotes/index.html index b8a2b17..bec59b8 100644 --- a/latest/releasenotes/index.html +++ b/latest/releasenotes/index.html @@ -1,2 +1,2 @@ -Release Notes · GeometricProblems.jl

Release Notes

0.1.1

New Features

  • Poincaré invariants for Lotka-Volterra 2d model
  • More equation types for massless charged particle

Fixes

  • Fixes in general plot recipes

0.1.0

Initial release with equations for

  • Exponential Growth,
  • Lorenz Attractor in 3D,
  • Lotka-Volterra in 2D,
  • Lotka-Volterra in 3D,
  • Lotka-Volterra in 4D,
  • Massless Charged Particle,
  • Harmonic Oscillator,
  • Mathematical Pendulum,
  • Planar Point Vortices.
+Release Notes · GeometricProblems.jl

Release Notes

0.1.1

New Features

  • Poincaré invariants for Lotka-Volterra 2d model
  • More equation types for massless charged particle

Fixes

  • Fixes in general plot recipes

0.1.0

Initial release with equations for

  • Exponential Growth,
  • Lorenz Attractor in 3D,
  • Lotka-Volterra in 2D,
  • Lotka-Volterra in 3D,
  • Lotka-Volterra in 4D,
  • Massless Charged Particle,
  • Harmonic Oscillator,
  • Mathematical Pendulum,
  • Planar Point Vortices.
diff --git a/latest/search_index.js b/latest/search_index.js index b8a74c0..55a72c8 100644 --- a/latest/search_index.js +++ b/latest/search_index.js @@ -1,3 +1,3 @@ var documenterSearchIndex = {"docs": -[{"location":"double_pendulum/#Double-Pendulum","page":"Double Pendulum","title":"Double Pendulum","text":"","category":"section"},{"location":"double_pendulum/","page":"Double Pendulum","title":"Double Pendulum","text":"The double pendulum consists of two pendula, one attached to the origin at (xy) = (00), and the second attached to the first. Each pendulum consists of a point mass m_i attached to a massless rod of length l_i with i in (12). All motion is assumed to be frictionless.","category":"page"},{"location":"double_pendulum/","page":"Double Pendulum","title":"Double Pendulum","text":"HTML(\"\"\"\"\"\") # hide","category":"page"},{"location":"double_pendulum/","page":"Double Pendulum","title":"Double Pendulum","text":"HTML(\"\"\"\"\"\") # hide","category":"page"},{"location":"double_pendulum/","page":"Double Pendulum","title":"Double Pendulum","text":"The dynamics of the system is most naturally described in terms of the angles theta_i between the rods l_i and the vertical axis y. In terms of these angles, the cartesian coordinates are given by","category":"page"},{"location":"double_pendulum/","page":"Double Pendulum","title":"Double Pendulum","text":"beginalign*\nx_1 = l_1 sintheta_1 \nx_2 = l_1 sintheta_1 + l_2 sintheta_2 \ny_1 = - l_1 costheta_1 \ny_2 = -l_1 costheta_1 - l_2 costheta_2 \nendalign*","category":"page"},{"location":"double_pendulum/","page":"Double Pendulum","title":"Double Pendulum","text":"In terms of the generalized coordinates theta_i, the Lagrangian reads","category":"page"},{"location":"double_pendulum/","page":"Double Pendulum","title":"Double Pendulum","text":"beginalign*\nL (theta_1 theta_2 dottheta_1 dottheta_2)\n = frac12 (m_1 + m_2) l_1^2 dottheta_1^2 \n + frac12 m_2 l_2^2 dottheta_2^2\n + m_2 l_1 l_2 dottheta_1 dottheta_2 cos(theta_1 - theta_2) \n + g (m_1 + m_2) l_1 costheta_1\n + g m_2 l_2 costheta_2 \nendalign*","category":"page"},{"location":"double_pendulum/","page":"Double Pendulum","title":"Double Pendulum","text":"The canonical conjugate momenta p_i are obtained from the Lagrangian as","category":"page"},{"location":"double_pendulum/","page":"Double Pendulum","title":"Double Pendulum","text":"beginalign*\np_1 = fracpartial Lpartial dottheta_1 = (m_1 + m_2) l_1^2 dottheta_1 + m_2 l_1 l_2 dottheta_2 cos(theta_1 - theta_2) \np_2 = fracpartial Lpartial dottheta_2 = m_2 l_2^2 dottheta_2 + m_2 l_1 l_2 dottheta_1 cos(theta_1 - theta_2) \nendalign*","category":"page"},{"location":"double_pendulum/","page":"Double Pendulum","title":"Double Pendulum","text":"After solving these relations for the generalized velocities dottheta_i,","category":"page"},{"location":"double_pendulum/","page":"Double Pendulum","title":"Double Pendulum","text":"beginalign*\ndottheta_1 = fracl_2 p_theta_1 - l_1 p_theta_2 cos(theta_1 - theta_2)l_1^2 l_2 left m_1 + m_2 sin^2(theta_1 - theta_2) right \ndottheta_2 = frac(m_1 + m_2) l_1 p_theta_2 - m_2 l_2 p_theta_1 cos(theta_1 - theta_2)m_2 l_1 l_2^2 left m_1 + m_2 sin^2 (theta_1 - theta_2) right \nendalign*","category":"page"},{"location":"double_pendulum/","page":"Double Pendulum","title":"Double Pendulum","text":"the Hamiltonian can be obtained via the Legendre transform,","category":"page"},{"location":"double_pendulum/","page":"Double Pendulum","title":"Double Pendulum","text":"H = sum_i=1^2 dottheta_i p_i - L ","category":"page"},{"location":"double_pendulum/","page":"Double Pendulum","title":"Double Pendulum","text":"as","category":"page"},{"location":"double_pendulum/","page":"Double Pendulum","title":"Double Pendulum","text":"beginalign*\nH = fracm_2 l_2^2 p^2_theta_1 + (m_1 + m_2) l_1^2 p^2_theta_2 - 2 m_2 l_1 l_2 p_theta_1 p_theta_2 cos(theta_1 - theta_2)2 m_2 l_1^2 l_2^2 left m_1 + m_2 sin^2(theta_1 - theta_2) right \n qquadqquad vphantomfracll - g (m_1 + m_2) l_1 costheta_1 - g m_2 l_2 costheta_2 \nendalign*","category":"page"},{"location":"double_pendulum/#Library-functions","page":"Double Pendulum","title":"Library functions","text":"","category":"section"},{"location":"double_pendulum/","page":"Double Pendulum","title":"Double Pendulum","text":"GeometricProblems.DoublePendulum","category":"page"},{"location":"double_pendulum/#GeometricProblems.DoublePendulum","page":"Double Pendulum","title":"GeometricProblems.DoublePendulum","text":"DoublePendulum\n\nThe DoublePendulum module provides functions hodeproblem and lodeproblem each returning a Hamiltonian or Lagrangian problem, respectively, to be solved in the GeometricIntegrators.jl ecosystem. The actual code is generated with EulerLagrange.jl.\n\nThe double pendulum consists of two pendula, one attached to the origin at (xy) = (00), and the second attached to the first. Each pendulum consists of a point mass m_i attached to a massless rod of length l_i with i in (12). The dynamics of the system is described in terms of the angles theta_i between the rods l_i and the vertical axis y. All motion is assumed to be frictionless.\n\nSystem parameters:\n\nl₁: length of rod 1\nl₂: length of rod 2\nm₁: mass of pendulum 1\nm₂: mass of pendulum 2\ng: gravitational constant\n\n\n\n\n\n","category":"module"},{"location":"double_pendulum/","page":"Double Pendulum","title":"Double Pendulum","text":"Modules = [GeometricProblems.DoublePendulum]\nOrder = [:constant, :type, :macro, :function]","category":"page"},{"location":"double_pendulum/#GeometricProblems.DoublePendulum.hodeproblem","page":"Double Pendulum","title":"GeometricProblems.DoublePendulum.hodeproblem","text":"Hamiltonian problem for the double pendulum\n\nConstructor with default arguments:\n\nhodeproblem(\n q₀ = [π/4, π/2],\n p₀ = [3.3321622036187746, 7.0685834705770345];\n tspan = (0.0, 10.0),\n tstep = 0.01,\n params = (l₁ = 2.0, l₂ = 3.0, m₁ = 1.0, m₂ = 2.0, g = 9.80665)\n)\n\n\n\n\n\n","category":"function"},{"location":"double_pendulum/#GeometricProblems.DoublePendulum.lodeproblem","page":"Double Pendulum","title":"GeometricProblems.DoublePendulum.lodeproblem","text":"Lagrangian problem for the double pendulum\n\nConstructor with default arguments:\n\nlodeproblem(\n q₀ = [π/4, π/2],\n p₀ = [3.3321622036187746, 7.0685834705770345];\n tspan = (0.0, 10.0),\n tstep = 0.01,\n params = (l₁ = 2.0, l₂ = 3.0, m₁ = 1.0, m₂ = 2.0, g = 9.80665)\n)\n\n\n\n\n\n","category":"function"},{"location":"coupled_harmonic_oscillator/#Coupled-Harmonic-Oscillator","page":"Coupled Harmonic Oscillator","title":"Coupled Harmonic Oscillator","text":"","category":"section"},{"location":"coupled_harmonic_oscillator/","page":"Coupled Harmonic Oscillator","title":"Coupled Harmonic Oscillator","text":"This system describes two harmonic oscillators that are coupled nonlinearly. ","category":"page"},{"location":"coupled_harmonic_oscillator/","page":"Coupled Harmonic Oscillator","title":"Coupled Harmonic Oscillator","text":"HTML(\"\"\"\"\"\") # hide","category":"page"},{"location":"coupled_harmonic_oscillator/","page":"Coupled Harmonic Oscillator","title":"Coupled Harmonic Oscillator","text":"HTML(\"\"\"\"\"\") # hide","category":"page"},{"location":"coupled_harmonic_oscillator/","page":"Coupled Harmonic Oscillator","title":"Coupled Harmonic Oscillator","text":"The following shows the q_1 component of the system for different values of k: ","category":"page"},{"location":"coupled_harmonic_oscillator/","page":"Coupled Harmonic Oscillator","title":"Coupled Harmonic Oscillator","text":"using GeometricIntegrators: integrate, ImplicitMidpoint # hide\nusing GeometricProblems.CoupledHarmonicOscillator: hodeproblem, default_parameters, tspan, tstep, q₀, p₀ # hide\nusing GeometricEquations: EnsembleProblem # hide\nusing GeometricMachineLearning: DataLoader # hide\nusing Plots # hide\n # hide\nconst m₁ = default_parameters.m₁ # hide\nconst m₂ = default_parameters.m₂ # hide\nconst k₁ = default_parameters.k₁ # hide\nconst k₂ = default_parameters.k₂ # hide\nconst k = [0.0, 0.5, 0.75, 1.0, 2.0, 3.0, 4.0] # hide\n # hide\nparams_collection = [(m₁ = m₁, m₂ = m₂, k₁ = k₁, k₂ = k₂, k = k_val) for k_val in k] # hide\nensemble_problem = EnsembleProblem(hodeproblem().equation, tspan, tstep, (q = q₀, p = p₀), params_collection) # hide\nensemble_solution = integrate(ensemble_problem, ImplicitMidpoint()) # hide\n # hide\ndl = DataLoader(ensemble_solution) # hide\nq₁ = dl.input.q[1, :, :] # hide\nh = tspan[2] / (size(q₁, 1) - 1) # hide\nt = 0.0:h:tspan[2] # hide\nn_param_sets = length(params_collection) #hide \nlabels = reshape([\"k = \"*string(params.k) for params in params_collection], 1, n_param_sets) # hide\n # hide\nconst one_plot = false # hide\nconst psize = (900, 600) # hide\nplot_q₁ = one_plot ? plot(t, q₁, size=psize) : plot(t, q₁, layout=(n_param_sets, 1), size=psize, label=labels, legend=:topright) # hide","category":"page"},{"location":"coupled_harmonic_oscillator/#Library-functions","page":"Coupled Harmonic Oscillator","title":"Library functions","text":"","category":"section"},{"location":"coupled_harmonic_oscillator/","page":"Coupled Harmonic Oscillator","title":"Coupled Harmonic Oscillator","text":"GeometricProblems.CoupledHarmonicOscillator","category":"page"},{"location":"coupled_harmonic_oscillator/#GeometricProblems.CoupledHarmonicOscillator","page":"Coupled Harmonic Oscillator","title":"GeometricProblems.CoupledHarmonicOscillator","text":"CoupledHarmonicOscillator\n\nThe CoupledHarmonicOscillator module provides functions hodeproblem and lodeproblem each returning a Hamiltonian or Lagrangian problem, respectively, to be solved in the GeometricIntegrators.jl ecosystem. The actual code is generated with EulerLagrange.jl.\n\nThe coupled harmonic oscillator is a collection of two point masses that are connected to a fixed wall with spring constants k_1 and k_2 and are furthermore coupled nonlinearly resulting in the Hamiltonian: \n\nH(q_1 q_2 p_1 p_2) = fracq_1^22m_1 + fracq_2^22m_2 + k_1fracq_1^22 + k_2fracq_2^22 + ksigma(q_1)frac(q_2 - q_1)^22\n\nwhere sigma(x) = 1 (1 + e^-x) is the sigmoid activation function. \n\nSystem parameters:\n\nk₁: spring constant of mass 1\nk₂: spring constant of mass 2\nm₁: mass 1\nm₂: mass 2\nk: coupling strength between the two masses. \n\n\n\n\n\n","category":"module"},{"location":"coupled_harmonic_oscillator/","page":"Coupled Harmonic Oscillator","title":"Coupled Harmonic Oscillator","text":"Modules = [GeometricProblems.CoupledHarmonicOscillator]\nOrder = [:constant, :type, :macro, :function]","category":"page"},{"location":"coupled_harmonic_oscillator/#GeometricProblems.CoupledHarmonicOscillator.hodeproblem","page":"Coupled Harmonic Oscillator","title":"GeometricProblems.CoupledHarmonicOscillator.hodeproblem","text":"Hamiltonian problem for coupled oscillator\n\nConstructor with default arguments:\n\nhodeproblem(\n q₀ = [1.0, 0.0],\n p₀ = [2.0, 0.0];\n tspan = (0.0, 100.0),\n tstep = 0.4,\n params = (m₁ = 2.0, m₂ = 1.0, k₁ = 1.5, k₂ = 0.3, k = 1.0)\n)\n\n\n\n\n\n","category":"function"},{"location":"coupled_harmonic_oscillator/#GeometricProblems.CoupledHarmonicOscillator.lodeproblem","page":"Coupled Harmonic Oscillator","title":"GeometricProblems.CoupledHarmonicOscillator.lodeproblem","text":"Lagrangian problem for the coupled oscillator\n\nConstructor with default arguments:\n\nlodeproblem(\n q₀ = [1.0, 0.0],\n p₀ = [2.0, 0.0];\n tspan = (0.0, 100.0),\n tstep = 0.4,\n params = (m₁ = 2.0, m₂ = 1.0, k₁ = 1.5, k₂ = 0.3, k = 1.0)\n)\n\n\n\n\n\n","category":"function"},{"location":"abc_flow/#ABC-Flow","page":"ABC Flow","title":"ABC Flow","text":"","category":"section"},{"location":"abc_flow/","page":"ABC Flow","title":"ABC Flow","text":"The ABC flow (see [1]) is described by a divergence-free differential equation whose flow strongly depends on the initial condition. ","category":"page"},{"location":"abc_flow/","page":"ABC Flow","title":"ABC Flow","text":"using GeometricIntegrators: integrate, ImplicitMidpoint\nusing GeometricProblems.ABCFlow\nusing GeometricEquations: EnsembleProblem\nusing GeometricSolutions: GeometricSolution\nusing Plots\n\nics1 = (q = [0., 0., 0.], )\nics2 = (q = [0.5, 0., 0.], )\nics3 = (q = [0.6, 0., 0.], )\n\nensemble_problem = EnsembleProblem(odeproblem().equation, tspan, tstep, [ics1, ics2, ics3], default_parameters)\nensemble_solution = integrate(ensemble_problem, ImplicitMidpoint())\n\nfunction plot_geometric_solution!(p::Plots.Plot, solution::GeometricSolution; kwargs...)\n plot!(p, solution.q[:, 1], solution.q[:, 2], solution.q[:, 3]; kwargs...)\nend\n\np = plot()\nfor solution in ensemble_solution\n plot_geometric_solution!(p, solution)\nend\n\np","category":"page"},{"location":"abc_flow/#Library-functions","page":"ABC Flow","title":"Library functions","text":"","category":"section"},{"location":"abc_flow/","page":"ABC Flow","title":"ABC Flow","text":"GeometricProblems.ABCFlow","category":"page"},{"location":"abc_flow/#GeometricProblems.ABCFlow","page":"ABC Flow","title":"GeometricProblems.ABCFlow","text":"ABC Flow\n\nbeginaligned\n dotx = Asin(z) + Ccos(y) \n doty = Bsin(x) + Acos(z) \n dotz = Csin(y) + Bcos(x)\nendaligned\n\n\n\n\n\n","category":"module"},{"location":"abc_flow/","page":"ABC Flow","title":"ABC Flow","text":"Modules = [GeometricProblems.ABCFlow]\nOrder = [:constant, :type, :macro, :function]","category":"page"},{"location":"abc_flow/","page":"ABC Flow","title":"ABC Flow","text":"E. Hairer, C. Lubich and G. Wanner. Geometric Numerical integration: structure-preserving algorithms for ordinary differential equations (Springer, Berlin, 2006).\n\n\n\n","category":"page"},{"location":"lotka_volterra_4d/#Lotka-Volterra-4d","page":"Lotka-Volterra 4d","title":"Lotka-Volterra 4d","text":"","category":"section"},{"location":"lotka_volterra_4d/","page":"Lotka-Volterra 4d","title":"Lotka-Volterra 4d","text":"Modules = [GeometricProblems.LotkaVolterra4d]\nOrder = [:constant, :type, :macro, :function]","category":"page"},{"location":"massless_charged_particle/#Massless-Charged-Particle","page":"Massless Charged Particle","title":"Massless Charged Particle","text":"","category":"section"},{"location":"massless_charged_particle/","page":"Massless Charged Particle","title":"Massless Charged Particle","text":"GeometricProblems.MasslessChargedParticle","category":"page"},{"location":"massless_charged_particle/#GeometricProblems.MasslessChargedParticle","page":"Massless Charged Particle","title":"GeometricProblems.MasslessChargedParticle","text":"Massless charged particle in 2D\n\nThe Lagrangian is given by\n\nL(x dotx) = A(x) cdot dotx - phi (x) \n\nwith magnetic vector potential\n\nA(x) = fracA_02 big( 1 + x_1^2 + x_2^2 big) beginpmatrix\n- x_2 \n+ x_1 \nendpmatrix \n\nelectrostatic potential\n\nphi(x) = E_0 big( cos (x_1) + sin(x_2) big) \n\nand magnetic and electric fields\n\nbeginaligned\nB(x) = nabla times A(x) = A_0 (1 + 2 x_1^2 + 2 x_2^2) \nE(x) = - nabla phi(x) = E_0 big( sin x_1 - cos x_2 big)^T \nendaligned\n\nThe Hamiltonian form of the equations of motion reads\n\ndotx = frac1B(x) beginpmatrix\nhphantom- 0 + 1 \n- 1 hphantom+ 0 \nendpmatrix nabla phi (x) \n\n\n\n\n\n","category":"module"},{"location":"massless_charged_particle/","page":"Massless Charged Particle","title":"Massless Charged Particle","text":"using Plots\nusing GeometricIntegrators\nusing GeometricProblems.MasslessChargedParticle\nusing GeometricProblems.MasslessChargedParticlePlots\n\node = massless_charged_particle_ode()\nsol = integrate(ode, Gauss(1))\n\nplot_massless_charged_particle(sol, ode)\nsavefig(\"massless_charged_particle.svg\")\n\nnothing","category":"page"},{"location":"massless_charged_particle/","page":"Massless Charged Particle","title":"Massless Charged Particle","text":"(Image: )","category":"page"},{"location":"massless_charged_particle/","page":"Massless Charged Particle","title":"Massless Charged Particle","text":"Modules = [GeometricProblems.MasslessChargedParticle]\nOrder = [:constant, :type, :macro, :function]","category":"page"},{"location":"massless_charged_particle/#GeometricProblems.MasslessChargedParticle.massless_charged_particle_idae","page":"Massless Charged Particle","title":"GeometricProblems.MasslessChargedParticle.massless_charged_particle_idae","text":"Creates an implicit DAE object for the massless charged particle in 2D.\n\n\n\n\n\n","category":"function"},{"location":"massless_charged_particle/#GeometricProblems.MasslessChargedParticle.massless_charged_particle_idae_spark","page":"Massless Charged Particle","title":"GeometricProblems.MasslessChargedParticle.massless_charged_particle_idae_spark","text":"Creates an implicit DAE object for the massless charged particle in 2D.\n\n\n\n\n\n","category":"function"},{"location":"massless_charged_particle/#GeometricProblems.MasslessChargedParticle.massless_charged_particle_iode","page":"Massless Charged Particle","title":"GeometricProblems.MasslessChargedParticle.massless_charged_particle_iode","text":"Creates an implicit ODE object for the massless charged particle in 2D.\n\n\n\n\n\n","category":"function"},{"location":"massless_charged_particle/#GeometricProblems.MasslessChargedParticle.massless_charged_particle_ode","page":"Massless Charged Particle","title":"GeometricProblems.MasslessChargedParticle.massless_charged_particle_ode","text":"Creates an ODE object for the massless charged particle in 2D.\n\n\n\n\n\n","category":"function"},{"location":"lotka_volterra_3d/#Lotka-Volterra-3d","page":"Lotka-Volterra 3d","title":"Lotka-Volterra 3d","text":"","category":"section"},{"location":"lotka_volterra_3d/","page":"Lotka-Volterra 3d","title":"Lotka-Volterra 3d","text":"GeometricProblems.LotkaVolterra3d","category":"page"},{"location":"lotka_volterra_3d/#GeometricProblems.LotkaVolterra3d","page":"Lotka-Volterra 3d","title":"GeometricProblems.LotkaVolterra3d","text":"Lotka-Volterra Model in 3D\n\nThe Lotka–Volterra model in 3D is an example of a Hamiltonian system with degenerate Poisson structure.\n\nThe equations read\n\nbeginaligned\ndotq_1 = q_1 ( - a_2 q_2 + a_3 q_3 - b_2 + b_3 ) \ndotq_2 = q_2 ( hphantom- a_1 q_1 - a_3 q_3 + b_1 - b_3 ) \ndotq_3 = q_3 ( - a_1 q_1 + a_2 q_2 - b_1 + b_2 ) \nendaligned\n\nwhich can be written in Poisson-form as\n\ndotq = P(q) nabla H(q) \n\nwith Poisson matrix\n\nP(q) = beginpmatrix\n 0 - q_1 q_2 hphantom- q_1 q_3 \nhphantom- q_1 q_2 0 - q_2 q_3 \n- q_1 q_3 hphantom- q_2 q_3 0 \nendpmatrix \n\nand Hamiltonian\n\nH(q) = a_1 q_1 + a_2 q_2 + a_3 q_3 + b_1 ln q_1 + b_2 ln q_2 + b_3 ln q_3 \n\nReferences:\n\nA. M. Perelomov. Selected topics on classical integrable systems, Troisième cycle de la physique, expanded version of lectures delivered in May 1995.\nYuri B. Suris. Integrable discretizations for lattice systems: local equations of motion and their Hamiltonian properties, Rev. Math. Phys. 11, pp. 727–822, 1999.\n\n\n\n\n\n","category":"module"},{"location":"lotka_volterra_3d/","page":"Lotka-Volterra 3d","title":"Lotka-Volterra 3d","text":"Modules = [GeometricProblems.LotkaVolterra3d]\nOrder = [:constant, :type, :macro, :function]","category":"page"},{"location":"diagnostics/#Diagnostics","page":"Diagnostics","title":"Diagnostics","text":"","category":"section"},{"location":"diagnostics/","page":"Diagnostics","title":"Diagnostics","text":"Modules = [GeometricProblems.Diagnostics]\nOrder = [:constant, :type, :macro, :function]","category":"page"},{"location":"diagnostics/#GeometricProblems.Diagnostics.compute_error_drift-Union{Tuple{T}, Tuple{GeometricSolutions.TimeSeries, GeometricSolutions.ScalarDataSeries{T}}, Tuple{GeometricSolutions.TimeSeries, GeometricSolutions.ScalarDataSeries{T}, Any}} where T","page":"Diagnostics","title":"GeometricProblems.Diagnostics.compute_error_drift","text":"Computes the drift in an invariant error.\n\nArguments: (t::TimeSeries, invariant_error::DataSeries{T,1}, interval_length=100)\n\nThe 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.\n\nThis 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.\n\n\n\n\n\n","category":"method"},{"location":"diagnostics/#GeometricProblems.Diagnostics.compute_invariant-Union{Tuple{T}, Tuple{GeometricSolutions.TimeSeries, GeometricSolutions.DataSeries{T, AT} where AT<:Union{AbstractArray{T}, T}, GeometricSolutions.DataSeries{T, AT} where AT<:Union{AbstractArray{T}, T}, Union{Function, Type}}} where T","page":"Diagnostics","title":"GeometricProblems.Diagnostics.compute_invariant","text":"Compute an invariant for the solution of a partitioned ODE or DAE system.\n\nArguments: (t::TimeSeries, q::DataSeries{T}, p::DataSeries{T}, invariant::Base.Callable)\n\nThe invariant functions needs to take three arguments (t,q,p) and return the corresponding value of the invariant.\n\nReturns a ScalarDataSeries holding the time series of the invariant.\n\n\n\n\n\n","category":"method"},{"location":"diagnostics/#GeometricProblems.Diagnostics.compute_invariant-Union{Tuple{T}, Tuple{GeometricSolutions.TimeSeries, GeometricSolutions.DataSeries{T, AT} where AT<:Union{AbstractArray{T}, T}, Union{Function, Type}}} where T","page":"Diagnostics","title":"GeometricProblems.Diagnostics.compute_invariant","text":"Compute an invariant for the solution of an ODE or DAE system.\n\nArguments: (t::TimeSeries, q::DataSeries{T}, invariant::Base.Callable)\n\nThe invariant functions needs to take two arguments (t,q) and return the corresponding value of the invariant.\n\nReturns a ScalarDataSeries holding the time series of the invariant.\n\n\n\n\n\n","category":"method"},{"location":"diagnostics/#GeometricProblems.Diagnostics.compute_invariant_error-Tuple{GeometricSolutions.TimeSeries, GeometricSolutions.DataSeries, Union{Function, Type}}","page":"Diagnostics","title":"GeometricProblems.Diagnostics.compute_invariant_error","text":"Compute the relative error of an invariant for the solution of an ODE or DAE system.\n\nArguments: (t::TimeSeries, q::DataSeries{T}, invariant::Base.Callable)\n\nThe invariant functions needs to take two arguments (t,q) and return the corresponding value of the invariant.\n\nReturns a tuple of two 1d DataSeries holding the time series of the invariant and the relativ error, respectively.\n\n\n\n\n\n","category":"method"},{"location":"diagnostics/#GeometricProblems.Diagnostics.compute_invariant_error-Union{Tuple{T}, Tuple{GeometricSolutions.TimeSeries, GeometricSolutions.DataSeries{T, AT} where AT<:Union{AbstractArray{T}, T}, GeometricSolutions.DataSeries{T, AT} where AT<:Union{AbstractArray{T}, T}, Union{Function, Type}}} where T","page":"Diagnostics","title":"GeometricProblems.Diagnostics.compute_invariant_error","text":"Compute the relative error of an invariant for the solution of a partitioned ODE or DAE system.\n\nArguments: (t::TimeSeries, q::DataSeries{T}, p::DataSeries{T}, invariant::Base.Callable)\n\nThe invariant functions needs to take three arguments (t,q,p) and return the corresponding value of the invariant.\n\nReturns a tuple of two ScalarDataSeries holding the time series of the invariant and the relativ error, respectively.\n\n\n\n\n\n","category":"method"},{"location":"diagnostics/#GeometricProblems.Diagnostics.compute_momentum_error-Union{Tuple{DT}, Tuple{GeometricSolutions.DataSeries{DT, AT} where AT<:Union{AbstractArray{DT}, DT}, GeometricSolutions.DataSeries{DT, AT} where AT<:Union{AbstractArray{DT}, DT}}} where DT","page":"Diagnostics","title":"GeometricProblems.Diagnostics.compute_momentum_error","text":"Computes the difference of the momentum and the one-form of an implicit ODE or DAE system.\n\nArguments: (p::DataSeries{DT}, ϑ::DataSeries{DT})\n\nReturns a DataSeries similar to p holding the time series of the difference between p and ϑ.\n\n\n\n\n\n","category":"method"},{"location":"diagnostics/#GeometricProblems.Diagnostics.compute_one_form-Tuple{GeometricSolutions.TimeSeries, GeometricSolutions.DataSeries, Union{Function, Type}}","page":"Diagnostics","title":"GeometricProblems.Diagnostics.compute_one_form","text":"Compute the one-form (symplectic potential) for the solution of a Lagrangian system.\n\nArguments: (t::TimeSeries, q::DataSeries, one_form::Base.Callable)\n\nThe one_form function needs to take three arguments (t,q,k) where k is the index of the one-form component.\n\nReturns a DataSeries similar to q holding the time series of the one-form.\n\n\n\n\n\n","category":"method"},{"location":"diagnostics/#GeometricProblems.Diagnostics.compute_relative_error-Union{Tuple{GeometricSolutions.ScalarDataSeries{T}}, Tuple{T}} where T","page":"Diagnostics","title":"GeometricProblems.Diagnostics.compute_relative_error","text":"Takes a ScalarDataSeries holding an invariant and computes the relative error (inv(t)-inv(0))/inv(0).\n\nReturns a ScalarDataSeries similar to the argument holding the time series of the relativ errors.\n\n\n\n\n\n","category":"method"},{"location":"kepler_problem/#Kepler-Problem","page":"Kepler Problem","title":"Kepler Problem","text":"","category":"section"},{"location":"pendulum/#Mathematical-Pendulum","page":"Mathematical Pendulum","title":"Mathematical Pendulum","text":"","category":"section"},{"location":"pendulum/","page":"Mathematical Pendulum","title":"Mathematical Pendulum","text":"Modules = [GeometricProblems.Pendulum]\nOrder = [:constant, :type, :macro, :function]","category":"page"},{"location":"releasenotes/#Release-Notes","page":"Release Notes","title":"Release Notes","text":"","category":"section"},{"location":"releasenotes/#0.1.1","page":"Release Notes","title":"0.1.1","text":"","category":"section"},{"location":"releasenotes/#New-Features","page":"Release Notes","title":"New Features","text":"","category":"section"},{"location":"releasenotes/","page":"Release Notes","title":"Release Notes","text":"Poincaré invariants for Lotka-Volterra 2d model\nMore equation types for massless charged particle","category":"page"},{"location":"releasenotes/#Fixes","page":"Release Notes","title":"Fixes","text":"","category":"section"},{"location":"releasenotes/","page":"Release Notes","title":"Release Notes","text":"Fixes in general plot recipes","category":"page"},{"location":"releasenotes/#0.1.0","page":"Release Notes","title":"0.1.0","text":"","category":"section"},{"location":"releasenotes/","page":"Release Notes","title":"Release Notes","text":"Initial release with equations for","category":"page"},{"location":"releasenotes/","page":"Release Notes","title":"Release Notes","text":"Exponential Growth,\nLorenz Attractor in 3D,\nLotka-Volterra in 2D,\nLotka-Volterra in 3D,\nLotka-Volterra in 4D,\nMassless Charged Particle,\nHarmonic Oscillator,\nMathematical Pendulum,\nPlanar Point Vortices.","category":"page"},{"location":"nonlinear_oscillators/#Nonlinear-Oscillators","page":"Nonlinear Oscillators","title":"Nonlinear Oscillators","text":"","category":"section"},{"location":"nonlinear_oscillators/#Duffing-Oscillator","page":"Nonlinear Oscillators","title":"Duffing Oscillator","text":"","category":"section"},{"location":"nonlinear_oscillators/","page":"Nonlinear Oscillators","title":"Nonlinear Oscillators","text":"GeometricProblems.DuffingOscillator","category":"page"},{"location":"nonlinear_oscillators/#GeometricProblems.DuffingOscillator","page":"Nonlinear Oscillators","title":"GeometricProblems.DuffingOscillator","text":"\n\n\n\n","category":"module"},{"location":"nonlinear_oscillators/","page":"Nonlinear Oscillators","title":"Nonlinear Oscillators","text":"Modules = [GeometricProblems.DuffingOscillator]\nOrder = [:constant, :type, :macro, :function]","category":"page"},{"location":"nonlinear_oscillators/#Lennard-Jones-Oscillator","page":"Nonlinear Oscillators","title":"Lennard-Jones Oscillator","text":"","category":"section"},{"location":"nonlinear_oscillators/","page":"Nonlinear Oscillators","title":"Nonlinear Oscillators","text":"GeometricProblems.LennardJonesOscillator","category":"page"},{"location":"nonlinear_oscillators/#GeometricProblems.LennardJonesOscillator","page":"Nonlinear Oscillators","title":"GeometricProblems.LennardJonesOscillator","text":"\n\n\n\n","category":"module"},{"location":"nonlinear_oscillators/","page":"Nonlinear Oscillators","title":"Nonlinear Oscillators","text":"Modules = [GeometricProblems.LennardJonesOscillator]\nOrder = [:constant, :type, :macro, :function]","category":"page"},{"location":"nonlinear_oscillators/#Mathews-Lakshmanan-Oscillator","page":"Nonlinear Oscillators","title":"Mathews-Lakshmanan Oscillator","text":"","category":"section"},{"location":"nonlinear_oscillators/","page":"Nonlinear Oscillators","title":"Nonlinear Oscillators","text":"GeometricProblems.MathewsLakshmananOscillator","category":"page"},{"location":"nonlinear_oscillators/#GeometricProblems.MathewsLakshmananOscillator","page":"Nonlinear Oscillators","title":"GeometricProblems.MathewsLakshmananOscillator","text":"\n\n\n\n","category":"module"},{"location":"nonlinear_oscillators/","page":"Nonlinear Oscillators","title":"Nonlinear Oscillators","text":"Modules = [GeometricProblems.MathewsLakshmananOscillator]\nOrder = [:constant, :type, :macro, :function]","category":"page"},{"location":"nonlinear_oscillators/#Morse-Oscillator","page":"Nonlinear Oscillators","title":"Morse Oscillator","text":"","category":"section"},{"location":"nonlinear_oscillators/","page":"Nonlinear Oscillators","title":"Nonlinear Oscillators","text":"GeometricProblems.MorseOscillator","category":"page"},{"location":"nonlinear_oscillators/#GeometricProblems.MorseOscillator","page":"Nonlinear Oscillators","title":"GeometricProblems.MorseOscillator","text":"\n\n\n\n","category":"module"},{"location":"nonlinear_oscillators/","page":"Nonlinear Oscillators","title":"Nonlinear Oscillators","text":"Modules = [GeometricProblems.MorseOscillator]\nOrder = [:constant, :type, :macro, :function]","category":"page"},{"location":"henon_heiles/#Henon-Heiles-System","page":"Hénon-Heiles System","title":"Hénon-Heiles System","text":"","category":"section"},{"location":"lotka_volterra_2d/#Lotka-Volterra-2d","page":"Lotka-Volterra 2d","title":"Lotka-Volterra 2d","text":"","category":"section"},{"location":"lotka_volterra_2d/","page":"Lotka-Volterra 2d","title":"Lotka-Volterra 2d","text":"Lotka–Volterra models are used in mathematical biology for modelling population dynamics of animal species, as well as many other fields where predator-prey and similar models appear. The dynamics of the growth of two interacting species can be modelled by the following noncanonical Hamiltonian system","category":"page"},{"location":"lotka_volterra_2d/","page":"Lotka-Volterra 2d","title":"Lotka-Volterra 2d","text":"dotq = beginpmatrix\nhphantom- 0 + q_1 q_2 \n- q_1 q_2 hphantom+ 0 \nendpmatrix\nnabla H (q) \nquad\nH (q) = a_1 q_1 + a_2 q_2 + b_1 log q_1 + b_2 log q_2 ","category":"page"},{"location":"lotka_volterra_2d/","page":"Lotka-Volterra 2d","title":"Lotka-Volterra 2d","text":"using Plots\nusing GeometricIntegrators\nusing GeometricProblems.LotkaVolterra2d\nusing GeometricProblems.LotkaVolterra2dPlots\n\node = lotka_volterra_2d_ode()\nsol = integrate(ode, Gauss(1))\n\nplot_lotka_volterra_2d(sol, ode)\nsavefig(\"lotka_volterra_2d.svg\")\n\nnothing","category":"page"},{"location":"lotka_volterra_2d/","page":"Lotka-Volterra 2d","title":"Lotka-Volterra 2d","text":"(Image: )","category":"page"},{"location":"lotka_volterra_2d/#Sub-models","page":"Lotka-Volterra 2d","title":"Sub-models","text":"","category":"section"},{"location":"lotka_volterra_2d/","page":"Lotka-Volterra 2d","title":"Lotka-Volterra 2d","text":"The Euler-Lagrange equations of the Lotka-Volterra model can be obtained from different Lagrangians, which are connected by gauge transformations. Although they all lead to the same equations of motion, they lead to different variational integrators. Therefore different models based on different Lagrangians are implemented.","category":"page"},{"location":"lotka_volterra_2d/","page":"Lotka-Volterra 2d","title":"Lotka-Volterra 2d","text":"GeometricProblems.LotkaVolterra2d","category":"page"},{"location":"lotka_volterra_2d/#GeometricProblems.LotkaVolterra2d","page":"Lotka-Volterra 2d","title":"GeometricProblems.LotkaVolterra2d","text":"Lotka-Volterra model in 2D\n\nbeginaligned\nL (q dotq) = bigg( q_2 + fraclog q_2q_1 bigg) dotq_1 + q_1 dotq_2 - H(q) \nH(q) = a_1 q_1 + a_2 q_2 + b_1 log q_1 + b_2 log q_2\nendaligned\n\n\n\n\n\n","category":"module"},{"location":"lotka_volterra_2d/","page":"Lotka-Volterra 2d","title":"Lotka-Volterra 2d","text":"GeometricProblems.LotkaVolterra2dSymmetric","category":"page"},{"location":"lotka_volterra_2d/#GeometricProblems.LotkaVolterra2dSymmetric","page":"Lotka-Volterra 2d","title":"GeometricProblems.LotkaVolterra2dSymmetric","text":"Lotka-Volterra model in 2D with symmetric Lagrangian\n\nbeginaligned\nL (q dotq) = frac12 fraclog q_2q_1 dotq_1 - frac12 fraclog q_1q_2 dotq_2 - H(q) \nH(q) = a_1 q_1 + a_2 q_2 + b_1 log q_1 + b_2 log q_2\nendaligned\n\nThis Lagrangian is a slight generalization of Equation (5) in José Fernández-Núñez, Lagrangian Structure of the Two-Dimensional Lotka-Volterra System, International Journal of Theoretical Physics, Vol. 37, No. 9, pp. 2457-2462, 1998.\n\n\n\n\n\n","category":"module"},{"location":"lotka_volterra_2d/","page":"Lotka-Volterra 2d","title":"Lotka-Volterra 2d","text":"GeometricProblems.LotkaVolterra2dSingular","category":"page"},{"location":"lotka_volterra_2d/#GeometricProblems.LotkaVolterra2dSingular","page":"Lotka-Volterra 2d","title":"GeometricProblems.LotkaVolterra2dSingular","text":"Lotka-Volterra model in 2D with \"singular\" Lagrangian\n\nbeginaligned\nL (q dotq) = fraclog q_2q_1 dotq_1 - H(q) \nH(q) = a_1 q_1 + a_2 q_2 + b_1 log q_1 + b_2 log q_2\nendaligned\n\nThis Lagrangian is equivalent to the Lagrangian of the symmetric Lotka-Volterra model. It differs only by a gauge transformation with the term - 12 d(log(q_1) log(q_2))dt. It leads to the same Euler-Lagrange equations but to a different variational integrator.\n\n\n\n\n\n","category":"module"},{"location":"lotka_volterra_2d/","page":"Lotka-Volterra 2d","title":"Lotka-Volterra 2d","text":"GeometricProblems.LotkaVolterra2dGauge","category":"page"},{"location":"lotka_volterra_2d/#GeometricProblems.LotkaVolterra2dGauge","page":"Lotka-Volterra 2d","title":"GeometricProblems.LotkaVolterra2dGauge","text":"Lotka-Volterra model in 2D with symmetric Lagrangian with gauge term\n\nbeginaligned\nL (q dotq) = bigg( q_2 + frac12 fraclog q_2q_1 bigg) dotq_1 + bigg( q_1 - frac12 fraclog q_1q_2 bigg) dotq_2 - H(q) \nH(q) = a_1 q_1 + a_2 q_2 + b_1 log q_1 + b_2 log q_2\nendaligned\n\nThis Lagrangian is equivalent to the Lagrangian of the symmetric Lotka-Volterra model. It differs only by a gauge transformation with the term d(q_1 q_2)dt. It leads to the same Euler-Lagrange equations but to a different variational integrator.\n\n\n\n\n\n","category":"module"},{"location":"lotka_volterra_2d/#User-Functions","page":"Lotka-Volterra 2d","title":"User Functions","text":"","category":"section"},{"location":"lotka_volterra_2d/","page":"Lotka-Volterra 2d","title":"Lotka-Volterra 2d","text":"Modules = [GeometricProblems.LotkaVolterra2d]\nOrder = [:constant, :type, :macro, :function]","category":"page"},{"location":"lotka_volterra_2d/#GeometricProblems.LotkaVolterra2d.lotka_volterra_2d_dae","page":"Lotka-Volterra 2d","title":"GeometricProblems.LotkaVolterra2d.lotka_volterra_2d_dae","text":"Creates a DAE object for the Lotka-Volterra 2D model.\n\n\n\n\n\n","category":"function"},{"location":"lotka_volterra_2d/#GeometricProblems.LotkaVolterra2d.lotka_volterra_2d_dg","page":"Lotka-Volterra 2d","title":"GeometricProblems.LotkaVolterra2d.lotka_volterra_2d_dg","text":"Creates an implicit ODE object for the Lotka-Volterra 2D model for use with DG integrators.\n\n\n\n\n\n","category":"function"},{"location":"lotka_volterra_2d/#GeometricProblems.LotkaVolterra2d.lotka_volterra_2d_hdae","page":"Lotka-Volterra 2d","title":"GeometricProblems.LotkaVolterra2d.lotka_volterra_2d_hdae","text":"Creates a Hamiltonian DAE object for the Lotka-Volterra 2D model.\n\n\n\n\n\n","category":"function"},{"location":"lotka_volterra_2d/#GeometricProblems.LotkaVolterra2d.lotka_volterra_2d_hode","page":"Lotka-Volterra 2d","title":"GeometricProblems.LotkaVolterra2d.lotka_volterra_2d_hode","text":"Creates a Hamiltonian ODE object for the Lotka-Volterra 2D model.\n\n\n\n\n\n","category":"function"},{"location":"lotka_volterra_2d/#GeometricProblems.LotkaVolterra2d.lotka_volterra_2d_idae","page":"Lotka-Volterra 2d","title":"GeometricProblems.LotkaVolterra2d.lotka_volterra_2d_idae","text":"Creates an implicit DAE object for the Lotka-Volterra 2D model.\n\n\n\n\n\n","category":"function"},{"location":"lotka_volterra_2d/#GeometricProblems.LotkaVolterra2d.lotka_volterra_2d_idae_spark","page":"Lotka-Volterra 2d","title":"GeometricProblems.LotkaVolterra2d.lotka_volterra_2d_idae_spark","text":"Creates an implicit DAE object for the Lotka-Volterra 2D model.\n\n\n\n\n\n","category":"function"},{"location":"lotka_volterra_2d/#GeometricProblems.LotkaVolterra2d.lotka_volterra_2d_iode","page":"Lotka-Volterra 2d","title":"GeometricProblems.LotkaVolterra2d.lotka_volterra_2d_iode","text":"Creates an implicit ODE object for the Lotka-Volterra 2D model.\n\n\n\n\n\n","category":"function"},{"location":"lotka_volterra_2d/#GeometricProblems.LotkaVolterra2d.lotka_volterra_2d_ldae","page":"Lotka-Volterra 2d","title":"GeometricProblems.LotkaVolterra2d.lotka_volterra_2d_ldae","text":"Creates a variational DAE object for the Lotka-Volterra 2D model.\n\n\n\n\n\n","category":"function"},{"location":"lotka_volterra_2d/#GeometricProblems.LotkaVolterra2d.lotka_volterra_2d_lode","page":"Lotka-Volterra 2d","title":"GeometricProblems.LotkaVolterra2d.lotka_volterra_2d_lode","text":"Creates a variational ODE object for the Lotka-Volterra 2D model.\n\n\n\n\n\n","category":"function"},{"location":"lotka_volterra_2d/#GeometricProblems.LotkaVolterra2d.lotka_volterra_2d_ode","page":"Lotka-Volterra 2d","title":"GeometricProblems.LotkaVolterra2d.lotka_volterra_2d_ode","text":"Creates an ODE object for the Lotka-Volterra 2D model.\n\n\n\n\n\n","category":"function"},{"location":"lotka_volterra_2d/#GeometricProblems.LotkaVolterra2d.lotka_volterra_2d_pdae","page":"Lotka-Volterra 2d","title":"GeometricProblems.LotkaVolterra2d.lotka_volterra_2d_pdae","text":"Creates a partitioned DAE object for the Lotka-Volterra 2D model.\n\n\n\n\n\n","category":"function"},{"location":"lotka_volterra_2d/#GeometricProblems.LotkaVolterra2d.lotka_volterra_2d_pode","page":"Lotka-Volterra 2d","title":"GeometricProblems.LotkaVolterra2d.lotka_volterra_2d_pode","text":"Creates a partitioned ODE object for the Lotka-Volterra 2D model.\n\n\n\n\n\n","category":"function"},{"location":"lotka_volterra_2d/#GeometricProblems.LotkaVolterra2d.lotka_volterra_2d_slrk","page":"Lotka-Volterra 2d","title":"GeometricProblems.LotkaVolterra2d.lotka_volterra_2d_slrk","text":"Creates a variational DAE object for the Lotka-Volterra 2D model for use with SLRK integrators.\n\n\n\n\n\n","category":"function"},{"location":"lotka_volterra_2d/#Plotting-Functions","page":"Lotka-Volterra 2d","title":"Plotting Functions","text":"","category":"section"},{"location":"lotka_volterra_2d/","page":"Lotka-Volterra 2d","title":"Lotka-Volterra 2d","text":"Modules = [GeometricProblems.LotkaVolterra2dPlots]\nOrder = [:constant, :type, :macro, :function]","category":"page"},{"location":"lotka_volterra_2d/#GeometricProblems.LotkaVolterra2dPlots.plot_lotka_volterra_2d!-Tuple","page":"Lotka-Volterra 2d","title":"GeometricProblems.LotkaVolterra2dPlots.plot_lotka_volterra_2d!","text":"Plots the solution of a 2D Lotka-Volterra model together with the energy error.\n\nArguments:\n\nsol <: GeometricSolution\nequ <: GeometricProblem\n\nKeyword aguments:\n\nnplot=1: plot every nplotth time step\nxlims=:auto: xlims for solution plot\nylims=:auto: ylims for solution plot\nlatex=true: use LaTeX guides\n\n\n\n\n\n","category":"method"},{"location":"lotka_volterra_2d/#GeometricProblems.LotkaVolterra2dPlots.plot_lotka_volterra_2d!-Tuple{RecipesBase.AbstractPlot, Vararg{Any}}","page":"Lotka-Volterra 2d","title":"GeometricProblems.LotkaVolterra2dPlots.plot_lotka_volterra_2d!","text":"Plots the solution of a 2D Lotka-Volterra model together with the energy error.\n\nArguments:\n\nsol <: GeometricSolution\nequ <: GeometricProblem\n\nKeyword aguments:\n\nnplot=1: plot every nplotth time step\nxlims=:auto: xlims for solution plot\nylims=:auto: ylims for solution plot\nlatex=true: use LaTeX guides\n\n\n\n\n\n","category":"method"},{"location":"lotka_volterra_2d/#GeometricProblems.LotkaVolterra2dPlots.plot_lotka_volterra_2d-Tuple","page":"Lotka-Volterra 2d","title":"GeometricProblems.LotkaVolterra2dPlots.plot_lotka_volterra_2d","text":"Plots the solution of a 2D Lotka-Volterra model together with the energy error.\n\nArguments:\n\nsol <: GeometricSolution\nequ <: GeometricProblem\n\nKeyword aguments:\n\nnplot=1: plot every nplotth time step\nxlims=:auto: xlims for solution plot\nylims=:auto: ylims for solution plot\nlatex=true: use LaTeX guides\n\n\n\n\n\n","category":"method"},{"location":"lotka_volterra_2d/#GeometricProblems.LotkaVolterra2dPlots.plot_lotka_volterra_2d_solution!-Tuple","page":"Lotka-Volterra 2d","title":"GeometricProblems.LotkaVolterra2dPlots.plot_lotka_volterra_2d_solution!","text":"Plots the solution of a 2D Lotka-Volterra model.\n\nArguments:\n\nsol <: GeometricSolution\nequ <: GeometricProblem\n\nKeyword aguments:\n\nnplot=1: plot every nplotth time step\nxlims=:auto: xlims for solution plot\nylims=:auto: ylims for solution plot\nlatex=true: use LaTeX guides\n\n\n\n\n\n","category":"method"},{"location":"lotka_volterra_2d/#GeometricProblems.LotkaVolterra2dPlots.plot_lotka_volterra_2d_solution!-Tuple{RecipesBase.AbstractPlot, Vararg{Any}}","page":"Lotka-Volterra 2d","title":"GeometricProblems.LotkaVolterra2dPlots.plot_lotka_volterra_2d_solution!","text":"Plots the solution of a 2D Lotka-Volterra model.\n\nArguments:\n\nsol <: GeometricSolution\nequ <: GeometricProblem\n\nKeyword aguments:\n\nnplot=1: plot every nplotth time step\nxlims=:auto: xlims for solution plot\nylims=:auto: ylims for solution plot\nlatex=true: use LaTeX guides\n\n\n\n\n\n","category":"method"},{"location":"lotka_volterra_2d/#GeometricProblems.LotkaVolterra2dPlots.plot_lotka_volterra_2d_solution-Tuple","page":"Lotka-Volterra 2d","title":"GeometricProblems.LotkaVolterra2dPlots.plot_lotka_volterra_2d_solution","text":"Plots the solution of a 2D Lotka-Volterra model.\n\nArguments:\n\nsol <: GeometricSolution\nequ <: GeometricProblem\n\nKeyword aguments:\n\nnplot=1: plot every nplotth time step\nxlims=:auto: xlims for solution plot\nylims=:auto: ylims for solution plot\nlatex=true: use LaTeX guides\n\n\n\n\n\n","category":"method"},{"location":"lotka_volterra_2d/#GeometricProblems.LotkaVolterra2dPlots.plot_lotka_volterra_2d_traces!-Tuple","page":"Lotka-Volterra 2d","title":"GeometricProblems.LotkaVolterra2dPlots.plot_lotka_volterra_2d_traces!","text":"Plots time traces of the solution of a 2D Lotka-Volterra model and its energy error.\n\nArguments:\n\nsol <: GeometricSolution\nequ <: GeometricProblem\n\nKeyword aguments:\n\nnplot=1: plot every nplotth time step\nlatex=true: use LaTeX guides\n\n\n\n\n\n","category":"method"},{"location":"lotka_volterra_2d/#GeometricProblems.LotkaVolterra2dPlots.plot_lotka_volterra_2d_traces!-Tuple{RecipesBase.AbstractPlot, Vararg{Any}}","page":"Lotka-Volterra 2d","title":"GeometricProblems.LotkaVolterra2dPlots.plot_lotka_volterra_2d_traces!","text":"Plots time traces of the solution of a 2D Lotka-Volterra model and its energy error.\n\nArguments:\n\nsol <: GeometricSolution\nequ <: GeometricProblem\n\nKeyword aguments:\n\nnplot=1: plot every nplotth time step\nlatex=true: use LaTeX guides\n\n\n\n\n\n","category":"method"},{"location":"lotka_volterra_2d/#GeometricProblems.LotkaVolterra2dPlots.plot_lotka_volterra_2d_traces-Tuple","page":"Lotka-Volterra 2d","title":"GeometricProblems.LotkaVolterra2dPlots.plot_lotka_volterra_2d_traces","text":"Plots time traces of the solution of a 2D Lotka-Volterra model and its energy error.\n\nArguments:\n\nsol <: GeometricSolution\nequ <: GeometricProblem\n\nKeyword aguments:\n\nnplot=1: plot every nplotth time step\nlatex=true: use LaTeX guides\n\n\n\n\n\n","category":"method"},{"location":"point_vortices/#Planar-Point-Vortices","page":"Point Vortices","title":"Planar Point Vortices","text":"","category":"section"},{"location":"point_vortices/","page":"Point Vortices","title":"Point Vortices","text":"Modules = [GeometricProblems.PointVortices]\nOrder = [:constant, :type, :macro, :function]","category":"page"},{"location":"inner_solar_system/#Inner-Solar-System","page":"Inner Solar System","title":"Inner Solar System","text":"","category":"section"},{"location":"outer_solar_system/#Outer-Solar-System","page":"Outer Solar System","title":"Outer Solar System","text":"","category":"section"},{"location":"toda_lattice/#Toda-Lattice","page":"Toda Lattice","title":"Toda Lattice","text":"","category":"section"},{"location":"toda_lattice/","page":"Toda Lattice","title":"Toda Lattice","text":"The Toda lattice is a prime example of an completely-integrable system, i.e. a Hamiltonian system evolving in mathbbR^2n that has n Poisson-commuting invariants of motion (see [2]). It is named after Morikazu Toda who used it to model a one-dimensional crystal [3].","category":"page"},{"location":"toda_lattice/","page":"Toda Lattice","title":"Toda Lattice","text":"The Hamiltonian of the Toda lattice takes the following form: ","category":"page"},{"location":"toda_lattice/","page":"Toda Lattice","title":"Toda Lattice","text":" H(q p) = sum_ninmathbbZleft( fracp_n^22 + alpha e^q_n - q_n+1 right)","category":"page"},{"location":"toda_lattice/","page":"Toda Lattice","title":"Toda Lattice","text":"In practice we work with a finite number of particles N and impose periodic boundary conditions: ","category":"page"},{"location":"toda_lattice/","page":"Toda Lattice","title":"Toda Lattice","text":"beginaligned\n q_n+N equiv q_n \n p_n+N equiv p_n\nendaligned","category":"page"},{"location":"toda_lattice/","page":"Toda Lattice","title":"Toda Lattice","text":"Hence we have: ","category":"page"},{"location":"toda_lattice/","page":"Toda Lattice","title":"Toda Lattice","text":" H(q p) = sum_n=1^N-1 left( fracp_n^22 + alpha e^q_n - q_n+1 right) + fracp_N^22 + alpha e^q_N - q_1","category":"page"},{"location":"toda_lattice/","page":"Toda Lattice","title":"Toda Lattice","text":"We can model the evolution of a thin pulse in this system:","category":"page"},{"location":"toda_lattice/","page":"Toda Lattice","title":"Toda Lattice","text":"using GeometricProblems, GeometricIntegrators, Plots # hide\n\nproblem = GeometricProblems.TodaLattice.hodeproblem() \nsol = integrate(problem, ImplicitMidpoint())\n\ntime_steps = (0, 200, 400, 600, 800, 1000, 1200)\np = plot()\nfor time_step in time_steps\n plot!(p, sol.q[time_step, :], label = \"t = $(sol.t[time_step])\")\nend\n\np","category":"page"},{"location":"toda_lattice/","page":"Toda Lattice","title":"Toda Lattice","text":"As we can see the thin pulse separates into two smaller pulses an they start traveling in opposite directions until they meet again at time tapprox120. ","category":"page"},{"location":"toda_lattice/#Library-functions","page":"Toda Lattice","title":"Library functions","text":"","category":"section"},{"location":"toda_lattice/","page":"Toda Lattice","title":"Toda Lattice","text":"GeometricProblems.TodaLattice","category":"page"},{"location":"toda_lattice/#GeometricProblems.TodaLattice","page":"Toda Lattice","title":"GeometricProblems.TodaLattice","text":"The Toda lattice is a model for a one-dimensional crystal named after its discoverer Morikazu Toda [3].\n\nIt is a prime example of a non-trivial completely integrable system.\n\nThe only system parameters are the number of points N in the periodic lattice and \\alpha which adjusts the strength of the interactions in the lattice.\n\n\n\n\n\n","category":"module"},{"location":"toda_lattice/","page":"Toda Lattice","title":"Toda Lattice","text":"V. I. Arnold. Mathematical methods of classical mechanics. Vol. 60 of Graduate Texts in Mathematics (Springer Verlag, Berlin, 1978).\n\n\n\nM. Toda. Vibration of a chain with nonlinear interaction. Journal of the Physical Society of Japan 22, 431–436 (1967).\n\n\n\n","category":"page"},{"location":"harmonic_oscillator/#Harmonic-Oscillator","page":"Harmonic Oscillator","title":"Harmonic Oscillator","text":"","category":"section"},{"location":"harmonic_oscillator/","page":"Harmonic Oscillator","title":"Harmonic Oscillator","text":"Modules = [GeometricProblems.HarmonicOscillator]\nOrder = [:constant, :type, :macro, :function]","category":"page"},{"location":"#GeometricProblems.jl","page":"Home","title":"GeometricProblems.jl","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"GeometricProblems.jl is a collection of ODEs and DAEs with interesting geometric structures together with useful diagnostics and plotting tools.","category":"page"},{"location":"","page":"Home","title":"Home","text":"(Image: PkgEval Status) (Image: CI) (Image: Build Status) (Image: Coverage Status) (Image: codecov) (Image: DOI)","category":"page"},{"location":"","page":"Home","title":"Home","text":"Typical structures are","category":"page"},{"location":"","page":"Home","title":"Home","text":"Variational structure, i.e., the equations can defined in terms of a Lagrangian function and be obtained from an action principle;\nHamiltonian structure, i.e., the equations can be defined in terms of a Hamiltonian function together with a symplectic or Poisson matrix;\nInvariants, i.e., the equations have symmetries and associated conservation laws;\nVolume preservation, i.e., the flow of the equations is divergence-free.","category":"page"},{"location":"#Contents","page":"Home","title":"Contents","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Pages = [\n\"diagnostics.md\",\n\"abc_flow.md\",\n\"coupled_harmonic_oscillator.md\",\n\"henon_heiles.md\",\n\"kepler_problem.md\",\n\"lorenz_attractor.md\",\n\"lotka_volterra_2d.md\",\n\"lotka_volterra_3d.md\",\n\"lotka_volterra_4d.md\",\n\"massless_charged_particle.md\",\n\"harmonic_oscillator.md\",\n\"nonlinear_oscillators.md\",\n\"pendulum.md\",\n\"double_pendulum.md\",\n\"point_vortices.md\",\n\"inner_solar_system.md\",\n\"outer_solar_system.md\",\n\"toda_lattice.md\"\n]\nDepth = 1","category":"page"},{"location":"#References","page":"Home","title":"References","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"If you use the figures or implementations provided here, please consider citing GeometricIntegrators.jl as","category":"page"},{"location":"","page":"Home","title":"Home","text":"@misc{Kraus:2020:GeometricIntegratorsRepo,\n title={GeometricIntegrators.jl: Geometric Numerical Integration in Julia},\n author={Kraus, Michael},\n year={2020},\n howpublished={\\url{https://github.com/JuliaGNI/GeometricIntegrators.jl}},\n doi={10.5281/zenodo.3648325}\n}","category":"page"},{"location":"","page":"Home","title":"Home","text":"as well as this repository as","category":"page"},{"location":"","page":"Home","title":"Home","text":"@misc{Kraus:2020:GeometricProblemsRepo,\n title={GeometricProblems.jl: Collection of Differential Equations with Geometric Structure.},\n author={Kraus, Michael},\n year={2020},\n howpublished={\\url{https://github.com/JuliaGNI/GeometricProblems.jl}},\n doi={10.5281/zenodo.4285904}\n}","category":"page"},{"location":"#Figure-License","page":"Home","title":"Figure License","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Copyright (c) Michael Kraus All figures are licensed under the Creative Commons CC BY-NC-SA 4.0 License.","category":"page"},{"location":"#Software-License","page":"Home","title":"Software License","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Copyright (c) Michael Kraus Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","category":"page"},{"location":"lorenz_attractor/#Lorenz-Attractor-in-3d","page":"Lorenz Attractor","title":"Lorenz Attractor in 3d","text":"","category":"section"},{"location":"lorenz_attractor/","page":"Lorenz Attractor","title":"Lorenz Attractor","text":"Modules = [GeometricProblems.LorenzAttractor]\nOrder = [:constant, :type, :macro, :function]","category":"page"}] +[{"location":"double_pendulum/#Double-Pendulum","page":"Double Pendulum","title":"Double Pendulum","text":"","category":"section"},{"location":"double_pendulum/","page":"Double Pendulum","title":"Double Pendulum","text":"The double pendulum consists of two pendula, one attached to the origin at (xy) = (00), and the second attached to the first. Each pendulum consists of a point mass m_i attached to a massless rod of length l_i with i in (12). All motion is assumed to be frictionless.","category":"page"},{"location":"double_pendulum/","page":"Double Pendulum","title":"Double Pendulum","text":"HTML(\"\"\"\"\"\") # hide","category":"page"},{"location":"double_pendulum/","page":"Double Pendulum","title":"Double Pendulum","text":"HTML(\"\"\"\"\"\") # hide","category":"page"},{"location":"double_pendulum/","page":"Double Pendulum","title":"Double Pendulum","text":"The dynamics of the system is most naturally described in terms of the angles theta_i between the rods l_i and the vertical axis y. In terms of these angles, the cartesian coordinates are given by","category":"page"},{"location":"double_pendulum/","page":"Double Pendulum","title":"Double Pendulum","text":"beginalign*\nx_1 = l_1 sintheta_1 \nx_2 = l_1 sintheta_1 + l_2 sintheta_2 \ny_1 = - l_1 costheta_1 \ny_2 = -l_1 costheta_1 - l_2 costheta_2 \nendalign*","category":"page"},{"location":"double_pendulum/","page":"Double Pendulum","title":"Double Pendulum","text":"In terms of the generalized coordinates theta_i, the Lagrangian reads","category":"page"},{"location":"double_pendulum/","page":"Double Pendulum","title":"Double Pendulum","text":"beginalign*\nL (theta_1 theta_2 dottheta_1 dottheta_2)\n = frac12 (m_1 + m_2) l_1^2 dottheta_1^2 \n + frac12 m_2 l_2^2 dottheta_2^2\n + m_2 l_1 l_2 dottheta_1 dottheta_2 cos(theta_1 - theta_2) \n + g (m_1 + m_2) l_1 costheta_1\n + g m_2 l_2 costheta_2 \nendalign*","category":"page"},{"location":"double_pendulum/","page":"Double Pendulum","title":"Double Pendulum","text":"The canonical conjugate momenta p_i are obtained from the Lagrangian as","category":"page"},{"location":"double_pendulum/","page":"Double Pendulum","title":"Double Pendulum","text":"beginalign*\np_1 = fracpartial Lpartial dottheta_1 = (m_1 + m_2) l_1^2 dottheta_1 + m_2 l_1 l_2 dottheta_2 cos(theta_1 - theta_2) \np_2 = fracpartial Lpartial dottheta_2 = m_2 l_2^2 dottheta_2 + m_2 l_1 l_2 dottheta_1 cos(theta_1 - theta_2) \nendalign*","category":"page"},{"location":"double_pendulum/","page":"Double Pendulum","title":"Double Pendulum","text":"After solving these relations for the generalized velocities dottheta_i,","category":"page"},{"location":"double_pendulum/","page":"Double Pendulum","title":"Double Pendulum","text":"beginalign*\ndottheta_1 = fracl_2 p_theta_1 - l_1 p_theta_2 cos(theta_1 - theta_2)l_1^2 l_2 left m_1 + m_2 sin^2(theta_1 - theta_2) right \ndottheta_2 = frac(m_1 + m_2) l_1 p_theta_2 - m_2 l_2 p_theta_1 cos(theta_1 - theta_2)m_2 l_1 l_2^2 left m_1 + m_2 sin^2 (theta_1 - theta_2) right \nendalign*","category":"page"},{"location":"double_pendulum/","page":"Double Pendulum","title":"Double Pendulum","text":"the Hamiltonian can be obtained via the Legendre transform,","category":"page"},{"location":"double_pendulum/","page":"Double Pendulum","title":"Double Pendulum","text":"H = sum_i=1^2 dottheta_i p_i - L ","category":"page"},{"location":"double_pendulum/","page":"Double Pendulum","title":"Double Pendulum","text":"as","category":"page"},{"location":"double_pendulum/","page":"Double Pendulum","title":"Double Pendulum","text":"beginalign*\nH = fracm_2 l_2^2 p^2_theta_1 + (m_1 + m_2) l_1^2 p^2_theta_2 - 2 m_2 l_1 l_2 p_theta_1 p_theta_2 cos(theta_1 - theta_2)2 m_2 l_1^2 l_2^2 left m_1 + m_2 sin^2(theta_1 - theta_2) right \n qquadqquad vphantomfracll - g (m_1 + m_2) l_1 costheta_1 - g m_2 l_2 costheta_2 \nendalign*","category":"page"},{"location":"double_pendulum/#Library-functions","page":"Double Pendulum","title":"Library functions","text":"","category":"section"},{"location":"double_pendulum/","page":"Double Pendulum","title":"Double Pendulum","text":"GeometricProblems.DoublePendulum","category":"page"},{"location":"double_pendulum/#GeometricProblems.DoublePendulum","page":"Double Pendulum","title":"GeometricProblems.DoublePendulum","text":"DoublePendulum\n\nThe DoublePendulum module provides functions hodeproblem and lodeproblem each returning a Hamiltonian or Lagrangian problem, respectively, to be solved in the GeometricIntegrators.jl ecosystem. The actual code is generated with EulerLagrange.jl.\n\nThe double pendulum consists of two pendula, one attached to the origin at (xy) = (00), and the second attached to the first. Each pendulum consists of a point mass m_i attached to a massless rod of length l_i with i in (12). The dynamics of the system is described in terms of the angles theta_i between the rods l_i and the vertical axis y. All motion is assumed to be frictionless.\n\nSystem parameters:\n\nl₁: length of rod 1\nl₂: length of rod 2\nm₁: mass of pendulum 1\nm₂: mass of pendulum 2\ng: gravitational constant\n\n\n\n\n\n","category":"module"},{"location":"double_pendulum/","page":"Double Pendulum","title":"Double Pendulum","text":"Modules = [GeometricProblems.DoublePendulum]\nOrder = [:constant, :type, :macro, :function]","category":"page"},{"location":"double_pendulum/#GeometricProblems.DoublePendulum.hodeproblem","page":"Double Pendulum","title":"GeometricProblems.DoublePendulum.hodeproblem","text":"Hamiltonian problem for the double pendulum\n\nConstructor with default arguments:\n\nhodeproblem(\n q₀ = [π/4, π/2],\n p₀ = [3.3321622036187746, 7.0685834705770345];\n tspan = (0.0, 10.0),\n tstep = 0.01,\n params = (l₁ = 2.0, l₂ = 3.0, m₁ = 1.0, m₂ = 2.0, g = 9.80665)\n)\n\n\n\n\n\n","category":"function"},{"location":"double_pendulum/#GeometricProblems.DoublePendulum.lodeproblem","page":"Double Pendulum","title":"GeometricProblems.DoublePendulum.lodeproblem","text":"Lagrangian problem for the double pendulum\n\nConstructor with default arguments:\n\nlodeproblem(\n q₀ = [π/4, π/2],\n p₀ = [3.3321622036187746, 7.0685834705770345];\n tspan = (0.0, 10.0),\n tstep = 0.01,\n params = (l₁ = 2.0, l₂ = 3.0, m₁ = 1.0, m₂ = 2.0, g = 9.80665)\n)\n\n\n\n\n\n","category":"function"},{"location":"coupled_harmonic_oscillator/#Coupled-Harmonic-Oscillator","page":"Coupled Harmonic Oscillator","title":"Coupled Harmonic Oscillator","text":"","category":"section"},{"location":"coupled_harmonic_oscillator/","page":"Coupled Harmonic Oscillator","title":"Coupled Harmonic Oscillator","text":"This system describes two harmonic oscillators that are coupled nonlinearly. ","category":"page"},{"location":"coupled_harmonic_oscillator/#Library-functions","page":"Coupled Harmonic Oscillator","title":"Library functions","text":"","category":"section"},{"location":"coupled_harmonic_oscillator/","page":"Coupled Harmonic Oscillator","title":"Coupled Harmonic Oscillator","text":"GeometricProblems.CoupledHarmonicOscillator","category":"page"},{"location":"coupled_harmonic_oscillator/#GeometricProblems.CoupledHarmonicOscillator","page":"Coupled Harmonic Oscillator","title":"GeometricProblems.CoupledHarmonicOscillator","text":"CoupledHarmonicOscillator\n\nThe CoupledHarmonicOscillator module provides functions hodeproblem and lodeproblem each returning a Hamiltonian or Lagrangian problem, respectively, to be solved in the GeometricIntegrators.jl ecosystem. The actual code is generated with EulerLagrange.jl.\n\nThe coupled harmonic oscillator is a collection of two point masses that are connected to a fixed wall with spring constants k_1 and k_2 and are furthermore coupled nonlinearly resulting in the Hamiltonian: \n\nH(q_1 q_2 p_1 p_2) = fracq_1^22m_1 + fracq_2^22m_2 + k_1fracq_1^22 + k_2fracq_2^22 + ksigma(q_1)frac(q_2 - q_1)^22\n\nwhere sigma(x) = 1 (1 + e^-x) is the sigmoid activation function. \n\nSystem parameters:\n\nk₁: spring constant of mass 1\nk₂: spring constant of mass 2\nm₁: mass 1\nm₂: mass 2\nk: coupling strength between the two masses. \n\n\n\n\n\n","category":"module"},{"location":"coupled_harmonic_oscillator/","page":"Coupled Harmonic Oscillator","title":"Coupled Harmonic Oscillator","text":"Modules = [GeometricProblems.CoupledHarmonicOscillator]\nOrder = [:constant, :type, :macro, :function]","category":"page"},{"location":"coupled_harmonic_oscillator/#GeometricProblems.CoupledHarmonicOscillator.hodeproblem","page":"Coupled Harmonic Oscillator","title":"GeometricProblems.CoupledHarmonicOscillator.hodeproblem","text":"Hamiltonian problem for coupled oscillator\n\nConstructor with default arguments:\n\nhodeproblem(\n q₀ = [1.0, 0.0],\n p₀ = [2.0, 0.0];\n tspan = (0.0, 100.0),\n tstep = 0.4,\n params = (m₁ = 2.0, m₂ = 1.0, k₁ = 1.5, k₂ = 0.3, k = 1.0)\n)\n\n\n\n\n\n","category":"function"},{"location":"coupled_harmonic_oscillator/#GeometricProblems.CoupledHarmonicOscillator.lodeproblem","page":"Coupled Harmonic Oscillator","title":"GeometricProblems.CoupledHarmonicOscillator.lodeproblem","text":"Lagrangian problem for the coupled oscillator\n\nConstructor with default arguments:\n\nlodeproblem(\n q₀ = [1.0, 0.0],\n p₀ = [2.0, 0.0];\n tspan = (0.0, 100.0),\n tstep = 0.4,\n params = (m₁ = 2.0, m₂ = 1.0, k₁ = 1.5, k₂ = 0.3, k = 1.0)\n)\n\n\n\n\n\n","category":"function"},{"location":"abc_flow/#ABC-Flow","page":"ABC Flow","title":"ABC Flow","text":"","category":"section"},{"location":"abc_flow/","page":"ABC Flow","title":"ABC Flow","text":"The ABC flow (see [1]) is described by a divergence-free differential equation whose flow strongly depends on the initial condition. ","category":"page"},{"location":"abc_flow/","page":"ABC Flow","title":"ABC Flow","text":"using GeometricIntegrators: integrate, ImplicitMidpoint\nusing GeometricProblems.ABCFlow\nusing Plots\n\nensemble_solution = integrate(odeensemble(), ImplicitMidpoint())\n\np = plot()\nfor solution in ensemble_solution\n plot!(p, solution.q[:, 1], solution.q[:, 2], solution.q[:, 3])\nend\np","category":"page"},{"location":"abc_flow/#Library-functions","page":"ABC Flow","title":"Library functions","text":"","category":"section"},{"location":"abc_flow/","page":"ABC Flow","title":"ABC Flow","text":"GeometricProblems.ABCFlow","category":"page"},{"location":"abc_flow/#GeometricProblems.ABCFlow","page":"ABC Flow","title":"GeometricProblems.ABCFlow","text":"ABC Flow\n\nbeginaligned\n dotx = Asin(z) + Ccos(y) \n doty = Bsin(x) + Acos(z) \n dotz = Csin(y) + Bcos(x)\nendaligned\n\n\n\n\n\n","category":"module"},{"location":"abc_flow/","page":"ABC Flow","title":"ABC Flow","text":"Modules = [GeometricProblems.ABCFlow]\nOrder = [:constant, :type, :macro, :function]","category":"page"},{"location":"abc_flow/","page":"ABC Flow","title":"ABC Flow","text":"E. Hairer, C. Lubich and G. Wanner. Geometric Numerical integration: structure-preserving algorithms for ordinary differential equations (Springer, Berlin, 2006).\n\n\n\n","category":"page"},{"location":"lotka_volterra_4d/#Lotka-Volterra-4d","page":"Lotka-Volterra 4d","title":"Lotka-Volterra 4d","text":"","category":"section"},{"location":"lotka_volterra_4d/","page":"Lotka-Volterra 4d","title":"Lotka-Volterra 4d","text":"Modules = [GeometricProblems.LotkaVolterra4d]\nOrder = [:constant, :type, :macro, :function]","category":"page"},{"location":"massless_charged_particle/#Massless-Charged-Particle","page":"Massless Charged Particle","title":"Massless Charged Particle","text":"","category":"section"},{"location":"massless_charged_particle/","page":"Massless Charged Particle","title":"Massless Charged Particle","text":"GeometricProblems.MasslessChargedParticle","category":"page"},{"location":"massless_charged_particle/#GeometricProblems.MasslessChargedParticle","page":"Massless Charged Particle","title":"GeometricProblems.MasslessChargedParticle","text":"Massless charged particle in 2D\n\nThe Lagrangian is given by\n\nL(x dotx) = A(x) cdot dotx - phi (x) \n\nwith magnetic vector potential\n\nA(x) = fracA_02 big( 1 + x_1^2 + x_2^2 big) beginpmatrix\n- x_2 \n+ x_1 \nendpmatrix \n\nelectrostatic potential\n\nphi(x) = E_0 big( cos (x_1) + sin(x_2) big) \n\nand magnetic and electric fields\n\nbeginaligned\nB(x) = nabla times A(x) = A_0 (1 + 2 x_1^2 + 2 x_2^2) \nE(x) = - nabla phi(x) = E_0 big( sin x_1 - cos x_2 big)^T \nendaligned\n\nThe Hamiltonian form of the equations of motion reads\n\ndotx = frac1B(x) beginpmatrix\nhphantom- 0 + 1 \n- 1 hphantom+ 0 \nendpmatrix nabla phi (x) \n\n\n\n\n\n","category":"module"},{"location":"massless_charged_particle/","page":"Massless Charged Particle","title":"Massless Charged Particle","text":"using Plots\nusing GeometricIntegrators\nusing GeometricProblems.MasslessChargedParticle\nusing GeometricProblems.MasslessChargedParticlePlots\n\node = odeproblem()\nsol = integrate(ode, Gauss(1))\n\nplot_massless_charged_particle(sol, ode)\nsavefig(\"massless_charged_particle.svg\")\n\nnothing","category":"page"},{"location":"massless_charged_particle/","page":"Massless Charged Particle","title":"Massless Charged Particle","text":"(Image: )","category":"page"},{"location":"massless_charged_particle/","page":"Massless Charged Particle","title":"Massless Charged Particle","text":"Modules = [GeometricProblems.MasslessChargedParticle]\nOrder = [:constant, :type, :macro, :function]","category":"page"},{"location":"massless_charged_particle/#GeometricProblems.MasslessChargedParticle.idaeproblem","page":"Massless Charged Particle","title":"GeometricProblems.MasslessChargedParticle.idaeproblem","text":"Creates an implicit DAE object for the massless charged particle in 2D.\n\n\n\n\n\n","category":"function"},{"location":"massless_charged_particle/#GeometricProblems.MasslessChargedParticle.idaeproblem_spark","page":"Massless Charged Particle","title":"GeometricProblems.MasslessChargedParticle.idaeproblem_spark","text":"Creates an implicit DAE object for the massless charged particle in 2D.\n\n\n\n\n\n","category":"function"},{"location":"massless_charged_particle/#GeometricProblems.MasslessChargedParticle.iodeproblem","page":"Massless Charged Particle","title":"GeometricProblems.MasslessChargedParticle.iodeproblem","text":"Creates an implicit ODE object for the massless charged particle in 2D.\n\n\n\n\n\n","category":"function"},{"location":"massless_charged_particle/#GeometricProblems.MasslessChargedParticle.odeproblem","page":"Massless Charged Particle","title":"GeometricProblems.MasslessChargedParticle.odeproblem","text":"Creates an ODE object for the massless charged particle in 2D.\n\n\n\n\n\n","category":"function"},{"location":"lotka_volterra_3d/#Lotka-Volterra-3d","page":"Lotka-Volterra 3d","title":"Lotka-Volterra 3d","text":"","category":"section"},{"location":"lotka_volterra_3d/","page":"Lotka-Volterra 3d","title":"Lotka-Volterra 3d","text":"GeometricProblems.LotkaVolterra3d","category":"page"},{"location":"lotka_volterra_3d/#GeometricProblems.LotkaVolterra3d","page":"Lotka-Volterra 3d","title":"GeometricProblems.LotkaVolterra3d","text":"Lotka-Volterra Model in 3D\n\nThe Lotka–Volterra model in 3D is an example of a Hamiltonian system with degenerate Poisson structure.\n\nThe equations read\n\nbeginaligned\ndotq_1 = q_1 ( - a_2 q_2 + a_3 q_3 - b_2 + b_3 ) \ndotq_2 = q_2 ( hphantom- a_1 q_1 - a_3 q_3 + b_1 - b_3 ) \ndotq_3 = q_3 ( - a_1 q_1 + a_2 q_2 - b_1 + b_2 ) \nendaligned\n\nwhich can be written in Poisson-form as\n\ndotq = P(q) nabla H(q) \n\nwith Poisson matrix\n\nP(q) = beginpmatrix\n 0 - q_1 q_2 hphantom- q_1 q_3 \nhphantom- q_1 q_2 0 - q_2 q_3 \n- q_1 q_3 hphantom- q_2 q_3 0 \nendpmatrix \n\nand Hamiltonian\n\nH(q) = a_1 q_1 + a_2 q_2 + a_3 q_3 + b_1 ln q_1 + b_2 ln q_2 + b_3 ln q_3 \n\nReferences:\n\nA. M. Perelomov. Selected topics on classical integrable systems, Troisième cycle de la physique, expanded version of lectures delivered in May 1995.\nYuri B. Suris. Integrable discretizations for lattice systems: local equations of motion and their Hamiltonian properties, Rev. Math. Phys. 11, pp. 727–822, 1999.\n\n\n\n\n\n","category":"module"},{"location":"lotka_volterra_3d/","page":"Lotka-Volterra 3d","title":"Lotka-Volterra 3d","text":"Modules = [GeometricProblems.LotkaVolterra3d]\nOrder = [:constant, :type, :macro, :function]","category":"page"},{"location":"diagnostics/#Diagnostics","page":"Diagnostics","title":"Diagnostics","text":"","category":"section"},{"location":"diagnostics/","page":"Diagnostics","title":"Diagnostics","text":"Modules = [GeometricProblems.Diagnostics]\nOrder = [:constant, :type, :macro, :function]","category":"page"},{"location":"diagnostics/#GeometricProblems.Diagnostics.compute_error_drift-Union{Tuple{T}, Tuple{GeometricSolutions.TimeSeries, GeometricSolutions.ScalarDataSeries{T}}, Tuple{GeometricSolutions.TimeSeries, GeometricSolutions.ScalarDataSeries{T}, Any}} where T","page":"Diagnostics","title":"GeometricProblems.Diagnostics.compute_error_drift","text":"Computes the drift in an invariant error.\n\nArguments: (t::TimeSeries, invariant_error::DataSeries{T,1}, interval_length=100)\n\nThe 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.\n\nThis 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.\n\n\n\n\n\n","category":"method"},{"location":"diagnostics/#GeometricProblems.Diagnostics.compute_invariant-Union{Tuple{T}, Tuple{GeometricSolutions.TimeSeries, GeometricSolutions.DataSeries{T, AT} where AT<:Union{AbstractArray{T}, T}, GeometricSolutions.DataSeries{T, AT} where AT<:Union{AbstractArray{T}, T}, Union{Function, Type}}} where T","page":"Diagnostics","title":"GeometricProblems.Diagnostics.compute_invariant","text":"Compute an invariant for the solution of a partitioned ODE or DAE system.\n\nArguments: (t::TimeSeries, q::DataSeries{T}, p::DataSeries{T}, invariant::Base.Callable)\n\nThe invariant functions needs to take three arguments (t,q,p) and return the corresponding value of the invariant.\n\nReturns a ScalarDataSeries holding the time series of the invariant.\n\n\n\n\n\n","category":"method"},{"location":"diagnostics/#GeometricProblems.Diagnostics.compute_invariant-Union{Tuple{T}, Tuple{GeometricSolutions.TimeSeries, GeometricSolutions.DataSeries{T, AT} where AT<:Union{AbstractArray{T}, T}, Union{Function, Type}}} where T","page":"Diagnostics","title":"GeometricProblems.Diagnostics.compute_invariant","text":"Compute an invariant for the solution of an ODE or DAE system.\n\nArguments: (t::TimeSeries, q::DataSeries{T}, invariant::Base.Callable)\n\nThe invariant functions needs to take two arguments (t,q) and return the corresponding value of the invariant.\n\nReturns a ScalarDataSeries holding the time series of the invariant.\n\n\n\n\n\n","category":"method"},{"location":"diagnostics/#GeometricProblems.Diagnostics.compute_invariant_error-Tuple{GeometricSolutions.TimeSeries, GeometricSolutions.DataSeries, Union{Function, Type}}","page":"Diagnostics","title":"GeometricProblems.Diagnostics.compute_invariant_error","text":"Compute the relative error of an invariant for the solution of an ODE or DAE system.\n\nArguments: (t::TimeSeries, q::DataSeries{T}, invariant::Base.Callable)\n\nThe invariant functions needs to take two arguments (t,q) and return the corresponding value of the invariant.\n\nReturns a tuple of two 1d DataSeries holding the time series of the invariant and the relativ error, respectively.\n\n\n\n\n\n","category":"method"},{"location":"diagnostics/#GeometricProblems.Diagnostics.compute_invariant_error-Union{Tuple{T}, Tuple{GeometricSolutions.TimeSeries, GeometricSolutions.DataSeries{T, AT} where AT<:Union{AbstractArray{T}, T}, GeometricSolutions.DataSeries{T, AT} where AT<:Union{AbstractArray{T}, T}, Union{Function, Type}}} where T","page":"Diagnostics","title":"GeometricProblems.Diagnostics.compute_invariant_error","text":"Compute the relative error of an invariant for the solution of a partitioned ODE or DAE system.\n\nArguments: (t::TimeSeries, q::DataSeries{T}, p::DataSeries{T}, invariant::Base.Callable)\n\nThe invariant functions needs to take three arguments (t,q,p) and return the corresponding value of the invariant.\n\nReturns a tuple of two ScalarDataSeries holding the time series of the invariant and the relativ error, respectively.\n\n\n\n\n\n","category":"method"},{"location":"diagnostics/#GeometricProblems.Diagnostics.compute_momentum_error-Union{Tuple{DT}, Tuple{GeometricSolutions.DataSeries{DT, AT} where AT<:Union{AbstractArray{DT}, DT}, GeometricSolutions.DataSeries{DT, AT} where AT<:Union{AbstractArray{DT}, DT}}} where DT","page":"Diagnostics","title":"GeometricProblems.Diagnostics.compute_momentum_error","text":"Computes the difference of the momentum and the one-form of an implicit ODE or DAE system.\n\nArguments: (p::DataSeries{DT}, ϑ::DataSeries{DT})\n\nReturns a DataSeries similar to p holding the time series of the difference between p and ϑ.\n\n\n\n\n\n","category":"method"},{"location":"diagnostics/#GeometricProblems.Diagnostics.compute_one_form-Tuple{GeometricSolutions.TimeSeries, GeometricSolutions.DataSeries, Union{Function, Type}}","page":"Diagnostics","title":"GeometricProblems.Diagnostics.compute_one_form","text":"Compute the one-form (symplectic potential) for the solution of a Lagrangian system.\n\nArguments: (t::TimeSeries, q::DataSeries, one_form::Base.Callable)\n\nThe one_form function needs to take three arguments (t,q,k) where k is the index of the one-form component.\n\nReturns a DataSeries similar to q holding the time series of the one-form.\n\n\n\n\n\n","category":"method"},{"location":"diagnostics/#GeometricProblems.Diagnostics.compute_relative_error-Union{Tuple{GeometricSolutions.ScalarDataSeries{T}}, Tuple{T}} where T","page":"Diagnostics","title":"GeometricProblems.Diagnostics.compute_relative_error","text":"Takes a ScalarDataSeries holding an invariant and computes the relative error (inv(t)-inv(0))/inv(0).\n\nReturns a ScalarDataSeries similar to the argument holding the time series of the relativ errors.\n\n\n\n\n\n","category":"method"},{"location":"kepler_problem/#Kepler-Problem","page":"Kepler Problem","title":"Kepler Problem","text":"","category":"section"},{"location":"pendulum/#Mathematical-Pendulum","page":"Mathematical Pendulum","title":"Mathematical Pendulum","text":"","category":"section"},{"location":"pendulum/","page":"Mathematical Pendulum","title":"Mathematical Pendulum","text":"Modules = [GeometricProblems.Pendulum]\nOrder = [:constant, :type, :macro, :function]","category":"page"},{"location":"releasenotes/#Release-Notes","page":"Release Notes","title":"Release Notes","text":"","category":"section"},{"location":"releasenotes/#0.1.1","page":"Release Notes","title":"0.1.1","text":"","category":"section"},{"location":"releasenotes/#New-Features","page":"Release Notes","title":"New Features","text":"","category":"section"},{"location":"releasenotes/","page":"Release Notes","title":"Release Notes","text":"Poincaré invariants for Lotka-Volterra 2d model\nMore equation types for massless charged particle","category":"page"},{"location":"releasenotes/#Fixes","page":"Release Notes","title":"Fixes","text":"","category":"section"},{"location":"releasenotes/","page":"Release Notes","title":"Release Notes","text":"Fixes in general plot recipes","category":"page"},{"location":"releasenotes/#0.1.0","page":"Release Notes","title":"0.1.0","text":"","category":"section"},{"location":"releasenotes/","page":"Release Notes","title":"Release Notes","text":"Initial release with equations for","category":"page"},{"location":"releasenotes/","page":"Release Notes","title":"Release Notes","text":"Exponential Growth,\nLorenz Attractor in 3D,\nLotka-Volterra in 2D,\nLotka-Volterra in 3D,\nLotka-Volterra in 4D,\nMassless Charged Particle,\nHarmonic Oscillator,\nMathematical Pendulum,\nPlanar Point Vortices.","category":"page"},{"location":"nonlinear_oscillators/#Nonlinear-Oscillators","page":"Nonlinear Oscillators","title":"Nonlinear Oscillators","text":"","category":"section"},{"location":"nonlinear_oscillators/#Duffing-Oscillator","page":"Nonlinear Oscillators","title":"Duffing Oscillator","text":"","category":"section"},{"location":"nonlinear_oscillators/","page":"Nonlinear Oscillators","title":"Nonlinear Oscillators","text":"GeometricProblems.DuffingOscillator","category":"page"},{"location":"nonlinear_oscillators/#GeometricProblems.DuffingOscillator","page":"Nonlinear Oscillators","title":"GeometricProblems.DuffingOscillator","text":"\n\n\n\n","category":"module"},{"location":"nonlinear_oscillators/","page":"Nonlinear Oscillators","title":"Nonlinear Oscillators","text":"Modules = [GeometricProblems.DuffingOscillator]\nOrder = [:constant, :type, :macro, :function]","category":"page"},{"location":"nonlinear_oscillators/#Lennard-Jones-Oscillator","page":"Nonlinear Oscillators","title":"Lennard-Jones Oscillator","text":"","category":"section"},{"location":"nonlinear_oscillators/","page":"Nonlinear Oscillators","title":"Nonlinear Oscillators","text":"GeometricProblems.LennardJonesOscillator","category":"page"},{"location":"nonlinear_oscillators/#GeometricProblems.LennardJonesOscillator","page":"Nonlinear Oscillators","title":"GeometricProblems.LennardJonesOscillator","text":"\n\n\n\n","category":"module"},{"location":"nonlinear_oscillators/","page":"Nonlinear Oscillators","title":"Nonlinear Oscillators","text":"Modules = [GeometricProblems.LennardJonesOscillator]\nOrder = [:constant, :type, :macro, :function]","category":"page"},{"location":"nonlinear_oscillators/#Mathews-Lakshmanan-Oscillator","page":"Nonlinear Oscillators","title":"Mathews-Lakshmanan Oscillator","text":"","category":"section"},{"location":"nonlinear_oscillators/","page":"Nonlinear Oscillators","title":"Nonlinear Oscillators","text":"GeometricProblems.MathewsLakshmananOscillator","category":"page"},{"location":"nonlinear_oscillators/#GeometricProblems.MathewsLakshmananOscillator","page":"Nonlinear Oscillators","title":"GeometricProblems.MathewsLakshmananOscillator","text":"\n\n\n\n","category":"module"},{"location":"nonlinear_oscillators/","page":"Nonlinear Oscillators","title":"Nonlinear Oscillators","text":"Modules = [GeometricProblems.MathewsLakshmananOscillator]\nOrder = [:constant, :type, :macro, :function]","category":"page"},{"location":"nonlinear_oscillators/#Morse-Oscillator","page":"Nonlinear Oscillators","title":"Morse Oscillator","text":"","category":"section"},{"location":"nonlinear_oscillators/","page":"Nonlinear Oscillators","title":"Nonlinear Oscillators","text":"GeometricProblems.MorseOscillator","category":"page"},{"location":"nonlinear_oscillators/#GeometricProblems.MorseOscillator","page":"Nonlinear Oscillators","title":"GeometricProblems.MorseOscillator","text":"\n\n\n\n","category":"module"},{"location":"nonlinear_oscillators/","page":"Nonlinear Oscillators","title":"Nonlinear Oscillators","text":"Modules = [GeometricProblems.MorseOscillator]\nOrder = [:constant, :type, :macro, :function]","category":"page"},{"location":"henon_heiles/#Henon-Heiles-System","page":"Hénon-Heiles System","title":"Hénon-Heiles System","text":"","category":"section"},{"location":"lotka_volterra_2d/#Lotka-Volterra-2d","page":"Lotka-Volterra 2d","title":"Lotka-Volterra 2d","text":"","category":"section"},{"location":"lotka_volterra_2d/","page":"Lotka-Volterra 2d","title":"Lotka-Volterra 2d","text":"Lotka–Volterra models are used in mathematical biology for modelling population dynamics of animal species, as well as many other fields where predator-prey and similar models appear. The dynamics of the growth of two interacting species can be modelled by the following noncanonical Hamiltonian system","category":"page"},{"location":"lotka_volterra_2d/","page":"Lotka-Volterra 2d","title":"Lotka-Volterra 2d","text":"dotq = beginpmatrix\nhphantom- 0 + q_1 q_2 \n- q_1 q_2 hphantom+ 0 \nendpmatrix\nnabla H (q) \nquad\nH (q) = a_1 q_1 + a_2 q_2 + b_1 log q_1 + b_2 log q_2 ","category":"page"},{"location":"lotka_volterra_2d/","page":"Lotka-Volterra 2d","title":"Lotka-Volterra 2d","text":"using Plots\nusing GeometricIntegrators\nusing GeometricProblems.LotkaVolterra2d\nusing GeometricProblems.LotkaVolterra2dPlots\n\node = odeproblem()\nsol = integrate(ode, Gauss(1))\n\nplot_lotka_volterra_2d(sol, ode)\nsavefig(\"lotka_volterra_2d.svg\")\n\nnothing","category":"page"},{"location":"lotka_volterra_2d/","page":"Lotka-Volterra 2d","title":"Lotka-Volterra 2d","text":"(Image: )","category":"page"},{"location":"lotka_volterra_2d/#Sub-models","page":"Lotka-Volterra 2d","title":"Sub-models","text":"","category":"section"},{"location":"lotka_volterra_2d/","page":"Lotka-Volterra 2d","title":"Lotka-Volterra 2d","text":"The Euler-Lagrange equations of the Lotka-Volterra model can be obtained from different Lagrangians, which are connected by gauge transformations. Although they all lead to the same equations of motion, they lead to different variational integrators. Therefore different models based on different Lagrangians are implemented.","category":"page"},{"location":"lotka_volterra_2d/","page":"Lotka-Volterra 2d","title":"Lotka-Volterra 2d","text":"GeometricProblems.LotkaVolterra2d","category":"page"},{"location":"lotka_volterra_2d/#GeometricProblems.LotkaVolterra2d","page":"Lotka-Volterra 2d","title":"GeometricProblems.LotkaVolterra2d","text":"Lotka-Volterra model in 2D\n\nbeginaligned\nL (q dotq) = bigg( q_2 + fraclog q_2q_1 bigg) dotq_1 + q_1 dotq_2 - H(q) \nH(q) = a_1 q_1 + a_2 q_2 + b_1 log q_1 + b_2 log q_2\nendaligned\n\n\n\n\n\n","category":"module"},{"location":"lotka_volterra_2d/","page":"Lotka-Volterra 2d","title":"Lotka-Volterra 2d","text":"GeometricProblems.LotkaVolterra2dSymmetric","category":"page"},{"location":"lotka_volterra_2d/#GeometricProblems.LotkaVolterra2dSymmetric","page":"Lotka-Volterra 2d","title":"GeometricProblems.LotkaVolterra2dSymmetric","text":"Lotka-Volterra model in 2D with symmetric Lagrangian\n\nbeginaligned\nL (q dotq) = frac12 fraclog q_2q_1 dotq_1 - frac12 fraclog q_1q_2 dotq_2 - H(q) \nH(q) = a_1 q_1 + a_2 q_2 + b_1 log q_1 + b_2 log q_2\nendaligned\n\nThis Lagrangian is a slight generalization of Equation (5) in José Fernández-Núñez, Lagrangian Structure of the Two-Dimensional Lotka-Volterra System, International Journal of Theoretical Physics, Vol. 37, No. 9, pp. 2457-2462, 1998.\n\n\n\n\n\n","category":"module"},{"location":"lotka_volterra_2d/","page":"Lotka-Volterra 2d","title":"Lotka-Volterra 2d","text":"GeometricProblems.LotkaVolterra2dSingular","category":"page"},{"location":"lotka_volterra_2d/#GeometricProblems.LotkaVolterra2dSingular","page":"Lotka-Volterra 2d","title":"GeometricProblems.LotkaVolterra2dSingular","text":"Lotka-Volterra model in 2D with \"singular\" Lagrangian\n\nbeginaligned\nL (q dotq) = fraclog q_2q_1 dotq_1 - H(q) \nH(q) = a_1 q_1 + a_2 q_2 + b_1 log q_1 + b_2 log q_2\nendaligned\n\nThis Lagrangian is equivalent to the Lagrangian of the symmetric Lotka-Volterra model. It differs only by a gauge transformation with the term - 12 d(log(q_1) log(q_2))dt. It leads to the same Euler-Lagrange equations but to a different variational integrator.\n\n\n\n\n\n","category":"module"},{"location":"lotka_volterra_2d/","page":"Lotka-Volterra 2d","title":"Lotka-Volterra 2d","text":"GeometricProblems.LotkaVolterra2dGauge","category":"page"},{"location":"lotka_volterra_2d/#GeometricProblems.LotkaVolterra2dGauge","page":"Lotka-Volterra 2d","title":"GeometricProblems.LotkaVolterra2dGauge","text":"Lotka-Volterra model in 2D with symmetric Lagrangian with gauge term\n\nbeginaligned\nL (q dotq) = bigg( q_2 + frac12 fraclog q_2q_1 bigg) dotq_1 + bigg( q_1 - frac12 fraclog q_1q_2 bigg) dotq_2 - H(q) \nH(q) = a_1 q_1 + a_2 q_2 + b_1 log q_1 + b_2 log q_2\nendaligned\n\nThis Lagrangian is equivalent to the Lagrangian of the symmetric Lotka-Volterra model. It differs only by a gauge transformation with the term d(q_1 q_2)dt. It leads to the same Euler-Lagrange equations but to a different variational integrator.\n\n\n\n\n\n","category":"module"},{"location":"lotka_volterra_2d/#User-Functions","page":"Lotka-Volterra 2d","title":"User Functions","text":"","category":"section"},{"location":"lotka_volterra_2d/","page":"Lotka-Volterra 2d","title":"Lotka-Volterra 2d","text":"Modules = [GeometricProblems.LotkaVolterra2d]\nOrder = [:constant, :type, :macro, :function]","category":"page"},{"location":"lotka_volterra_2d/#GeometricProblems.LotkaVolterra2d.daeproblem","page":"Lotka-Volterra 2d","title":"GeometricProblems.LotkaVolterra2d.daeproblem","text":"Creates a DAE object for the Lotka-Volterra 2D model.\n\n\n\n\n\n","category":"function"},{"location":"lotka_volterra_2d/#GeometricProblems.LotkaVolterra2d.hdaeproblem","page":"Lotka-Volterra 2d","title":"GeometricProblems.LotkaVolterra2d.hdaeproblem","text":"Creates a Hamiltonian DAE object for the Lotka-Volterra 2D model.\n\n\n\n\n\n","category":"function"},{"location":"lotka_volterra_2d/#GeometricProblems.LotkaVolterra2d.hodeproblem","page":"Lotka-Volterra 2d","title":"GeometricProblems.LotkaVolterra2d.hodeproblem","text":"Creates a Hamiltonian ODE object for the Lotka-Volterra 2D model.\n\n\n\n\n\n","category":"function"},{"location":"lotka_volterra_2d/#GeometricProblems.LotkaVolterra2d.idaeproblem","page":"Lotka-Volterra 2d","title":"GeometricProblems.LotkaVolterra2d.idaeproblem","text":"Creates an implicit DAE object for the Lotka-Volterra 2D model.\n\n\n\n\n\n","category":"function"},{"location":"lotka_volterra_2d/#GeometricProblems.LotkaVolterra2d.idaeproblem_spark","page":"Lotka-Volterra 2d","title":"GeometricProblems.LotkaVolterra2d.idaeproblem_spark","text":"Creates an implicit DAE object for the Lotka-Volterra 2D model.\n\n\n\n\n\n","category":"function"},{"location":"lotka_volterra_2d/#GeometricProblems.LotkaVolterra2d.iodeproblem","page":"Lotka-Volterra 2d","title":"GeometricProblems.LotkaVolterra2d.iodeproblem","text":"Creates an implicit ODE object for the Lotka-Volterra 2D model.\n\n\n\n\n\n","category":"function"},{"location":"lotka_volterra_2d/#GeometricProblems.LotkaVolterra2d.iodeproblem_dg","page":"Lotka-Volterra 2d","title":"GeometricProblems.LotkaVolterra2d.iodeproblem_dg","text":"Creates an implicit ODE object for the Lotka-Volterra 2D model for use with DG integrators.\n\n\n\n\n\n","category":"function"},{"location":"lotka_volterra_2d/#GeometricProblems.LotkaVolterra2d.ldaeproblem","page":"Lotka-Volterra 2d","title":"GeometricProblems.LotkaVolterra2d.ldaeproblem","text":"Creates a variational DAE object for the Lotka-Volterra 2D model.\n\n\n\n\n\n","category":"function"},{"location":"lotka_volterra_2d/#GeometricProblems.LotkaVolterra2d.ldaeproblem_slrk","page":"Lotka-Volterra 2d","title":"GeometricProblems.LotkaVolterra2d.ldaeproblem_slrk","text":"Creates a variational DAE object for the Lotka-Volterra 2D model for use with SLRK integrators.\n\n\n\n\n\n","category":"function"},{"location":"lotka_volterra_2d/#GeometricProblems.LotkaVolterra2d.lodeproblem","page":"Lotka-Volterra 2d","title":"GeometricProblems.LotkaVolterra2d.lodeproblem","text":"Creates a variational ODE object for the Lotka-Volterra 2D model.\n\n\n\n\n\n","category":"function"},{"location":"lotka_volterra_2d/#GeometricProblems.LotkaVolterra2d.odeproblem","page":"Lotka-Volterra 2d","title":"GeometricProblems.LotkaVolterra2d.odeproblem","text":"Creates an ODE object for the Lotka-Volterra 2D model.\n\n\n\n\n\n","category":"function"},{"location":"lotka_volterra_2d/#GeometricProblems.LotkaVolterra2d.pdaeproblem","page":"Lotka-Volterra 2d","title":"GeometricProblems.LotkaVolterra2d.pdaeproblem","text":"Creates a partitioned DAE object for the Lotka-Volterra 2D model.\n\n\n\n\n\n","category":"function"},{"location":"lotka_volterra_2d/#GeometricProblems.LotkaVolterra2d.podeproblem","page":"Lotka-Volterra 2d","title":"GeometricProblems.LotkaVolterra2d.podeproblem","text":"Creates a partitioned ODE object for the Lotka-Volterra 2D model.\n\n\n\n\n\n","category":"function"},{"location":"lotka_volterra_2d/#Plotting-Functions","page":"Lotka-Volterra 2d","title":"Plotting Functions","text":"","category":"section"},{"location":"lotka_volterra_2d/","page":"Lotka-Volterra 2d","title":"Lotka-Volterra 2d","text":"Modules = [GeometricProblems.LotkaVolterra2dPlots]\nOrder = [:constant, :type, :macro, :function]","category":"page"},{"location":"lotka_volterra_2d/#GeometricProblems.LotkaVolterra2dPlots.plot_lotka_volterra_2d!-Tuple","page":"Lotka-Volterra 2d","title":"GeometricProblems.LotkaVolterra2dPlots.plot_lotka_volterra_2d!","text":"Plots the solution of a 2D Lotka-Volterra model together with the energy error.\n\nArguments:\n\nsol <: GeometricSolution\nequ <: GeometricProblem\n\nKeyword aguments:\n\nnplot=1: plot every nplotth time step\nxlims=:auto: xlims for solution plot\nylims=:auto: ylims for solution plot\nlatex=true: use LaTeX guides\n\n\n\n\n\n","category":"method"},{"location":"lotka_volterra_2d/#GeometricProblems.LotkaVolterra2dPlots.plot_lotka_volterra_2d!-Tuple{RecipesBase.AbstractPlot, Vararg{Any}}","page":"Lotka-Volterra 2d","title":"GeometricProblems.LotkaVolterra2dPlots.plot_lotka_volterra_2d!","text":"Plots the solution of a 2D Lotka-Volterra model together with the energy error.\n\nArguments:\n\nsol <: GeometricSolution\nequ <: GeometricProblem\n\nKeyword aguments:\n\nnplot=1: plot every nplotth time step\nxlims=:auto: xlims for solution plot\nylims=:auto: ylims for solution plot\nlatex=true: use LaTeX guides\n\n\n\n\n\n","category":"method"},{"location":"lotka_volterra_2d/#GeometricProblems.LotkaVolterra2dPlots.plot_lotka_volterra_2d-Tuple","page":"Lotka-Volterra 2d","title":"GeometricProblems.LotkaVolterra2dPlots.plot_lotka_volterra_2d","text":"Plots the solution of a 2D Lotka-Volterra model together with the energy error.\n\nArguments:\n\nsol <: GeometricSolution\nequ <: GeometricProblem\n\nKeyword aguments:\n\nnplot=1: plot every nplotth time step\nxlims=:auto: xlims for solution plot\nylims=:auto: ylims for solution plot\nlatex=true: use LaTeX guides\n\n\n\n\n\n","category":"method"},{"location":"lotka_volterra_2d/#GeometricProblems.LotkaVolterra2dPlots.plot_lotka_volterra_2d_solution!-Tuple","page":"Lotka-Volterra 2d","title":"GeometricProblems.LotkaVolterra2dPlots.plot_lotka_volterra_2d_solution!","text":"Plots the solution of a 2D Lotka-Volterra model.\n\nArguments:\n\nsol <: GeometricSolution\nequ <: GeometricProblem\n\nKeyword aguments:\n\nnplot=1: plot every nplotth time step\nxlims=:auto: xlims for solution plot\nylims=:auto: ylims for solution plot\nlatex=true: use LaTeX guides\n\n\n\n\n\n","category":"method"},{"location":"lotka_volterra_2d/#GeometricProblems.LotkaVolterra2dPlots.plot_lotka_volterra_2d_solution!-Tuple{RecipesBase.AbstractPlot, Vararg{Any}}","page":"Lotka-Volterra 2d","title":"GeometricProblems.LotkaVolterra2dPlots.plot_lotka_volterra_2d_solution!","text":"Plots the solution of a 2D Lotka-Volterra model.\n\nArguments:\n\nsol <: GeometricSolution\nequ <: GeometricProblem\n\nKeyword aguments:\n\nnplot=1: plot every nplotth time step\nxlims=:auto: xlims for solution plot\nylims=:auto: ylims for solution plot\nlatex=true: use LaTeX guides\n\n\n\n\n\n","category":"method"},{"location":"lotka_volterra_2d/#GeometricProblems.LotkaVolterra2dPlots.plot_lotka_volterra_2d_solution-Tuple","page":"Lotka-Volterra 2d","title":"GeometricProblems.LotkaVolterra2dPlots.plot_lotka_volterra_2d_solution","text":"Plots the solution of a 2D Lotka-Volterra model.\n\nArguments:\n\nsol <: GeometricSolution\nequ <: GeometricProblem\n\nKeyword aguments:\n\nnplot=1: plot every nplotth time step\nxlims=:auto: xlims for solution plot\nylims=:auto: ylims for solution plot\nlatex=true: use LaTeX guides\n\n\n\n\n\n","category":"method"},{"location":"lotka_volterra_2d/#GeometricProblems.LotkaVolterra2dPlots.plot_lotka_volterra_2d_traces!-Tuple","page":"Lotka-Volterra 2d","title":"GeometricProblems.LotkaVolterra2dPlots.plot_lotka_volterra_2d_traces!","text":"Plots time traces of the solution of a 2D Lotka-Volterra model and its energy error.\n\nArguments:\n\nsol <: GeometricSolution\nequ <: GeometricProblem\n\nKeyword aguments:\n\nnplot=1: plot every nplotth time step\nlatex=true: use LaTeX guides\n\n\n\n\n\n","category":"method"},{"location":"lotka_volterra_2d/#GeometricProblems.LotkaVolterra2dPlots.plot_lotka_volterra_2d_traces!-Tuple{RecipesBase.AbstractPlot, Vararg{Any}}","page":"Lotka-Volterra 2d","title":"GeometricProblems.LotkaVolterra2dPlots.plot_lotka_volterra_2d_traces!","text":"Plots time traces of the solution of a 2D Lotka-Volterra model and its energy error.\n\nArguments:\n\nsol <: GeometricSolution\nequ <: GeometricProblem\n\nKeyword aguments:\n\nnplot=1: plot every nplotth time step\nlatex=true: use LaTeX guides\n\n\n\n\n\n","category":"method"},{"location":"lotka_volterra_2d/#GeometricProblems.LotkaVolterra2dPlots.plot_lotka_volterra_2d_traces-Tuple","page":"Lotka-Volterra 2d","title":"GeometricProblems.LotkaVolterra2dPlots.plot_lotka_volterra_2d_traces","text":"Plots time traces of the solution of a 2D Lotka-Volterra model and its energy error.\n\nArguments:\n\nsol <: GeometricSolution\nequ <: GeometricProblem\n\nKeyword aguments:\n\nnplot=1: plot every nplotth time step\nlatex=true: use LaTeX guides\n\n\n\n\n\n","category":"method"},{"location":"point_vortices/#Planar-Point-Vortices","page":"Point Vortices","title":"Planar Point Vortices","text":"","category":"section"},{"location":"point_vortices/","page":"Point Vortices","title":"Point Vortices","text":"Modules = [GeometricProblems.PointVortices]\nOrder = [:constant, :type, :macro, :function]","category":"page"},{"location":"inner_solar_system/#Inner-Solar-System","page":"Inner Solar System","title":"Inner Solar System","text":"","category":"section"},{"location":"outer_solar_system/#Outer-Solar-System","page":"Outer Solar System","title":"Outer Solar System","text":"","category":"section"},{"location":"toda_lattice/#Toda-Lattice","page":"Toda Lattice","title":"Toda Lattice","text":"","category":"section"},{"location":"toda_lattice/","page":"Toda Lattice","title":"Toda Lattice","text":"The Toda lattice is a prime example of an completely-integrable system, i.e. a Hamiltonian system evolving in mathbbR^2n that has n Poisson-commuting invariants of motion (see [2]). It is named after Morikazu Toda who used it to model a one-dimensional crystal [3].","category":"page"},{"location":"toda_lattice/","page":"Toda Lattice","title":"Toda Lattice","text":"The Hamiltonian of the Toda lattice takes the following form: ","category":"page"},{"location":"toda_lattice/","page":"Toda Lattice","title":"Toda Lattice","text":" H(q p) = sum_ninmathbbZleft( fracp_n^22 + alpha e^q_n - q_n+1 right)","category":"page"},{"location":"toda_lattice/","page":"Toda Lattice","title":"Toda Lattice","text":"In practice we work with a finite number of particles N and impose periodic boundary conditions: ","category":"page"},{"location":"toda_lattice/","page":"Toda Lattice","title":"Toda Lattice","text":"beginaligned\n q_n+N equiv q_n \n p_n+N equiv p_n\nendaligned","category":"page"},{"location":"toda_lattice/","page":"Toda Lattice","title":"Toda Lattice","text":"Hence we have: ","category":"page"},{"location":"toda_lattice/","page":"Toda Lattice","title":"Toda Lattice","text":" H(q p) = sum_n=1^N-1 left( fracp_n^22 + alpha e^q_n - q_n+1 right) + fracp_N^22 + alpha e^q_N - q_1","category":"page"},{"location":"toda_lattice/","page":"Toda Lattice","title":"Toda Lattice","text":"We can model the evolution of a thin pulse in this system:","category":"page"},{"location":"toda_lattice/","page":"Toda Lattice","title":"Toda Lattice","text":"using GeometricProblems, GeometricIntegrators, Plots # hide\n\nproblem = GeometricProblems.TodaLattice.hodeproblem() \nsol = integrate(problem, ImplicitMidpoint())\n\ntime_steps = (0, 200, 400, 600, 800, 1000, 1200)\np = plot()\nfor time_step in time_steps\n plot!(p, sol.q[time_step, :], label = \"t = $(sol.t[time_step])\")\nend\n\np","category":"page"},{"location":"toda_lattice/","page":"Toda Lattice","title":"Toda Lattice","text":"As we can see the thin pulse separates into two smaller pulses an they start traveling in opposite directions until they meet again at time tapprox120. ","category":"page"},{"location":"toda_lattice/#Library-functions","page":"Toda Lattice","title":"Library functions","text":"","category":"section"},{"location":"toda_lattice/","page":"Toda Lattice","title":"Toda Lattice","text":"GeometricProblems.TodaLattice","category":"page"},{"location":"toda_lattice/#GeometricProblems.TodaLattice","page":"Toda Lattice","title":"GeometricProblems.TodaLattice","text":"The Toda lattice is a model for a one-dimensional crystal named after its discoverer Morikazu Toda [3].\n\nIt is a prime example of a non-trivial completely integrable system.\n\nThe only system parameters are the number of points N in the periodic lattice and \\alpha which adjusts the strength of the interactions in the lattice.\n\n\n\n\n\n","category":"module"},{"location":"toda_lattice/","page":"Toda Lattice","title":"Toda Lattice","text":"V. I. Arnold. Mathematical methods of classical mechanics. Vol. 60 of Graduate Texts in Mathematics (Springer Verlag, Berlin, 1978).\n\n\n\nM. Toda. Vibration of a chain with nonlinear interaction. Journal of the Physical Society of Japan 22, 431–436 (1967).\n\n\n\n","category":"page"},{"location":"harmonic_oscillator/#Harmonic-Oscillator","page":"Harmonic Oscillator","title":"Harmonic Oscillator","text":"","category":"section"},{"location":"harmonic_oscillator/","page":"Harmonic Oscillator","title":"Harmonic Oscillator","text":"Modules = [GeometricProblems.HarmonicOscillator]\nOrder = [:constant, :type, :macro, :function]","category":"page"},{"location":"#GeometricProblems.jl","page":"Home","title":"GeometricProblems.jl","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"GeometricProblems.jl is a collection of ODEs and DAEs with interesting geometric structures together with useful diagnostics and plotting tools.","category":"page"},{"location":"","page":"Home","title":"Home","text":"(Image: PkgEval Status) (Image: CI) (Image: Build Status) (Image: Coverage Status) (Image: codecov) (Image: DOI)","category":"page"},{"location":"","page":"Home","title":"Home","text":"Typical structures are","category":"page"},{"location":"","page":"Home","title":"Home","text":"Variational structure, i.e., the equations can defined in terms of a Lagrangian function and be obtained from an action principle;\nHamiltonian structure, i.e., the equations can be defined in terms of a Hamiltonian function together with a symplectic or Poisson matrix;\nInvariants, i.e., the equations have symmetries and associated conservation laws;\nVolume preservation, i.e., the flow of the equations is divergence-free.","category":"page"},{"location":"#Contents","page":"Home","title":"Contents","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Pages = [\n\"diagnostics.md\",\n\"abc_flow.md\",\n\"coupled_harmonic_oscillator.md\",\n\"henon_heiles.md\",\n\"kepler_problem.md\",\n\"lorenz_attractor.md\",\n\"lotka_volterra_2d.md\",\n\"lotka_volterra_3d.md\",\n\"lotka_volterra_4d.md\",\n\"massless_charged_particle.md\",\n\"harmonic_oscillator.md\",\n\"nonlinear_oscillators.md\",\n\"pendulum.md\",\n\"double_pendulum.md\",\n\"point_vortices.md\",\n\"inner_solar_system.md\",\n\"outer_solar_system.md\",\n\"toda_lattice.md\"\n]\nDepth = 1","category":"page"},{"location":"#References","page":"Home","title":"References","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"If you use the figures or implementations provided here, please consider citing GeometricIntegrators.jl as","category":"page"},{"location":"","page":"Home","title":"Home","text":"@misc{Kraus:2020:GeometricIntegratorsRepo,\n title={GeometricIntegrators.jl: Geometric Numerical Integration in Julia},\n author={Kraus, Michael},\n year={2020},\n howpublished={\\url{https://github.com/JuliaGNI/GeometricIntegrators.jl}},\n doi={10.5281/zenodo.3648325}\n}","category":"page"},{"location":"","page":"Home","title":"Home","text":"as well as this repository as","category":"page"},{"location":"","page":"Home","title":"Home","text":"@misc{Kraus:2020:GeometricProblemsRepo,\n title={GeometricProblems.jl: Collection of Differential Equations with Geometric Structure.},\n author={Kraus, Michael},\n year={2020},\n howpublished={\\url{https://github.com/JuliaGNI/GeometricProblems.jl}},\n doi={10.5281/zenodo.4285904}\n}","category":"page"},{"location":"#Figure-License","page":"Home","title":"Figure License","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Copyright (c) Michael Kraus All figures are licensed under the Creative Commons CC BY-NC-SA 4.0 License.","category":"page"},{"location":"#Software-License","page":"Home","title":"Software License","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Copyright (c) Michael Kraus Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","category":"page"},{"location":"lorenz_attractor/#Lorenz-Attractor-in-3d","page":"Lorenz Attractor","title":"Lorenz Attractor in 3d","text":"","category":"section"},{"location":"lorenz_attractor/","page":"Lorenz Attractor","title":"Lorenz Attractor","text":"Modules = [GeometricProblems.LorenzAttractor]\nOrder = [:constant, :type, :macro, :function]","category":"page"}] } diff --git a/latest/toda_lattice/179762d8.svg b/latest/toda_lattice/81cb3e78.svg similarity index 89% rename from latest/toda_lattice/179762d8.svg rename to latest/toda_lattice/81cb3e78.svg index 3a6d3a4..55c4f40 100644 --- a/latest/toda_lattice/179762d8.svg +++ b/latest/toda_lattice/81cb3e78.svg @@ -1,58 +1,58 @@ - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/latest/toda_lattice/index.html b/latest/toda_lattice/index.html index 098d7ae..0ed3d6e 100644 --- a/latest/toda_lattice/index.html +++ b/latest/toda_lattice/index.html @@ -11,4 +11,4 @@ plot!(p, sol.q[time_step, :], label = "t = $(sol.t[time_step])") end -pExample block output

As we can see the thin pulse separates into two smaller pulses an they start traveling in opposite directions until they meet again at time $t\approx120$.

Library functions

GeometricProblems.TodaLatticeModule

The Toda lattice is a model for a one-dimensional crystal named after its discoverer Morikazu Toda [3].

It is a prime example of a non-trivial completely integrable system.

The only system parameters are the number of points $N$ in the periodic lattice and \alpha which adjusts the strength of the interactions in the lattice.

source
[2]
V. I. Arnold. Mathematical methods of classical mechanics. Vol. 60 of Graduate Texts in Mathematics (Springer Verlag, Berlin, 1978).
[3]
M. Toda. Vibration of a chain with nonlinear interaction. Journal of the Physical Society of Japan 22, 431–436 (1967).
+pExample block output

As we can see the thin pulse separates into two smaller pulses an they start traveling in opposite directions until they meet again at time $t\approx120$.

Library functions

GeometricProblems.TodaLatticeModule

The Toda lattice is a model for a one-dimensional crystal named after its discoverer Morikazu Toda [3].

It is a prime example of a non-trivial completely integrable system.

The only system parameters are the number of points $N$ in the periodic lattice and \alpha which adjusts the strength of the interactions in the lattice.

source
[2]
V. I. Arnold. Mathematical methods of classical mechanics. Vol. 60 of Graduate Texts in Mathematics (Springer Verlag, Berlin, 1978).
[3]
M. Toda. Vibration of a chain with nonlinear interaction. Journal of the Physical Society of Japan 22, 431–436 (1967).