Skip to content

Instantly share code, notes, and snippets.

@ronisbr
Created August 20, 2018 22:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ronisbr/719ebe00acf19b56ccc6d2eb9d3052bd to your computer and use it in GitHub Desktop.
Save ronisbr/719ebe00acf19b56ccc6d2eb9d3052bd to your computer and use it in GitHub Desktop.
Test OrdinaryDiffEq suing Vector
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