Solver NOTES

From ASCEND
Revision as of 13:48, 13 May 2010 by UploadBot (talk | contribs) (Restored page from Google Cache, uploaded by John Pye)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
This page documents an experimental feature. You can help out by testing it and recording your experiences.

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.