0

I do not know how to set up and solve the following linear optimization problem in Python. Can you help?

R and Beta are vectors of length n with known constants.

x is a vector of length n but is unknown - to be optimized.

constraints:

`B * x = 200 cross product (elementwise product then sum)

x(i)>0

find optimal values in vector x such that we maximize:

max(R * x)

It seems to be not a very complicated, but I did not succeed setting up the problem in the scipy library. Any help is appreciated.

3
  • How is the multiplication B * x defined? You say vectors, do you mean mathematical ones? if so, are you talking about the cross product of vector B and x (which is the one the spits out a number) or maybe something else? Commented Feb 11, 2021 at 15:05
  • Thanks, updated the question. Yes , cross product then obtaining one scalar from the the sum of the elementwise multiplication Commented Feb 13, 2021 at 13:46
  • You can use the @ operator then Commented Jul 27, 2021 at 8:32

1 Answer 1

1

That looks like a linear programming problem, take a look into the scipy library to solve that.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.