Skip to content

Commit d45ea16

Browse files
committed
fix tolerance choice in fh
1 parent 5a539f9 commit d45ea16

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/fh_model.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export fh_model, fh_nls_model
22

3-
function FH_smooth_term(; abstol = 1e-14, reltol = 1e-14)
3+
function FH_smooth_term()
44
# FH model = van-der-Pol oscillator when I = b = c = 0
55
# x' = μ(x - x^3/3 - y)
66
# y' = x/μ -> here μ = 12.5
@@ -29,7 +29,7 @@ function FH_smooth_term(; abstol = 1e-14, reltol = 1e-14)
2929
data = noise .+ b
3030

3131
# solve FH with parameters p
32-
function simulate(p)
32+
function simulate(p, abstol = 1e-14, reltol = 1e-14)
3333
temp_prob = DifferentialEquations.remake(prob_FH, p = p)
3434
sol = DifferentialEquations.solve(
3535
temp_prob,
@@ -46,15 +46,15 @@ function FH_smooth_term(; abstol = 1e-14, reltol = 1e-14)
4646
end
4747

4848
# define residual vector
49-
function residual(p)
50-
F = simulate(p)
49+
function residual(p, args...)
50+
F = simulate(p, args...)
5151
F .-= data
5252
return F
5353
end
5454

5555
# misfit = ‖residual‖² / 2
56-
function misfit(p)
57-
F = residual(p)
56+
function misfit(p, args...)
57+
F = residual(p, args...)
5858
return dot(F, F) / 2
5959
end
6060

0 commit comments

Comments
 (0)