Solver NOTES: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
{{stub}} | {{stub}} | ||
{{ | {{outdated}} | ||
''Using solver NOTES is no longer the preferred approach to solving this problem. We now suggest you use the [[OPTION]] command, even though it is still somewhat experimental.'' | |||
Solver NOTES are a special kind of [[NOTES]] in ASCEND that allow you to specify parameters for use in the solver when running a particular model. This uses the [[ExtPy]] mechanism, which isn't yet considered stable. | Solver NOTES are a special kind of [[NOTES]] in ASCEND that allow you to specify parameters for use in the solver when running a particular model. This uses the [[ExtPy]] mechanism, which isn't yet considered stable. | ||
| Line 6: | Line 8: | ||
To use solver notes, try | To use solver notes, try | ||
<source lang="a4c">IMPORT | <source lang="a4c">IMPORT "johnpye/solvernotes"; | ||
ADD NOTES IN mymodel; | ADD NOTES IN mymodel; | ||
Revision as of 08:15, 29 March 2011
Using solver NOTES is no longer the preferred approach to solving this problem. We now suggest you use the OPTION command, even though it is still somewhat experimental.
Solver NOTES are a special kind of NOTES in ASCEND that allow you to specify parameters for use in the solver when running a particular model. This uses the ExtPy mechanism, which isn't yet considered stable.
To use solver notes, try
IMPORT "johnpye/solvernotes"; ADD NOTES IN mymodel; 'solver' name {QRSlv} 'QRSlv' iterationlimit {50} 'QRSlv' singtol {1e-10} END NOTES; MODEL mymodel; x, y IS_A solver_var; x = y^2; METHODS METHOD on_load; EXTERNAL solvernotes(SELF); END on_load; END mymodel;
The above specifies that the preferred solver for the model mymodel is QRSlv, then sets the iterationlimit and singtol parameters when using that solver. The external method, solvernotes must be IMPORTed, and called using the EXTERNAL statement.