@@ -32,7 +32,7 @@ plot!(solution, alpha = 0.5)
3232# Ideal data
3333tsdata = Array (solution)
3434# Add noise to the data
35- noisy_data = tsdata + Float32 (1e-4 )* randn (eltype (tsdata), size (tsdata))
35+ noisy_data = tsdata + Float32 (1e-5 )* randn (eltype (tsdata), size (tsdata))
3636
3737plot (abs .(tsdata- noisy_data)' )
3838
@@ -133,7 +133,7 @@ basis = Basis(h, u)
133133# Create an optimizer for the SINDY problem
134134opt = SR3 ()
135135# Create the thresholds which should be used in the search process
136- λ = exp10 .(- 10 : 0.1 : 3 )
136+ λ = exp10 .(- 6 : 0.1 : 2 )
137137# Target function to choose the results from; x = L0 of coefficients and L2-Error of the model
138138f_target (x, w) = iszero (x[1 ]) ? Inf : norm (w.* x, 2 )
139139
@@ -143,12 +143,12 @@ println(Ψ)
143143print_equations (Ψ)
144144
145145# Test on ideal derivative data ( not available )
146- Ψ = SInDy (X[:, 5 : end ], L[:, 5 : end ], basis, λ, opt = opt, maxiter = 10000 , f_target = f_target) # Suceed
146+ Ψ = SInDy (X[:, 5 : end ], L[:, 5 : end ], basis, λ, opt = opt, maxiter = 10000 , f_target = f_target) # Succeed
147147println (Ψ)
148148print_equations (Ψ)
149149
150150# Test on uode derivative data
151- Ψ = SInDy (noisy_data [:, 2 : end ], L̂[:, 2 : end ], basis, λ, opt = opt, maxiter = 100000 , normalize = true , denoise = true , f_target = f_target) # Suceed
151+ Ψ = SInDy (X [:, 2 : end ], L̂[:, 2 : end ], basis, λ, opt = opt, maxiter = 10000 , normalize = true , denoise = true , f_target = f_target) # Succeed
152152println (Ψ)
153153print_equations (Ψ)
154154p̂ = parameters (Ψ)
@@ -161,7 +161,7 @@ unknown_eq = ODEFunction(unknown_sys)
161161# Just the equations
162162b = Basis ((u, p, t)-> unknown_eq (u, [1. ; 1. ], t), u)
163163# Retune for better parameters -> we could also use DiffEqFlux or other parameter estimation tools here.
164- Ψf = SInDy (noisy_data[:, 2 : end ], L̂[:, 2 : end ], b, opt = SR3 (0.01 ), maxiter = 100 , convergence_error = 1e-18 ) # Suceed
164+ Ψf = SInDy (noisy_data[:, 2 : end ], L̂[:, 2 : end ], b, opt = SR3 (0.01 ), maxiter = 100 , convergence_error = 1e-18 ) # Succeed
165165println (Ψf)
166166p̂ = parameters (Ψf)
167167
0 commit comments