Closed
Description
problem
there is WET code in singlediode_methods where the inputs to i_from_v and v_from_i are manipulated for the newton method
solution
according to this comment here's a nice snippet:
def _prepare_newton_inputs(i_or_v, args, v0):
size, shape = _get_size_and_shape((i_or_v,) + args)
if size > 1:
args = [np.asarray(arg) for arg in args]
# newton uses initial guess for the output shape
# copy v0 to a new array and broadcast it to the shape of max size
if shape is not None:
v0 = np.broadcast_to(v0, shape).copy()
else:
v0 = voc_est
return args, v0
alternatives
do nothing
Additional context
see #409
Metadata
Metadata
Assignees
Labels
No labels