Questions tagged [nonlinear-optimization]

sub-field of mathematical optimization (alternatively, mathematical programming) that deals with problems that are not linear

Nonlinear programming

From Wikipedia, the free encyclopedia

In mathematics, nonlinear programming is the process of solving an optimization problem defined by a system of equalities and inequalities, collectively termed constraints, over a set of unknown real variables, along with an objective function to be maximized or minimized, where some of the constraints or the objective function are nonlinear.

932 questions
16
votes
2 answers

python nonlinear least squares fitting

I am a little out of my depth in terms of the math involved in my problem, so I apologise for any incorrect nomenclature. I was looking at using the scipy function leastsq, but am not sure if it is the correct function. I have the following…
Anake
  • 7,201
  • 12
  • 45
  • 59
11
votes
1 answer

R optim(): unexpected behavior when working with parent environments

Consider the function fn() which stores the most recent input x and its return value ret <- x^2 in the parent environment. makeFn <- function(){ xx <- ret <- NA fn <- function(x){ if(!is.na(xx) && x==xx){ cat("x=", xx, ",…
11
votes
6 answers

Finding a curve to match data

I'm looking for a non-linear curve fitting routine (probably most likely to be found in R or Python, but I'm open to other languages) which would take x,y data and fit a curve to it. I should be able to specify as a string the type of expression I…
Nosredna
  • 83,000
  • 15
  • 95
  • 122
10
votes
1 answer

Minimization with R nloptr package - multiple equality constraints

Is it possible to specify more than one equality constraint in nloptr function in R? The code that I am trying to run is the following: eval_f <- function( x ) { return( list( "objective" = x[3]^2+x[4]^2, "gradient" = c( 0, …
10
votes
1 answer

Error in optim: function cannot be evaluated at initial parameters

So I've run into this weird error in R. I have a simple function which returns an error term when comparing real and simulated prices, called hestondifferences(). when I try to find the local minima via: res<-optim(fn=hestondifferences, par =…
jcfrei
  • 1,819
  • 4
  • 19
  • 35
10
votes
1 answer

How can I emulate Microsoft Excel's Solver functionality (GRG Nonlinear) in C#?

I have a non-linear optimization problem with constraints. It can be solved in Microsoft Excel with the Solver add-in, but I am having trouble replicating that in C#. My problem is shown in the following spreadsheet. I am solving the classic A x = b…
Craig W
  • 4,390
  • 5
  • 33
  • 51
8
votes
1 answer

Is there a limit in the number of degrees of freedom with the lm_feasible algorithm? If so, what is the limit?

I am developing a finite element software that minimizes the energy of a mechanical structure. Using octave and its optim package, I run into a strange issue: The lm_feasible algorithm doesn't calculate at all when I use more than 300 degrees of…
7
votes
6 answers

Non-linear optimisation/programming with integer variables in R

I wonder if anyone is able to suggest some packages to solve a non-linear optimisation problem which can provide integer variables for an optimum solution? The problem is to minimise a function with an equality constraint subject to some lower and…
7
votes
1 answer

When to define multiple Residual blocks in Ceres?

I'm going through the Ceres Solver tutorial. Powell's Function Powell's function maps from R^4 -> R^4, so it seems intuitive to define one residual block that takes in a 4-element array x and fill in a 4-element array residual. Instead, the example…
7
votes
1 answer

What solver should I use if my objective function is an nonlinear (also exponential explanation) function? Python GEKKO

I'm trying to optimise an exponential objective function with GEKKO, but I don't know if the selected solver is the best one for these kind of problems. Is the selected one a valid choice?? import numpy as np 'GEKKO MODELING' from gekko import…
7
votes
4 answers

Non Linear Integer Programming

I would like to know if there is a package in R handling non linear integer optimization. "Basically", I would like to solve the following problem: max f(x) s.t x in (0,10) and x is integer. I know that some branching algorithms are able to handle…
SRKX
  • 1,806
  • 1
  • 21
  • 42
7
votes
1 answer

Solving a bounded non-linear minimization with scipy in python

Trying to solve a simple non linear minimization problem with one variable. from scipy.optimize import minimize import math alpha = 0.05 waiting = 50 mean_period = 50 neighborhood_size = 5 def my_func(w): return -(2/(w+1) +…
George
  • 774
  • 2
  • 9
  • 18
6
votes
2 answers

Escaping local minimum with tensorflow

I am solving this system of equations with tensorflow: f1 = y - x*x = 0 f2 = x - (y - 2)*(y - 2) + 1.1 = 0 If I choose bad starting point (x,y)=(-1.3,2), then I get into local minima optimising f1^2+f2^2 with this code: f1 = y - x*x f2 = x - (y -…
6
votes
0 answers

Python: Multi variable nonlinear fitting like matlabs nlinfit

I used to use Matlab to perform nonlinear fits using the nlinfit function. This allowed me to create a fit for a vector of observed responses to two predictors. Let's for arguments sake say Cu recovery through a separation process based on the feed…
user2568366
  • 61
  • 1
  • 3
6
votes
1 answer

Eigen error: please_protect_your_min_with_parentheses

I'm trying to test Eigen's NonLinear Optimization capabilities by running the testcode that comes with the package. I'm stuck (more like baffled) with these errors : Error 5 error C2039: 'please_protect_your_min_with_parentheses' : is not a…
1
2 3
62 63