Mar-06-2022, 10:09 AM
The error message is clear. The 'least_squares' function expects 'system1' to return a 1-d array_like. Looking in the documentation, it is said that
I suggest that you check the shape of the value returned by
Quote:The argument x passed to this function is an ndarray of shape (n,) (never a scalar, even for n=1). It must allocate and return a 1-D array_like of shape (m,) or a scalar.
I suggest that you check the shape of the value returned by
system1()
and raise an exception if it is not a tuple with one element like (m,) to understand the problem.