Skip to main content

All Questions

0 votes
1 answer
150 views

Constrained linear regression: To find the optimal value of c, m1, m2, m3 in the equation y = c + m1*x1 + m2*x2 + m3*x3

I have a dataframe containing 4 columns. speed_20-40 speed_40-50 speed_50-60 fuel efficiency speed columns have values in percentage which signifies that what percentage duration the driver spent in ...
Abhishek Chowdhuri's user avatar
0 votes
1 answer
290 views

scipy.optimize.minimize SLSQP indirect constraints problem

I am struggling with minimize (method=SLSQL) and need help. This is a simplified car battery (dis)charging problem to prop up the power grid during reduced stability (peak demand). What I expect to ...
Andreas Schuldei's user avatar
0 votes
2 answers
808 views

How do I integrate a logical boolean constraint into the standard matrix form of a Mixed Integer Linear Problem in scipy.optimize.milp / linprog?

I want to implement boolean logic and dependent variables into a Mixed-Integer Linear Program with scipy.optimize.milp using a highs solver. How do I set the actual matrices and vectors c, A_ub, b_ub, ...
ABC's user avatar
  • 199
-2 votes
1 answer
263 views

Using linprog for solving a minimization problem

I've an absolute error loss function of the following form, This function is used to scale the set of data points lying on a curve f to the target curve g. I am trying to minimize the following ...
Natasha's user avatar
  • 1,531
0 votes
0 answers
74 views

Optimal transport for large source and destination nodes Scipy linear program

I want to solve an optimal transport for source and destination nodes of sizes 42000 and 18000 respectively. I know that Scipy Linear Programming Module now includes HIGHS so it should be pretty ...
indispinablenorm's user avatar
0 votes
1 answer
241 views

PuLP - Why cant you use a generator/list expression for UpBounds? "TypeError: must be real number, not list"

I am trying to code the upper bounds of a set of variables (x1, x2...xn) for my problem in Pulp. I already have a list of the upper bounds that i want to use. the problem is that a generator or list ...
beginner_python's user avatar
0 votes
0 answers
74 views

non-linear programming problem using python

I have this (non?) linear programming problem which am not sure on how to go about solving it. So i have the following variables x,y and their bounds: x_lower=[0,0,0,0,0,0] x_upper=[100,20,50,200,10,...
beginner_python's user avatar
0 votes
0 answers
246 views

scipy optimization model returns all nan solutions

I have the code below where I'm trying to calculate the max sharpe ratio solution to the efficient frontier. I'm trying to minimize the volatility and maximize the sharpe ratio (by minimizing the ...
user3476463's user avatar
  • 4,605
1 vote
0 answers
4k views

scipy.optimize with SLSQP. 'Singular matrix C in LSQ subproblem'

I'm trying to minimize a dot product of 2 vectors but it doesn't work and I have no idea why. Can someone please help me? I have a matrix c of this form: c = [[c11, c12, c13, c14, c15], [c21,...
Karol's user avatar
  • 45