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.

Mathematical optimization deals with maximizing or minimizing a real 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.

Thus, the study of Mathematical optimization includes formulating the problem (as a set of mathematical equations), and developing several solution techniques. These techniques exploit the underlying structure of the problem. Different optimization algorithms are suited for different types of problems and vary in solution times and computational complexity.

The goal (to be maximized or minimized) is called the "Objective Function." The set of equations that limit the solution space are the "constraints" and the possible solution space is the "feasible region." In some problems, the aim is to just find any acceptable solution, and these are called "constraint satisfaction problems" in which case there is no real objective function to be minimized or maximized.

Broadly, Mathematical Optimization falls under the area of "Applied Mathematics."

3356 questions
1
vote
1 answer

Approximating an unknown value in Python

I need to approximate an unknown value, a bound that separates divergent values from those that converge. I'm trying to do so like this: # dont worry about the value of i, its one of many bounds checks bounds = 1.0 for j in range(niters): if…
1
vote
1 answer

Infeasible solution for an lp even though there exists feasible solution(using cvxopt python)

I am trying to find an lp solution to the following problem and even though I can construct feasible points by hand , I seem to get a infeasible certificate from cvxopt. Below is the example and snippet of code import numpy as np from cvxopt import…
1
vote
0 answers

kreisselmeier steinhauser function with simulated annealing

How can I implement Kreisselmeier Steinhauser (KS) function with Simulated Annealing optimization? My code for SA with KS func is as follows: while (Gen < GenMax ) while iter > 0 %PerturbIter NewZ = PerturbZ(CurZ); NewX = lb +…
1
vote
1 answer

Directly compute element in recursion using bitwise XOR operator

Let's have a matrix M X N matrix A[i][j] given partially as :(starting with row=0 column =0): 1) for all 1<=i<=N A[0][i]=0 2) for all 0<=j<=M A[j][0]=1 The matrix constructs A[i][j] further as: for all 1<=i<=N and 1<=j<=M,…
1
vote
0 answers

Python scipy for simulation-based optimization

I start to use Python scipy for simulation-based optimization. Here a simple example, where in the real case, x is an input to the simulation model (a constant variable over time) and it has a lower and upper bound (40 and 80). t_sim is a function…
Matias
  • 581
  • 1
  • 5
  • 16
1
vote
0 answers

What does fjac mean in scipy.optimize.OptimizeResult?

Consider the following code. from scipy import optimize def fun(x): return [x[0] + 0.5 * (x[0] - x[1])**3 - 1.0, 0.5 * (x[1] - x[0])**3 + x[1]] def jac(x): return np.array([[1 + 1.5 * (x[0] - x[1])**2, …
Kid Charlamagne
  • 558
  • 1
  • 10
  • 27
1
vote
0 answers

Building a scoring function based on inventory age and value

I need to build a scoring function to rank items as they arrive in the inventory(data streams). The function will represent both the inventory value(V) and the Age of inventory(A)(from the time at which it was bought). Score = 3V + 7A. The scoring…
1
vote
1 answer

Parallel global optimization of a FORTRAN function in matlab

I need to globally optimize the parameter inputs to a fortran program in matlab. The function accepts inputs in the following manner: z= fort_fun(X,str) Where X is a vector of decimal numbers and str is a string. I need to identify the minimal…
1
vote
1 answer

How for find x for a fitted exponential function?

fp.append(np.polyfit(train_x, train_y, 2)) f.append(np.poly1d(fp)) print(np.poly1d(fp)) threshold = fsolve(f, 50) The above code finds x values for y=50 successfully. But when I try to do the same for the fitted exponential function, I can't…
1
vote
1 answer

How do I resolve the “Inner matrix dimensions must agree” error?

This is my code in CVX: load('C') r=C(:,4); t=C(:,5); n = size(C,1); N = 100; for i=1:n eta(i,1) = randn()/2; end cvx_begin variable x(n,1) maximize r'*x - t'*x subject to ones(n,1)'*x == N x >= zeros(n,1) …
Kristada673
  • 3,512
  • 6
  • 39
  • 93
1
vote
0 answers

Neural Network with Input Depending on Variable

Let's say we have a fully connected network with 1 hidden layer. Let's call the input to the network X. Suppose now that there is a variable Z on which the input depends, i.e. X = f(Z,D) where D is the training data available. After that, X is then…
1
vote
0 answers

scipy.minimize with SLSQP not respecting constraints

I'm attempting to minimize the function f(x) = x[0] * x[1] over a system of inequality constraints using scipy.minimize and the solver is returning values which do not respect all of the constraints. For example: import numpy as np from…
Eric
  • 43
  • 5
1
vote
1 answer

tf.hessians() - ValueError: None values not supported

Here is the traceback: Traceback (most recent call last): File "test.py", line 39, in hess = tf.hessians(loss, wrt_variables) File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/ops/gradients_impl.py", line 970, in…
Guillaume Chevalier
  • 9,613
  • 8
  • 51
  • 79
1
vote
1 answer

tf.hessians(f, x): not the same value as tf.gradients(tf.gradients(f, x), x) for an isolated, single variable?

So I have a tf.Variable() named W that is of shape=[1]. I get that the tf.hessians(loss, W) isn't equal to the tf.gradients(tf.gradients(loss, W), W), despite it should be the same thing: a second order derivative. Here is a small gist for the code…
1
vote
0 answers

How to clear defined variables in cvxpy?

When you iteratively call cvxpy.Variables() like import cvxpy x = cvxpy.Variable(3) y = cvxpy.Variable(7) and then print the internal representation >>> print x var3 when repeated several times, the index increases >>> print x var121 How to free…
Sergey Dovgal
  • 614
  • 6
  • 21