Questions tagged [mathematical-optimization]

Mathematical optimization deals with maximizing or minimizing an objective function by choosing values from within an allowed feasible set of possible values. Mathematical optimization is often also referred to as mathematical programming or simply as optimization.

Filter by
Sorted by
Tagged with
-2 votes
0 answers
11 views

Finding extreme values

Give all local extreme points and values of y=|x|+x^4 with domain (-1,2] (so for each extreme point x also report corresponding y) So I first took the derivative of y=|x|+x^4 which is: y={1+4x^3 if x&...
poix pox's user avatar
2 votes
0 answers
28 views

Area optimization algorithm for Palletts in truck

I want to calculate how to optimally fit a number of palletts (red) into a truck (black) so that the used lenght of the loading space is as short as possible. Is it possible to solve this problem with ...
user19600963's user avatar
-2 votes
0 answers
21 views

Confused about how a cost function is graphed [closed]

I am currently learning about gradient descent and I am confused as to how the cost function is graphed. I understand the formula for the average sum of mean squared errors, but how are the individual ...
Eshan Srivastav's user avatar
4 votes
1 answer
98 views

Python nested lists search optimization

I have a search and test problem : in the list of prime numbers from 2 to 100k, we're searching the first set of 5 with the following criteria : p1 < p2 < p3 < p4 < p5 any combination of ...
MarvinLeRouge's user avatar
0 votes
0 answers
18 views

Algorithm or method for matrix decomposition of a unitary complex matrix

I am trying to decompose a matrix T into the form u1*v*u2*v...v*u_n, where v=F*H*F is a given matrix, here F is just the Discrete Fourier Transform matrix (a unitary complex matrix) and H is unitary ...
epk's user avatar
  • 1
0 votes
2 answers
40 views

Can I assume that a 64 bit number is the pruduct of two 32 bit numbers?

I am trying to make a brute force program to guess and check numbers until I find two unknown prime numbers that multiply to a known number. But when the known number is 64 bits long its inefficient ...
Mathias Hauvgaard's user avatar
0 votes
0 answers
47 views

Datacenter Job Scheduling using Genetic Algorithm or Linear Programming

I'm looking for some advice for an optimization problem regarding scheduling jobs in a datacenter. So I have a list of jobs and each job has a required time for finishing and a number of cores it has ...
Konstantin's user avatar
0 votes
0 answers
23 views

Numerical Integration within lsqcurvefit function handle

Need to optimize C parameters in func handle using lsqcurvefit. func handle is also calling multiple handles one of them being L_(@Vf) which contains integral function. The problem is when I want to ...
Miro's user avatar
  • 3
0 votes
0 answers
28 views

Unwated consistency of solver results with pyomo over several runs

I'm using pyomo 6.6.4 and several solvers (Ipopt, Bonmin, Cbc,...) to solve different relatively complicated models (MINLP in general). Since my models have known infeasibility points I am solving ...
djo's user avatar
  • 13
0 votes
2 answers
71 views

MultiObjective problems using gurobi solver - which method is used?

I'm coding a mathematical model in Julia, using the packages JuMP and Gurobi. So, first I create my model and set some parameters, as below: model = Model(Gurobi.Optimizer) set_optimizer_attribute(...
Igor Eduardo's user avatar
0 votes
1 answer
55 views

What equation would express multiple values of x for only one value of n, within a threshold of requirements?

Simplified Problem My question is a bit complex to be explained within the title, though what I'm truely looking for is an equation that can, as the title mentions, "express multiple values of x ...
Justin Neugebauer's user avatar
0 votes
0 answers
32 views

Back propagation in a multi-output neural network

I would like to write a multi output Neural Network trying to understand the mathematics of all this in accordance with https://victorzhou.com/blog/intro-to-neural-networks/ My idea: Array 128*128 is ...
Алексей Васильев's user avatar
-1 votes
0 answers
24 views

Two-Phase method and Column Generation

Imagine a linear minimization problem of huge number of decision variables. In order to start from an initial feasible solution, Two-Phase method is implemented, and optimality is gained via using the ...
selenia's user avatar
1 vote
0 answers
79 views

Solve Quadratically Constrained Linear Objective Function in R

Context A bit of context is in order. I am currently migrating an Excel tool (sigh!) to n Shiny app. Excel is using the solver Addin to find an "optimal" solution. Now I am looking for a ...
thothal's user avatar
  • 17.3k
0 votes
0 answers
30 views

Ipopt in pyomo with anaconda

I tried to run a simple code using ipopt in my anaconda after succesfully installation of Coopr, pyomo, glpk and ipopt in my new environment with two different versions of python, 3.9 and 3.11: #...
Alexandre César Barbosa's user avatar
0 votes
2 answers
72 views

Bayesian Optimization for a multi-dimensional vector

I get difficulties when trying to use Bayesian Optimization package (https://github.com/fmfn/BayesianOptimization) for parameter optimization. The target function is of input vector, which is a 10-...
Larry Baynes's user avatar
1 vote
0 answers
37 views

Ipopt in pyomo google colab

I tried to use the following code to use ipopt in google colab, but it gave an error. #solver:ipopt !apt install coinor-libipopt-dev !pip install ipopt SolverFactory('ipopt').solve(model).write() ...
Alexandre César Barbosa's user avatar
0 votes
2 answers
56 views

Julia - getting started with local compiled Pkg

This is on Julia 1.9.3. I'm trying to use the high precision arithmetic and the Remez.jl package to test out some ideas. I have the code and it compiles OK. I can do toy things in Julia as a language ...
Martin Brown's user avatar
0 votes
0 answers
31 views

setting the network algorithm in cplex but the solution was obtained with dual simplex

I am solving a pure network flows problem (min. cost flow model) in python/java using cplex. Hence, I am explicitly telling cplex to use the network algorithm (i.e., lpmethod = network = 3). However, ...
Jorge Huertas's user avatar
1 vote
2 answers
97 views

Variable with conditionals

I'm working in a problem of optimization with Gekko and I have a complex equation with sums and many variables, but it is not a problem. The main difficulty is to write a variable that involves ...
stwrt's user avatar
  • 13
0 votes
0 answers
20 views

PyTorch Values Bairley Changing

I have a simple model in pytorch based on the quickstart except instead of a pre-made data-set I am trying to find parameters for a mathematical function to fit a curve, I am then trying to feed back ...
cgbsu's user avatar
  • 55
-1 votes
0 answers
19 views

use cvxpy to optimize on an existing portfolio by limiting the number of trades to make

Sample code below to try to use at most 2 trades to optimize the portfolio, but I don't know how to express the constraint on the number of trades made to get the optimized portfolio. What i tried ...
ideate's user avatar
  • 1
0 votes
0 answers
38 views

Why does IPOPT still give a solution after a termination status of local infeasibility, numerical error or iteration limit?

I am solving a NLP in IPOPT and then saving the solution afterwards. I noticed that even when I get a bad termination status of local infeasibility, numerical error or iteration limit IPOPT still ...
Hean Wooi's user avatar
0 votes
0 answers
13 views

quadratically inner bounded problem for lipschitz nonlinearity

i have a problem for resolution of quadratic-ally inner bounded(QIB) theorem for this nonlinear term phi(x_1,x_2)=4.7071sin(x_2)/1+x_1,so, i like to write it in the following form: phi(transpose)phi =&...
Mnasri Dhia Eddine's user avatar
0 votes
1 answer
75 views

Unexpected solution when using scipy.optimize.minimize to solve a optimization problem

I'm trying to express the following optimization problem in scipy. Assuming r is a known array with values: [0.96366965, 0.93341242, 0.90676733, 0.88186071, 0.8582291, 0.83472442, 0.80977363, 0....
Broly Cjw's user avatar
-1 votes
0 answers
70 views

pandas dataframe - sum each row by every other row (optimally)

i have a pandas dataframe (columns: ~50) (rows: ~millions) each row represents a string & columns represent a char and the number of times the char occurs in the string (word) a b ...
sliq's user avatar
  • 1
1 vote
2 answers
89 views

How to determine the angle range that a box can rotate within an image

I want to find an algorithm that can find the angle range that a box can rotate around the top-left corner within an image. For example, in the picture below, I can calculate alpha_1 and alpha_2, ...
zhoay's user avatar
  • 11
1 vote
1 answer
87 views

Maximizing a sum over points with distance constraint in 3D

Problem The problem statement is as follows, given a set of points in 3D, p_i, and their corresponding energy value, e_i, find a subset of them in which the sum of their energy is maximized, and the ...
Odeaxcsh's user avatar
  • 316
0 votes
0 answers
21 views

Nevergrad ask function outputting repeated points

I'm trying to solve black-box optimization task using Nevergrad. And that task is specific: domain of objective function is quite small, so when suggestion point x is not in domain, f(x) returns nan ...
DiA's user avatar
  • 359
0 votes
0 answers
61 views

Symbolic optimization - Python or MatLab

I am trying to replicate this exercise from Garicano (2000), that maximizes this equation: That is the problem of optimization, and I want to get the solutions for z_w and z_m. So that I achieve to ...
Daniel Garzon Hernandez's user avatar
0 votes
1 answer
58 views

Write a constraint in Pyomo with max and min

I have to write the Pavg and H_ad constraints in pyomo from the following picture with 4 constraints, # 1. Average Pressure def Avg_pressure(model, I, J, T, S, r): return model.Pavg[I, J, T, S] =...
Cvakapoor's user avatar
0 votes
1 answer
33 views

Index error in a non anticipativity constraint in multi stage stochastic optimization

My model sets are defined as, graph = { 1 : [2], 2 : [3, 4], 3 : [4, 5, 6], 4 : [7, 8, 9], 5 : [], 6 : [], 7 : [], ...
Cvakapoor's user avatar
0 votes
0 answers
32 views

Improve pyomo constraint with nested loops

I have a series of constraint that look like this: def r7_encadenamiento_inicial(modelo,b, s, ss, l): condicion1 = modelo.s_index[s] < modelo.s_index[ss] if not condicion1: return ...
FG85's user avatar
  • 63
0 votes
1 answer
68 views

algorithm to generate numbers which have a given average product based on distance

I am trying to come up with an algorithm which generates numbers that have a given average product based on their distance. For example, say there were 4 points on the x-axis, x1 x2 x3 and x4. Each ...
woot's user avatar
  • 33
0 votes
0 answers
147 views

I don't have the right outcome in pyomo model

Oxbridge University maintains a powerful mainframe computer for research use by its faculty, Ph.D. students, and research associates. During all working hours, an operator must be available to operate ...
swnr31's user avatar
  • 13
0 votes
1 answer
90 views

python pulp inventory optimization program

I want to create Inventory fulfillment optimization program. There are 4 data frame for each Items. I want to propose fulfillment qty for each items. Objective : On Hand qty(df2) for any items are ...
Sattai's user avatar
  • 1
0 votes
0 answers
43 views

How to define this complex labor rule as a constraint in MIP?

Im trying to define a complex labor rule as constraints in a MIP, solved with CPLEX. My key decision variable is a binary x(i,j) indicating if shift i is assigned to employee j. The labor rule is as ...
Frank Steenbergen's user avatar
0 votes
0 answers
35 views

PROC OPTMODEL (SAS language)

I'm trying to maximize the production of green leaf vegetables taking into account contraints like: environmental issues and self-sufficiency. So the code generate this errors, could you help me ...
jabri jihéne's user avatar
0 votes
0 answers
48 views

Python code to calculate necessary of Iron Bars

I need your help with this calculation. I need to obtain the following pieces of iron bars for each corresponding length (where keys = length, values = pieces): necesar = { 12: 12, 8: 12, 4.55: 4, 4.1:...
Robert Cenusa's user avatar
0 votes
1 answer
55 views

How to write a formula to rank and tie-breaks for decisions of vacation priority

I have a been tasked to design a process to rank and tie-break vacation plans of a given crew. There is a set of rules to be respected and I need to make a formula to put in Excel so we can see the ...
0601D_K4BUM's user avatar
1 vote
1 answer
47 views

How to write the constraint (A + B <= 1) in DOcplex?

I am new to DOcplex. I have two binary decision variables A and B and I wish to write the constraint (A+B <=1). I tried to write the constraint using "+" operator but it does not work. ...
troman's user avatar
  • 13
0 votes
0 answers
35 views

Constraint formulation for variable cleaning times - MILP optimization

I have a Mixed Integer Linear Problem where I want to schedule the production of different products (P). Each product can be produced once at a time, and between each product, there is a certain time ...
Ignacio Aristimuño's user avatar
0 votes
2 answers
61 views

scipy global optimization with jacobian information

I am currently working on a global optimization problem and in order to speed up the calculations I want to include jacobian information in the local optimization. My function is not simple but it ...
tbolind's user avatar
2 votes
1 answer
61 views

GEKKO / IPOPT - NL Optimization becomes unfeasible because of a change in exponent

I am attempting to run a dynamic optimization model in discrete time with GEKKO and IPOPT (v3.10.2). My model is the following : from gekko import GEKKO import numpy as np # Simulation time T = 5 ...
GaL's user avatar
  • 73
0 votes
2 answers
56 views

Finding best result matching sets of items. Powerset optimization

I'm having this combination problem where I'm trying to find subsets of matching combinations of 2 items which results in the highest amount of total matches. Every item can only be in a match once. ...
Oehoe's user avatar
  • 51
2 votes
1 answer
53 views

How does GEKKO integrals choose the variable to be integrated?

I am building an optimization model where the objective function features one variable that needs to be integrated, while another variable is part of the integrated function, whithout being itself ...
GaL's user avatar
  • 73
0 votes
0 answers
101 views

Speeding up function minimisation using Scipy's Powell method

I am trying to solve a nonlinear least squares problem using Scipy's minimize-function in Python. The model is very complicated and (typically) depends on 14 parameters. Thus, I and many symbolic ...
mathslover's user avatar
0 votes
0 answers
28 views

Optimization of a function with several arguments using neural network

I have a function F(args: tuple) => tuple with 11 arguments that yields 4-elements-tuple as a result. The project uses a tensorflow library. How should I implement this with the help of a neural ...
Cyril Florence's user avatar
0 votes
1 answer
31 views

Math modeling of inventory optimization using cplex

I'm trying to solve this using CPLEX using pyomo framework. My code is as follow import pyomo.environ as pyo from pyomo.environ import * from pyomo.opt import SolverFactory import numpy as np model=...
Salman M Sulphi's user avatar
1 vote
2 answers
60 views

AddMultplicationEquality() for multiple variables

I want to use AddMultiplicationEquality() for multiple variables and use the result of multiplication. I guess we cannot perform the multiplication of multiple decision variables. I am using CP-SAT ...
Ken Adams's user avatar

1
2 3 4 5
68