Solving equations in .NET.

I am trying to solve some simple equations in .NET. I came across Math.NET and appreciated it. It seems to me that I need Solver() methods, but I can’t figure out how to use the side conditions with this method.

To illustrate my problem, I will give you a sample:

 Given: 0 <= a_i <= 100 0 <= b <= 100 0 <= c a_i, b and c are given x_1, ..., x_n should be optimized f(x) = x_1*a_1 + x_2*a_2 + ... + x_n*a_n = b Side conditions: g(x) = x_1 + x_2 + ... + x_n = c 0 <= x_i 

Is it possible to solve such a problem using the solution method or any other Math.NET component, or do you know any (free for commercial use) .NET library that can be used to solve this problem? I would not want to write the algorithm itself for such a general problem.

Best regards and thanks

+7
source share
3 answers

You need an optimizer with restrictions like the simplex method or the nonlinear optimization of Marquardt.

+1
source

ALGLIB is great for these tasks. Check your page for limited optimization .

EDIT: It has both a free license (GPL) and a commercial license starting at $ 370.

+2
source

IMHO Microsoft Solver Foundation is the way to go. The express version is free AFAIK and powerful enough for most small applications.

As I see it, the Express version is only indented for research - but there are (now?) Standard-Lib subscribers for MSDN, so I am not deleting this post, since you may have a subscription to MSDN.

+2
source

All Articles