Skip to content

Commit 82f7131

Browse files
test for correctness from problem expr builders
1 parent b7b1a97 commit 82f7131

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

test/sdesystem.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ f = SDEFunction(de)
2323
prob = SDEProblem(SDEFunction(de),f.g,[1.0,0.0,0.0],(0.0,100.0),(10.0,26.0,2.33))
2424
sol = solve(prob,SRIW1())
2525

26+
probexpr = SDEProblem(SDEFunction(de),f.g,[1.0,0.0,0.0],(0.0,100.0),(10.0,26.0,2.33))
27+
solexpr = solve(eval(probexpr),SRIW1())
28+
29+
@test all(x->x==0,Array(sol-solexpr))
30+
2631
noiseeqs_nd = [0.01*x 0.01*x*y 0.02*x*z
2732
σ 0.01*y 0.02*x*z
2833
ρ β 0.01*z ]

test/steadystatesystems.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,7 @@ for factor in [1e-1, 1e0, 1e10], u0_p in [(2.34,2.676),(22.34,1.632),(.3,15.676)
1414
ss_prob = SteadyStateProblem(de,u0,p)
1515
sol = solve(ss_prob,SSRootfind()).u[1]
1616
@test abs(sol^2 - factor*u0_p[2]) < 1e-8
17+
ss_prob = SteadyStateProblemExpr(de,u0,p)
18+
sol_expr = solve(eval(ss_prob),SSRootfind()).u[1]
19+
@test all(x->x==0,Array(sol-sol_expr))
1720
end

0 commit comments

Comments
 (0)