Skip to content

Commit f9b30ad

Browse files
remove special problems
1 parent 044b6da commit f9b30ad

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

src/solve.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@ function init{uType,tType,isinplace,algType<:Union{AbstractRODEAlgorithm,Abstrac
4949
save_everystep = save_timeseries
5050
end
5151

52-
if prob.mass_matrix != I
52+
if typeof(prob.f)<:Tuple
53+
if min((mm != I for mm in prob.mass_matrix)...)
54+
error("This solver is not able to use mass matrices.")
55+
end
56+
elseif prob.mass_matrix != I
5357
error("This solver is not able to use mass matrices.")
5458
end
5559

test/iif_methods.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ no_noise = (t,u) -> 0.0
1111
f1_no_noise = (t,u) -> μ
1212
(p::typeof(f1_no_noise))(::Type{Val{:analytic}},t,u0,W) = u0.*exp.(2μ*t)
1313

14-
prob = SplitSDEProblem((f1,f2),σ,1/2,(0.0,1.0))
15-
no_noise_prob = SplitSDEProblem((f1_no_noise,f2),no_noise,1/2,(0.0,1.0))
14+
prob = SDEProblem((f1,f2),σ,1/2,(0.0,1.0))
15+
no_noise_prob = SDEProblem((f1_no_noise,f2),no_noise,1/2,(0.0,1.0))
1616

1717
sol = solve(prob,IIF1M(),dt=1/10)
1818

@@ -69,7 +69,7 @@ function (p::typeof(f1))(::Type{Val{:analytic}},t,u0,W)
6969
end
7070
f2 = (t,u,du) -> du .= μ .* u
7171

72-
prob = SplitSDEProblem((f1,f2),σ,u0,(0.0,1.0),noise_rate_prototype=rand(2,2))
72+
prob = SDEProblem((f1,f2),σ,u0,(0.0,1.0),noise_rate_prototype=rand(2,2))
7373

7474
f1_no_noise = (t,u,du) -> A
7575
f2 = (t,u,du) -> du .= μ .* u
@@ -80,7 +80,7 @@ function (p::typeof(f1_no_noise))(::Type{Val{:analytic}},t,u0,W)
8080
tmp = (A+1.01I)*t
8181
expm(tmp)*u0
8282
end
83-
prob_no_noise = SplitSDEProblem((f1_no_noise,f2),σ,u0,(0.0,1.0),noise_rate_prototype=rand(2,2))
83+
prob_no_noise = SDEProblem((f1_no_noise,f2),σ,u0,(0.0,1.0),noise_rate_prototype=rand(2,2))
8484

8585

8686
sol = solve(prob,IIF1M(),dt=1/10)

test/split_tests.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ f2 = (t,u) -> (1.01)/2 * u
66
σ = (t,u) -> 0.87u
77
#(p::typeof(f))(::Type{Val{:analytic}},t,u0,W) = u0.*exp.(0.63155t+0.87W)
88

9-
prob = SplitSDEProblem((f1,f2),σ,1/2,(0.0,1.0))
9+
prob = SDEProblem((f1,f2),σ,1/2,(0.0,1.0))
1010

1111
sol = solve(prob,SplitEM(),dt=1/10)
1212

@@ -17,7 +17,7 @@ sol2 = solve(prob,EM(),dt=1/10)
1717
@test sol[:] sol2[:]
1818

1919
u0 = rand(4)
20-
prob = SplitSDEProblem((f1,f2),σ,u0,(0.0,1.0))
20+
prob = SDEProblem((f1,f2),σ,u0,(0.0,1.0))
2121

2222
sol = solve(prob,SplitEM(),dt=1/10)
2323

0 commit comments

Comments
 (0)