This class offers a declarative means by which you can find the solution to uni or multi dimensional (non-linear) optimization problems.
For a list of all members of this type, see EasySolver Members.
System.Object
EasySolver
In order to find the solution of linear problems, also known as linear programming problems we refer the reader to LinearProgramming.
To solve an optimization problem all you will need to do is define the optimization problem you wish to solve (as described below) and then call the intelligent Solve. Our intelligent solver will inspect your given problem at hand and then select the most appropriate algorithm from all the available business classes, populate the algorithm with appropriate algorithm and problem specific parameters and then evaluate the solution.
By following the below steps you will be able to quickly get your optimization problem solver up and running.
All you will to do is:
Once the Object function has been set you are able to read-off a number of its qualitative properties (and hence check that it has been set correctly) by using the following:
Though it is only strictly necessary to provide an initial point for constrained multidimensional optimization problems we advise the user to always set an initial point in the case of local unidimensional and multidimensional optimization. In the case of global (i.e. constrained) unidimensional optimization problems it is the number of subintervals which we advise the user to set.
Even if it is not clear which point and number of intervals to considered, through a process of try and error you should be able to quickly find suitable values. You are able to set the either the initial point in the uni and multi dimensional case or the number of subintervals using one of the following set methods:
Following these four steps you are able to define any unidimensional or multidimensional optimization problem with or without linear constraints by first calling Solve, after which you will be able to read of the properties of the solution found using:
Moreover, once Solve has been called you are able to ascertain which particular algorithm has been applied by calling: GetMethodUsed.
Remark: We provide a number of clients examples which illustrate exactly how in practice you are able to write a client using this class which finds the solution to a given optimization problem.
In the above section we provide the minimum steps required in order to solve
an optimization problem. In nearly all cases the Solve method will
select the optimal algorithm to use, and set values for the tolerance and the maximum
number of iterations to there default values, namely 0.00001, and 300
respectively.
However, in order to offer the flexibility to fine tune your client applications we enable the tolerance and maximum number of iterations to be set which are the exiting conditions of the algorithms. That is, either the solution will be found to a given level of tolerance and the algorithm will exit, or the maximum number of iterations will be exceeded before the solution is found to the given level of tolerance which will also result in the algorithm exiting. Clearly, the desirable outcome is for the solution to be found and hence the number of iterations should be chosen generously.
The two model parameters (or exiting conditions) of the tolerance and maximum number of iterations can be set and finely tuned using:
Remark: If you wish to override Solve method selection or use a particular algorithm for a given problem then we refer you to the MultiDimensionalSolver and UniDimensionalSolver classs.
Within this component we will categorize sufficiently optimization problems such that we are able to:
In particular, we will categorize Optimization problems in accordance with:
In addition to these problem specific parameters you also have the option if you wish to set the following algorithm parameters which are also exiting conditions:
Uni or Multi Dimensionality and Object Functions
Optimization problems can be unidimensional (that is, the object function has only one variable) or multidimensional (that is, the object function has more than one variable). We provide specialized algorithms which deal with the uni-dimensional and multidimensional cases. Optimization problems are also categorized by the qualitative properties of there object functions and for the following types of functions we provide specialized algorithms:
EasySolver sineOptimizationProblem = new EasySolver ();
sineOptimizationProblem.setFunction (new SineFunction ());
sineOptimizationProblem.solve ();
double localMaximum = sineOptimizationProblem.getUniDimensionalSolution ();
The initial point for local uni-dimensional extremum problems is
0. You can change it by calling the SetInitialPoint method.
Namespace: WebCab.COM.Math.Optimization
Assembly: WebCab.COM.Optimization (in WebCab.COM.Optimization.dll)
EasySolver Members | WebCab.COM.Math.Optimization Namespace