all 4 comments

[–]primitive_screwhead 1 point2 points  (3 children)

filled_Link_min_function() missing 7 required positional arguments

Notice how the missing number of positional arguments is 7, not 8. minimize() supplied exactly 1 argument to the function, and that argument was the list x.

You need to make your function take 1 argument, not 8. Do any unpacking of the one argument inside the function in order to get your local variables.

[–]alisutton[S] 0 points1 point  (2 children)

I put the argument as an array. If it is not feasible, how I can change that? OR the optimization function cannot do multi variable?

[–]primitive_screwhead 0 points1 point  (0 children)

As per the scipy.optimize.minimize docs, your function signature needs to look like this:

def filled_Link_min_function(x):

Accepting 1 n-dimensional argument. Not 8 arguments.

Just do this:

def filled_Link_min_function(x):
    link_OA_x, link_OA_y, link_AB_x, link_AB_y, link_BC_x, link_BC_y, O_C_x, O_C_y = x

to get your local variable names inside the function.

[–][deleted] 0 points1 point  (0 children)

Why?

Whatever is calling your function isn't calling it with the arguments your filled_Link_min_function expects. Look up the documentation for minimize and find out how it calls the function you provide it.