Skip to content

Instantly share code, notes, and snippets.

@acroy
acroy / ode_custom_type.jl
Created Jun 14, 2014
Demonstrates how a custom type can be used with the solvers in ODE.jl
View ode_custom_type.jl
using ODE
import Base.norm # we will extend norm to support our new type
const delta0 = 0.
const V0 = 1.
const g0 = 0.
################################################################################
# define custom type ...
@acroy
acroy / perf_result.txt
Last active Nov 12, 2016
Some crude benchmarking for ODE.jl
View perf_result.txt
== problem A3 in DETEST ==
testing method ode23
elapsed time: 0.069644091 seconds (12007840 bytes allocated)
* number of steps: 307
* minimal step: 0.017235477520255074
* maximal step: 0.13251841618852822
* maximal deviation from known solution: 0.00024150339669093412
testing method ode23_bs
@acroy
acroy / example_pendulum.jl
Created Jan 27, 2014
example for symplectic integration with ODE.verlet : pendulum
View example_pendulum.jl
# symplectic integration
## pedulum
using Winston
using ODE
# rhs
function pendulum(t, q)
return -sin(q)
end
@acroy
acroy / example_ho.jl
Created Jan 27, 2014
example for symplectic integration with ODE.verlet : harmonic oscillator
View example_ho.jl
# symplectic integration
## harmonic oscillator
using Winston
using ODE
# rhs
function harmonic_oscillator(t, q)
return -q
end