Il risolutore di Excel
Posted
mercoledì 9 marzo 2005 9.17
by
lorenzo
Microsoft Excel è dotato di un componente chiamato Risolutore (in inglese Solver) che è in grado di trovare soluzioni a sistemi di funzioni di una certa complessità.
Il risolutore può essere utilizzato sia in maniera interattiva, che da codice, magari all'interno di una macro. Se lo si utilizza da codice è possibile fare in modo che esso non emetta nessun Message-Box (cosa che invece fa di default). La cosa che nella documentazione non è spiegata in alcun modo è come sia possibile interpretare il risultato dell'elaborazione se si è scelto di nascondere la messaggistica... La documentazione ufficiale non ne fa nessun accenno.
Dopo un po' di ricerche ho trovato su un NG la soluzione ai miei interrogativi. Ecco l'elenco dei codici di ritorno e le relative spiegazioni:
0. Solver found a solution. All constraints and optimality conditions are satisfied.
1. Solver has converged to the current solution. All constraints are satisfied.
2. Solver cannot improve the current solution. All constraints are satisfied.
3. Stop chosen when the maximum iteration limit was reached.
4. The Set Cell values do not converge.
5. Solver could not find a feasible solution.
6. Solver stopped at user's request.
7. The conditions for Assume Linear Model are not satisfied.
8. The problem is too large for Solver to handle.
9. Solver encountered an error value in a target or constraint cell.
10. Stop chosen when maximum time limit was reached.
11. There is not enough memory available to solve the problem.
12. Another Excel instance is using SOLVER.DLL. Try again later.
13. Error in model. Please verify that all cells and constraints are valid.