Solver NOTES: Difference between revisions

From ASCEND
Jump to navigation Jump to search
Restored page from Google Cache, uploaded by John Pye
 
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
<div class="notice metadata" id="stub">''This article is a '''stub'''. You can help out by <span class="plainlinks">[http://ascendwiki.cheme.cmu.edu/index.php?title=Solver_NOTES&action=edit expanding it]</span>. ''</div><div class="pageexperimental">''This page documents an '''experimental''' feature. You can help out by '''testing it''' and <span class="plainlinks">[http://ascendwiki.cheme.cmu.edu/index.php?title=Solver_NOTES&action=edit recording]</span> your experiences.''</div>
{{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 5: Line 7:
To use solver notes, try
To use solver notes, try


<source lang="a4c">IMPORT &quot;johnpye/solvernotes&quot;;
<source lang="a4c">IMPORT "johnpye/solvernotes";


ADD NOTES IN mymodel;
ADD NOTES IN mymodel;
Line 28: Line 30:
The above specifies that the preferred solver for the model <tt>mymodel</tt> is [[QRSlv]], then sets the <tt>iterationlimit</tt> and <tt>singtol</tt> parameters when using that solver. The external method, <tt>solvernotes</tt> must be <tt>[[IMPORT]]</tt>ed, and called using the <tt>[[EXTERNAL]]</tt> statement.
The above specifies that the preferred solver for the model <tt>mymodel</tt> is [[QRSlv]], then sets the <tt>iterationlimit</tt> and <tt>singtol</tt> parameters when using that solver. The external method, <tt>solvernotes</tt> must be <tt>[[IMPORT]]</tt>ed, and called using the <tt>[[EXTERNAL]]</tt> statement.


[[Category:Stubs]]
[[Category:Experimental]]
[[Category:Documentation]]
[[Category:Documentation]]

Latest 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.