Skip to content

Commit 5541863

Browse files
committed
Updated fsolve to work with arrays, as it's documented to do.
Handeled it the same way Scipy does: https://github.com/scipy/scipy/blob/11509c4a98edded6c59423ac44ca1b7f28fba1fd/scipy/optimize/minpack.py#L208.
1 parent 8054670 commit 5541863

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

code/modsim.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,8 @@ def fsolve(func, x0, *args, **kwargs):
347347
returns: solution as an array
348348
"""
349349
# make sure we can run the given function with x0
350+
x0 = np.asarray(x0).flatten()
351+
350352
try:
351353
func(x0, *args)
352354
except Exception as e:

0 commit comments

Comments
 (0)