Skip to content

Commit c970d4e

Browse files
authored
Fix fh tol (#74)
* add tolerance parameter in fh
1 parent 608eba5 commit c970d4e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/fh_model.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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)