Spaces:
Sleeping
Sleeping
Update app/api_utils.py
#21
by axelrvite - opened
- app/api_utils.py +3 -1
app/api_utils.py
CHANGED
|
@@ -98,7 +98,9 @@ def fit_after_model(I_list, V_list, params):
|
|
| 98 |
params_to_fit["Rs"] = min(max(params_to_fit["Rs"], bounds["Rs"][0]), bounds["Rs"][1])
|
| 99 |
params_to_fit["nVth"] = min(max(params_to_fit["nVth"], bounds["nVth"][0]), bounds["nVth"][1])
|
| 100 |
params_to_fit["J0"] = min(max(params_to_fit["J0"], bounds["J0"][0]), bounds["J0"][1])
|
| 101 |
-
|
|
|
|
|
|
|
| 102 |
popt, pcov = curve_fit(iv_curve, V_list[0], -I_list[0],
|
| 103 |
p0=list(params_to_fit.values()), bounds=(low_bounds, high_bounds), maxfev=10000)
|
| 104 |
param_fit = { "Rsh": popt[0],
|
|
|
|
| 98 |
params_to_fit["Rs"] = min(max(params_to_fit["Rs"], bounds["Rs"][0]), bounds["Rs"][1])
|
| 99 |
params_to_fit["nVth"] = min(max(params_to_fit["nVth"], bounds["nVth"][0]), bounds["nVth"][1])
|
| 100 |
params_to_fit["J0"] = min(max(params_to_fit["J0"], bounds["J0"][0]), bounds["J0"][1])
|
| 101 |
+
print("low", low_bounds)
|
| 102 |
+
print("high", high_bounds)
|
| 103 |
+
print("param", params_to_fit)
|
| 104 |
popt, pcov = curve_fit(iv_curve, V_list[0], -I_list[0],
|
| 105 |
p0=list(params_to_fit.values()), bounds=(low_bounds, high_bounds), maxfev=10000)
|
| 106 |
param_fit = { "Rsh": popt[0],
|