Update interface.py
Browse files- interface.py +6 -8
interface.py
CHANGED
@@ -164,18 +164,16 @@ class BioprocessModel:
|
|
164 |
print(f"Fitting {model_type} model with function: {func} and parameters: {params}")
|
165 |
|
166 |
# Define the fitting function based on model type
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
def fit_func(t, *args):
|
172 |
-
return func(t, *args)
|
173 |
|
174 |
# Depuración: Verificar el número de parámetros que se espera ajustar
|
175 |
print(f"Number of parameters to fit: {len(params)}")
|
176 |
-
|
177 |
try:
|
178 |
-
#
|
179 |
popt, _ = curve_fit(fit_func, time, data, bounds=bounds, maxfev=10000)
|
180 |
print(f"Optimal parameters found: {popt}")
|
181 |
|
|
|
164 |
print(f"Fitting {model_type} model with function: {func} and parameters: {params}")
|
165 |
|
166 |
# Define the fitting function based on model type
|
167 |
+
def fit_func(t, *args):
|
168 |
+
# Asegurarse de que se pasa el número correcto de parámetros
|
169 |
+
print(f"Calling fit_func with args: {args}")
|
170 |
+
return func(t, *args)
|
|
|
|
|
171 |
|
172 |
# Depuración: Verificar el número de parámetros que se espera ajustar
|
173 |
print(f"Number of parameters to fit: {len(params)}")
|
174 |
+
|
175 |
try:
|
176 |
+
# Intentar ajustar el modelo usando curve_fit
|
177 |
popt, _ = curve_fit(fit_func, time, data, bounds=bounds, maxfev=10000)
|
178 |
print(f"Optimal parameters found: {popt}")
|
179 |
|