Function es::fit_lewkowicz_speed(const Eigen::ArrayXd&, const Eigen::ArrayXd&, const Array5b&, const Array5d&, bool)¶
- Defined in File fit.h
Function Documentation¶
-
Array5d
es
::
fit_lewkowicz_speed
(const Eigen::ArrayXd &z, const Eigen::ArrayXd &u, const Array5b &fixed_params, const Array5d &initial_params, bool print_report = true) Determine best fit of Lewkowicz relation to input speed profile.
Robustly fits Lewkowicz speed relation \( u = f(z, \Pi, \kappa, U_{inf}, S, \delta_{c}) \) to input data \( u, z \).
An initial guess is required, and parameters can be fixed to help constrain the fitting process. See also fit_lewkowicz_speed(const Eigen::ArrayXd &z, const Eigen::ArrayXd &u, bool print_report = true) for providing a set of default values and fixed parameters.
Parameters are as follows:
pi_coles = params[0]
kappa = params[1]
u_inf = params[2]
shear_ratio = params[3]
delta_c = params[4]
The fitting process uses a Levenberg-Marquadt solver (provided by
ceres-solver
) with Automatic differentiation (for improved numeric stability and convergence over numerical differentiation approaches), and a Cauchy Loss function of parameter 0.5 (for robustness agains outlying data entries).- Return
- Array5d containing fitted values
[pi_coles, kappa, u_inf, shear_ratio, delta_c]
- Parameters
z
: Vertical locations in m (or normalised, if z_ref = 1.0)u
: Observed speeds at corresponding vertical locations, in m/sfixed_params
: Eigen::Array<bool, 5, 1>, logical mask, true where the parameter is fixed, false where it is allowed to varyinitial_params
: Eigen::Array<double, 5, 1> containing initial parameter values. These are used where fixed parameters are specifiedprint_report
: bool, default true. If true, the solver prints iterations summary and full final convergence and solution report (for debugging and validation purposes).