--------------------------------------------------------------------------- ValueError Traceback (most recent call last) ~\AppData\Local\Temp/ipykernel_10624/2286624917.py in 19 20 fit = Fit(ode_model, t=tdata, a=adata, b=None) ---> 21 fit_result = fit.execute() 22 23 # Generate some data c:\users\mrani\appdata\local\programs\python\python39\lib\site-packages\symfit\core\fit.py in execute(self, **minimize_options) 582 :return: FitResults instance 583 """ --> 584 minimizer_ans = self.minimizer.execute(**minimize_options) 585 minimizer_ans.covariance_matrix = self.covariance_matrix( 586 dict(zip(self.model.params, minimizer_ans._popt)) c:\users\mrani\appdata\local\programs\python\python39\lib\site-packages\symfit\core\support.py in wrapped_func(*args, **kwargs) 425 else: 426 bound_args.arguments[param.name] = param.default --> 427 return func(*bound_args.args, **bound_args.kwargs) 428 return wrapped_func 429 c:\users\mrani\appdata\local\programs\python\python39\lib\site-packages\symfit\core\minimizers.py in execute(self, **minimize_options) 411 if jacobian is None: 412 jacobian = self.wrapped_jacobian --> 413 return super(ScipyGradientMinimize, self).execute(jacobian=jacobian, **minimize_options) 414 415 def scipy_constraints(self, constraints): c:\users\mrani\appdata\local\programs\python\python39\lib\site-packages\symfit\core\support.py in wrapped_func(*args, **kwargs) 425 else: 426 bound_args.arguments[param.name] = param.default --> 427 return func(*bound_args.args, **bound_args.kwargs) 428 return wrapped_func 429 c:\users\mrani\appdata\local\programs\python\python39\lib\site-packages\symfit\core\minimizers.py in execute(self, bounds, jacobian, hessian, constraints, **minimize_options) 348 usually be filled by a specific subclass. 349 """ --> 350 ans = minimize( 351 self.objective, 352 self.initial_guesses, c:\users\mrani\appdata\local\programs\python\python39\lib\site-packages\scipy\optimize\_minimize.py in minimize(fun, x0, args, method, jac, hess, hessp, bounds, constraints, tol, callback, options) 616 return _minimize_cg(fun, x0, args, jac, callback, **options) 617 elif meth == 'bfgs': --> 618 return _minimize_bfgs(fun, x0, args, jac, callback, **options) 619 elif meth == 'newton-cg': 620 return _minimize_newtoncg(fun, x0, args, jac, hess, hessp, callback, c:\users\mrani\appdata\local\programs\python\python39\lib\site-packages\scipy\optimize\optimize.py in _minimize_bfgs(fun, x0, args, jac, callback, gtol, norm, eps, maxiter, disp, return_all, finite_diff_rel_step, **unknown_options) 1199 maxiter = len(x0) * 200 1200 -> 1201 sf = _prepare_scalar_function(fun, x0, jac, args=args, epsilon=eps, 1202 finite_diff_rel_step=finite_diff_rel_step) 1203 c:\users\mrani\appdata\local\programs\python\python39\lib\site-packages\scipy\optimize\optimize.py in _prepare_scalar_function(fun, x0, jac, args, bounds, epsilon, finite_diff_rel_step, hess) 259 # ScalarFunction caches. Reuse of fun(x) during grad 260 # calculation reduces overall function evaluations. --> 261 sf = ScalarFunction(fun, x0, args, grad, hess, 262 finite_diff_rel_step, bounds, epsilon=epsilon) 263 c:\users\mrani\appdata\local\programs\python\python39\lib\site-packages\scipy\optimize\_differentiable_functions.py in __init__(self, fun, x0, args, grad, hess, finite_diff_rel_step, finite_diff_bounds, epsilon) 138 139 self._update_fun_impl = update_fun --> 140 self._update_fun() 141 142 # Gradient evaluation c:\users\mrani\appdata\local\programs\python\python39\lib\site-packages\scipy\optimize\_differentiable_functions.py in _update_fun(self) 231 def _update_fun(self): 232 if not self.f_updated: --> 233 self._update_fun_impl() 234 self.f_updated = True 235 c:\users\mrani\appdata\local\programs\python\python39\lib\site-packages\scipy\optimize\_differentiable_functions.py in update_fun() 135 136 def update_fun(): --> 137 self.f = fun_wrapped(self.x) 138 139 self._update_fun_impl = update_fun c:\users\mrani\appdata\local\programs\python\python39\lib\site-packages\scipy\optimize\_differentiable_functions.py in fun_wrapped(x) 132 # Overwriting results in undefined behaviour because 133 # fun(self.x) will change self.x, with the two no longer linked. --> 134 return fun(np.copy(x), *args) 135 136 def update_fun(): c:\users\mrani\appdata\local\programs\python\python39\lib\site-packages\symfit\core\support.py in wrapped_func(*args, **kwargs) 425 else: 426 bound_args.arguments[param.name] = param.default --> 427 return func(*bound_args.args, **bound_args.kwargs) 428 return wrapped_func 429 c:\users\mrani\appdata\local\programs\python\python39\lib\site-packages\symfit\core\objectives.py in __call__(self, ordered_parameters, **parameters) 310 """ 311 flatten_components = parameters.pop('flatten_components') --> 312 evaluated_func = super(LeastSquares, self).__call__( 313 ordered_parameters, **parameters 314 ) c:\users\mrani\appdata\local\programs\python\python39\lib\site-packages\symfit\core\objectives.py in __call__(self, ordered_parameters, **parameters) 93 result = self.model(**key2str(parameters))._asdict() 94 # Return only the components corresponding to the dependent data. ---> 95 return self._shape_of_dependent_data( 96 [comp for var, comp in result.items() 97 if var in self.model.dependent_vars] c:\users\mrani\appdata\local\programs\python\python39\lib\site-packages\symfit\core\objectives.py in _shape_of_dependent_data(self, model_output, param_level) 124 # Let numpy deal with all the broadcasting 125 shape = param_level * [n_params] + list(dep_data.shape) --> 126 shaped_result.append(np.broadcast_to(component, shape)) 127 else: 128 shaped_result.append(component) <__array_function__ internals> in broadcast_to(*args, **kwargs) c:\users\mrani\appdata\local\programs\python\python39\lib\site-packages\numpy\lib\stride_tricks.py in broadcast_to(array, shape, subok) 409 [1, 2, 3]]) 410 """ --> 411 return _broadcast_to(array, shape, subok=subok, readonly=True) 412 413 c:\users\mrani\appdata\local\programs\python\python39\lib\site-packages\numpy\lib\stride_tricks.py in _broadcast_to(array, shape, subok, readonly) 346 'negative') 347 extras = [] --> 348 it = np.nditer( 349 (array,), flags=['multi_index', 'refs_ok', 'zerosize_ok'] + extras, 350 op_flags=['readonly'], itershape=shape, order='C') ValueError: operands could not be broadcast together with remapped shapes [original->remapped]: (8,) and requested shape (7,)