Questions tagged [minimization]

Minimization is a subclass of mathematical optimization where given a cost or objective function, the goal is to choose the best set of parameters that will minimize the value given by this function.

457 questions
3
votes
1 answer

print currently evaluated params during scipy minimization

I am trying to minimize a function in Python using scipy.optimize.minimize, to determine four distinct parameters. I would like to print the currently evaluated params at each step of the optimisation algorithm, so I can use them to make my initial…
sweeeeeet
  • 1,599
  • 2
  • 19
  • 45
3
votes
3 answers

Using scipy to minimize a function that also takes non variational parameters

I want to use the scipy.optimize module to minimize a function. Let's say my function is f(x,a): def f(x,a): return a*x**2 For a fixed a, I want to minimize f(x,a) with respect to x. With scipy I can import for example the fmin function (I have an…
Miguel
  • 7,027
  • 1
  • 21
  • 40
3
votes
1 answer

Optimization with F#

I'm quite new to F# and have a problem. I want to solve a nonlinear, constrained optimization problem. The goal is to minimize a function minFunc with six parameters a, b, c, d, gamma and rho_infty, (the function is quite long so I don´t post it…
3
votes
0 answers

Penalized interpolation in python or matlab

I have a Loss function L and 2 signals f(t),g(t) . I would like to find the function s that minimize: L(f(t)-g(t+s(t)))+lambda*integral(s''(t)) Ideally the s should be a polynomial or a spline. Here the code I have written to start the…
Donbeo
  • 14,217
  • 30
  • 93
  • 162
3
votes
3 answers

2D Function Minimization Algorithm or C/C++ library

I need to minimize a 2D function f(x,y). I already have 1-D minimization using Brent's Method (similar to bisectional search for finding a root.) I thought a 2D version would be a pretty straightforward, common problem that would have lots of good…
Jim
  • 601
  • 1
  • 6
  • 15
3
votes
2 answers

How to find the nearest points to given coordinates with MATLAB?

I need to solve a minimization problem with Matlab and I'm wondering which is the easiest solution. All the potential solutions that I've been thinking in require lot of programming effort. Suppose that I have a lat/long coordinate point (A,B), what…
cardogar
  • 359
  • 1
  • 4
  • 17
3
votes
1 answer

Two dimensional Optimization (minimization) in Python (using scipy.optimize)

I am trying to optimize (minimize) a two dimensional function E(n,k) defined as follows: error=lambda x,y,w: (math.log(abs(Tformulated(x,y,w))) - math.log(abs(Tw[w])))**2 + (math.atan2(Tformulated(x,y,w).imag,Tformulated(x,y,w).real) -…
Harshad
  • 41
  • 1
  • 1
  • 4
3
votes
1 answer

root minuit2 contours with parameter limits

I'm trying to produce contour plots for parameters with physical limits using the Minuit2 minimizer which is a part of the ROOT data analysis framework. Unfortunately, Minuit2 seems intent on drifting the parameters into regions outside of their…
user545424
  • 14,409
  • 10
  • 49
  • 66
3
votes
2 answers

How can I minified CSS and JS with custom configuration?

I need a reliable JS and CSS minimizer which is possible to customize and compatible with modern CSS3 properties. I prefer it has something like property file in order to configuration. Would you please help me on this?
user1444021
  • 119
  • 1
  • 1
  • 6
3
votes
2 answers

Minimize complex linear multivariable function in java

I need to minimize a complex linear multivariable function under some constraints. Let x be an array of complex numbers of length L. a[0], a[1], ..., a[L-1] are complex coefficients and F is the complex function F(x)= x[0]*a[0] + x[1]*a[1] + ... +…
2
votes
1 answer

Spanning tree that minimizes a dynamic 'metric'

Let us have a graph. When we remove an edge, 2 'cars' are created, one from each vertice of the edge. when these 2 cars meet they stop. The problem is to create a spanning tree so that the sum of the numbers of cars that pass through each vertice is…
2
votes
2 answers

Ruby on Rails2: is there a way to minimize css and js when in production mode?

js and css files can be pretty big in order to be human readable. Is there some sort of gem that will minimize all the css and js upon running in production mode to decrease load times for the end user?
NullVoxPopuli
  • 51,415
  • 69
  • 184
  • 335
2
votes
1 answer

Data arrays must have the same length, and match time discretization in dynamic problems error in GEKKO

I want to find the value of the parameter m that minimizes my variable x subject to a system of differential equations. I have the following code from gekko import GEKKO def run_model_m(days, population, case, k_val, b_val, u0_val, sigma_val,…
user606273
  • 123
  • 5
2
votes
0 answers

How can I minimize a potential energy function in 2D with periodic boundary conditions using python?

Right now, I am trying to minimize an electrostatic potential energy function in 2D with periodic boundary conditions and two charges q1 and q2. Because of the conditions, the two charges should end up on the diagonal at some point that is L/sqrt(2)…
CPres
  • 21
  • 1
2
votes
2 answers

Match one list into another with minimum error

I have two lists, A and B. A will be at most ~1000 elements, and B will be at most ~100 elements. I want to match every element of B to an element of A, such that the sum of the absolute differences of the pairs is minimized. i.e. I want to choose…
Levi
  • 347
  • 3
  • 7