pulp

Python Pulp Solver: How to use compare signs (>= or <=) as variables in equation?

Python Pulp Solver: How to use compare signs (>= or <=) as variables in equation? Question: Hello I am trying to develop a Python Pulp Linear Programming solver which is not hard-coded but instead takes all input from the user. I have successfully done the part of objective function but I am having problem with …

Total answers: 1

Python PulP linear optimisation for off-grid PV and battery system

Python PulP linear optimisation for off-grid PV and battery system Question: I’m trying to use linear optimisation to minimise the size of solar PV and battery for an off-grid property. I have solar irradiance data and household energy consumption data – I have created a year’s worth (8760 data points) of the data below. I …

Total answers: 1

How do I generate PuLP variables and constrains without using exec?

How do I generate PuLP variables and constrains without using exec? Question: I have written the following Python Code using the PuLP Library for solving the Knapsack Problem using the Integer Programming formulation. I am using strings to generate the LpVariable commands and add the constraints and then executing them with eval. Is there a …

Total answers: 3

PuLP not printing output on IPython cell

PuLP not printing output on IPython cell Question: I am using PuLP and IPython/Jupyter Notebook for a project. I have the following cell of code: import pulp model = pulp.LpProblem(‘Example’, pulp.LpMinimize) x1 = pulp.LpVariable(‘x1′, lowBound=0, cat=’Integer’) x2 = pulp.LpVariable(‘x2′, lowBound=0, cat=’Integer’) model += -2*x1 – 3*x2 model += x1 + 2*x2 <= 7 model += …

Total answers: 2