Geometric integrators (Euler, symplectic-Euler, velocity-Verlet, position-Verlet and leapfrog) in Julia
You can use this module of GeometricIntegrators with Julia-1.6 and Julia-1.7.
Its homepage is https://github.com/t-nissie/GeometricIntegrators.jl .
GeometricIntegrators.jl is under continuous integration at Travis CI:
There are no dependencies, just install with
julia> using Pkg; Pkg.add(PackageSpec(url="https://github.com/t-nissie/GeometricIntegrators.jl", rev="master"));
You may also need to install Winston package.
julia> using Pkg; Pkg.add("Winston")
An example is in the end of src/GeometricIntegrators.jl
.
If you are using Julia-1.4 and
Winston (https://github.com/nolta/Winston.jl),
$ cd src/
$ julia GeometricIntegrators.jl
gives you an example plot of GeometricIntegrators.eps
.
test/harmonic_oscillator.jl
is an example of one-dimensional harmonic oscillator.
Execute harmonic_oscillator.jl
, then you will get harmonic_oscillator_??.eps
.
$ cd test/
$ julia --project harmonic_oscillator.jl
test/twobody.jl
is an example of two body problem.
Execute twobody.jl
, then you will get twobody_??.eps
as shown in Fig. 1.
$ cd test/
$ julia --project twobody.jl
FIG. 1. Trajectories of two bodies with masses M=2 and m=1.
Clone, test, then remove this package:
julia> using Pkg; Pkg.add(PackageSpec(url="https://github.com/t-nissie/GeometricIntegrators.jl", rev="master")); Pkg.test("GeometricIntegrators"); Pkg.rm("GeometricIntegrators")
From Pkg REPL-mode:
$ julia --project
julia> ]
(GeometricIntegrators) pkg> test
From command line:
$ julia --project -e 'using Pkg; Pkg.test()'
Prepare arrays of functions qdot and pdot.