Skip to content

Commit b570b8c

Browse files
add a problem with a mass matrix
1 parent 918750e commit b570b8c

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/DiffEqProblemLibrary.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ include("premade_meshes.jl")
1414
export prob_ode_linear, prob_ode_bigfloatlinear, prob_ode_2Dlinear,
1515
prob_ode_large2Dlinear, prob_ode_bigfloat2Dlinear, prob_ode_rigidbody,
1616
prob_ode_2Dlinear_notinplace, prob_ode_vanderpol, prob_ode_vanderpol_stiff,
17-
prob_ode_lorenz, prob_ode_rober, prob_ode_threebody
17+
prob_ode_lorenz, prob_ode_rober, prob_ode_threebody, prob_ode_mm_linear
1818

1919
#SDE Example Problems
2020
export prob_sde_wave, prob_sde_linear, prob_sde_cubic, prob_sde_2Dlinear, prob_sde_lorenz,

src/ode_premade_problems.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,3 +366,13 @@ From Hairer Norsett Wanner Solving Ordinary Differential Euations I - Nonstiff P
366366
Usually solved from 0 to 3.
367367
"""
368368
prob_ode_pleides = ODEProblem(pleides,[3.0,3.0,-1.0,-3.0,2.0,-2.0,2.0,3.0,-3.0,2.0,0,0,-4.0,4.0,0,0,0,0,0,1.75,-1.5,0,0,0,-1.25,1,0,0],(0.0,3.0))
369+
370+
371+
srand(100)
372+
const mm_A = rand(4,4)
373+
mm_linear = function (t,u,du)
374+
A_mul_B!(du,mm_A,u)
375+
end
376+
const MM_linear =full(Diagonal(0.5ones(4)))
377+
(::typeof(mm_linear))(::Type{Val{:analytic}},t,u0) = expm(inv(MM_linear)*mm_A*t)*u0
378+
prob_ode_mm_linear = ODEProblem(mm_linear,rand(4),(0.0,1.0),mass_matrix=MM_linear)

0 commit comments

Comments
 (0)