Created
August 20, 2018 22:31
-
-
Save ronisbr/719ebe00acf19b56ccc6d2eb9d3052bd to your computer and use it in GitHub Desktop.
Test OrdinaryDiffEq suing Vector
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 OrdinaryDiffEq | |
using StaticArrays | |
mutable struct SimWorkspace{T} <: DEDataVector{T} | |
x::MVector{2,T} | |
a::T | |
end | |
function dyn!(du,u,p,t) | |
du .= [0 1; | |
0 0]*u + [0;1]*u.a | |
u.a = t | |
end | |
s0 = SimWorkspace{Float64}(MVector{2,Float64}(0,0),1.) | |
prob = ODEProblem(dyn!, s0, (0.,10.) ) | |
sol = solve(prob,Tsit5()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment