Documente Academic
Documente Profesional
Documente Cultură
1. Cdigo usado
REM ***** Destilacin Multicomponente *****
Sub Main
smgr = GetProcessServiceManager()
solv = smgr.createInstance("com.sun.star.sheet.Solver")
oDoc = ThisComponent
solv.Document = oDoc
Sheet = oDoc.Sheets(0)
ObjectiveCell = Sheet.getCellByPosition(6,8)
solv.Objective = ObjectiveCell.CellAddress
VariCell0 = Sheet.getCellByPosition(6,10)
Variables(0) = VariCell0.CellAddress
solv.Variables = Variables()
solv.ResultValue = True
solv.Solve()
Print solv.ResultValue
End Sub
It is helpful to understand what the GRG Nonlinear Solving method can and cannot do, and what
each of the possible Solver Result Messages means for this Solver engine. At best, the GRG Solving
method alone like virtually all classical nonlinear optimization algorithms can find a locally
optimal solution to a reasonably well-scaled, non-convex model. At times, Solver will stop before
finding a locally optimal solution, when it is making very slow progress (the objective function is
changing very little from one trial solution to another) or for other reasons.
Locally Versus Globally Optimal Solutions
When the message Solver found a solution appears, it means that the GRG method has found a
locally optimal solution there is no other set of values for the decision variables close to the
current values that yields a better value for the objective function. Figuratively, this means that
Solver has found a peak (if maximizing) or valley (if minimizing) but if the model is nonconvex, there may be other taller peaks or deeper valleys far away from the current solution.
Mathematically, this message means that the Karush - Kuhn - Tucker (KKT) conditions for local
optimality have been satisfied (to within a certain tolerance, related to the Precision setting in the
Solver Options dialog).