File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 1
1
export fh_model, fh_nls_model
2
2
3
- function FH_smooth_term (; abstol = 1e-14 , reltol = 1e-14 )
3
+ function FH_smooth_term ()
4
4
# FH model = van-der-Pol oscillator when I = b = c = 0
5
5
# x' = μ(x - x^3/3 - y)
6
6
# y' = x/μ -> here μ = 12.5
@@ -29,7 +29,7 @@ function FH_smooth_term(; abstol = 1e-14, reltol = 1e-14)
29
29
data = noise .+ b
30
30
31
31
# solve FH with parameters p
32
- function simulate (p)
32
+ function simulate (p, abstol = 1e-14 , reltol = 1e-14 )
33
33
temp_prob = DifferentialEquations. remake (prob_FH, p = p)
34
34
sol = DifferentialEquations. solve (
35
35
temp_prob,
@@ -46,15 +46,15 @@ function FH_smooth_term(; abstol = 1e-14, reltol = 1e-14)
46
46
end
47
47
48
48
# define residual vector
49
- function residual (p)
50
- F = simulate (p)
49
+ function residual (p, args ... )
50
+ F = simulate (p, args ... )
51
51
F .- = data
52
52
return F
53
53
end
54
54
55
55
# misfit = ‖residual‖² / 2
56
- function misfit (p)
57
- F = residual (p)
56
+ function misfit (p, args ... )
57
+ F = residual (p, args ... )
58
58
return dot (F, F) / 2
59
59
end
60
60
You can’t perform that action at this time.
0 commit comments