The fit_celerity function currently allows negative weights. The following modification to add bounds ensures positive weights only. This also adds bounds to the allowable celerity limits - should these be added too to ensure the limits are physical?
The fit_celerity function currently allows negative weights. The following modification to add bounds ensures positive weights only. This also adds bounds to the allowable celerity limits - should these be added too to ensure the limits are physical?
popt, _ = curve_fit(rcel_func, 1.0 / cel_vals, rcel_pdf, p0=[0.0539, 0.0899, 0.8562, 1.0 / 0.327, 1.0 / 0.293, 1.0 / 0.26, 0.066, 0.08, 0.33],bounds=([0,0,0,1.0/0.375,1.0/0.375,1.0/0.375,0,0,0],[1,1,1,1.0/0.18,1.0/0.18,1.0/0.18,np.inf,np.inf,np.inf]))