optimization

Finding minimum iterative

Finding minimum iterative Question: sales_data = { ‘order_number’: [1001, 1002, 1003, 1004, 1005], ‘order_date’: [‘2022-02-01’, ‘2022-02-03’, ‘2022-02-07’, ‘2022-02-10’, ‘2022-02-14’] } sales_data = pd.DataFrame(sales_data) capacity_data = { ‘date’: pd.date_range(start=’2022-02-01′, end=’2022-02-28′, freq=’D’), ‘capacity’: [0, 0, 0, 1, 1, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200, 210, 220, 230, 240, 250, 260, 270, 280, …

Total answers: 2

Vectorize a For Loop that search for elements in another array

Vectorize a For Loop that search for elements in another array Question: I have two arrays that look like this: Array 1 (locs_array) is a 2D array containing pairs of values I call lon and lat e.g. array([[-122.463425, 47.195741], [-122.498139, 47.190166]]) Array 2 (parents_array) is also a 2D array containing the following columns [id, centerlon, …

Total answers: 1

Cplex optimization program returns results equal to zero

Cplex optimization program returns results equal to zero Question: I am currently working on an optimization problem in which a lake has 150 units of water. I am paid 3$ for each unit of water sold, but I need to guarantee that 100 units of water will remain at the end of the month or …

Total answers: 2

how to write a pyomo optimization to select optimal volume of renewables?

how to write a pyomo optimization to select optimal volume of renewables? Question: Background I am trying to write a pyomo optimization which takes in a customer’s electricity load and the generation data of several renewable projects, then optimally solves for the lowest cost selection of renewable projects to minimize electricity consumption, subject to a …

Total answers: 1

Implementing of an inexact (approximate) Newton algorithm in Python using conjugate gradient

Implementing of an inexact (approximate) Newton algorithm in Python using conjugate gradient Question: I want to implement in Python an inexact (approximate) Newton algorithm given by pseudocode: Data: We have an x_0 in R^n and we let a function f:R^n->R, with positive hessian, 0<c1<1, 0<rho<1 The result: the result is to estimate the global minimum …

Total answers: 1

How to get the Nth element of a permutation list

How to get the Nth element of a permutation list Question: I would like to get the Nth element of a permutation list without creating all of the permutations If I execute perm = permutations(range(3)) I get: (0, 1, 2) (0, 2, 1) (1, 0, 2) (1, 2, 0) (2, 0, 1) (2, 1, 0) …

Total answers: 1

Schedule Optimization Question – Variant of Job Shop

Schedule Optimization Question – Variant of Job Shop Question: I am looking to build code on python for a variant of the job shop problem. The differences are: The goal is to combine as many tasks to the fewest number of machines without overlap while ensure the most efficient outcome The machines have a capacity …

Total answers: 1

How to convert value of pyomo variable from float to int?

How to convert value of pyomo variable from float to int? Question: I’m working on an Task Scheduling problem given in Table 3 of paper Holistic energy awareness for intelligent drones. Table 3 In the 6th equation: N_d = E_d/B_d I want to convert floating value of (E_d/B_d) to an integer value of N_d. I’m …

Total answers: 1