Nov-30-2020, 02:03 PM
Hello, I have one (I think easy) question about including arrays as inputs in a function. I need to do a maximization problem of an objective function with thousands of variables. I could write the objective function manually but I hope there is an alternative. Especifically, I would like to do something like this:
def my_function(x):
return x[1]*0.8 + x[2]*0,5 + ... + x[n]*b_n
where x is a vector of n variables, and b is a vector of n parameters. Is there any way to do something like this?:
def my_function(x):
return x*b
where we have previously defined the vector of parameters b.
Thanks
def my_function(x):
return x[1]*0.8 + x[2]*0,5 + ... + x[n]*b_n
where x is a vector of n variables, and b is a vector of n parameters. Is there any way to do something like this?:
def my_function(x):
return x*b
where we have previously defined the vector of parameters b.
Thanks