This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
== 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# symplectic integration | |
## pedulum | |
using Winston | |
using ODE | |
# rhs | |
function pendulum(t, q) | |
return -sin(q) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# symplectic integration | |
## harmonic oscillator | |
using Winston | |
using ODE | |
# rhs | |
function harmonic_oscillator(t, q) | |
return -q | |
end |