
Which will yield the following output (note that objective functions are different in the two cases, hence the large differences in f): f = 2125502.INCLINE VILLAGE, NV - Decem- Frontline Systems, Inc., developer of the Solver in Microsoft Excel, is shipping a major Version 8.0 upgrade of its full product line: Premium Solver and Premium Solver Platform for optimization, Risk Solver and Risk Solver Engine for simulation, and seven large-scale Solver Engines - as well as Solver Platform SDK Version 7.2 for 32-bit and 64-bit Windows and Linux, an improved version of Frontline's popular Software Development Kit for optimization and simulation. Model.AddGoal(null, GoalKind.Minimize, Model.Sum(x))

Model.AddConstraint(null, constraints = Model.GreaterEqual(Ax, b)) For your problem, this is of course not an issue.įor completeness, to formulate the LP problem instead, exchange the code between START NLP SECTION and END NLP SECTION with the following code: var m = A.GetLength(0) įor (var i = 0 i < n ++i) Ax += A * x If I am not mistaken, unlike GRG, Solver Foundation cannot support general non-linear constraints out-of-the-box, I believe you will need additional plug-ins to handle these. Generates the following solution, which should be in line with the solution from the linked Excel sheet: f = 254184688.179922 Here is my code for Solver SDK: static double A = new double ", i, x.GetDouble()) However I can't seem to get anywhere with them because with MSF I can't figure out how to define the goal and with Solver SDK I always get back status "optimal" and a solution of all 0s which is definitely not even a local minimum.

I have tried to replicate this in C# using either Microsoft Solver Foundation or Solver SDK. So instead of using standard linear algebra I use Solver with the non-negative constraint, minimizing the sum of the squared differences, and get a reasonable solution. I am solving the classic A x = b problem but with the caveat that all components of x must be non-negative. My problem is shown in the following spreadsheet. It can be solved in Microsoft Excel with the Solver add-in, but I am having trouble replicating that in C#. I have a non-linear optimization problem with constraints.
