Talk:Event handling

From ASCEND
Revision as of 23:55, 10 February 2012 by Jpye (talk | contribs) (Created page with "''Please add new comments below with a '''<nowiki>==heading==</nowiki>''' and signed beneath using '''<nowiki>~~~~</nowiki>'''. If responding to an earlier comment, prefix you...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Please add new comments below with a ==heading== and signed beneath using ~~~~. If responding to an earlier comment, prefix your comments with ":" so that they are indented, and sign as before.

REINIT and PRE

One basic implementation of boundary events would be to allow a REINIT statement in addition to the USE statement to exist inside WHEN..CASE. REINIT statments would be associated with a particular CASE, and whenever a CASE change occurred, it would trigger an ICP to be created and solved.

PRE could then be added to the language. PRE inside a 'normal' relation would trigger an error. PRE inside a REINIT statement would result in a callback to the solver, which would have to keep a copy of variable values before the current boundary.

REINIT x TO -0.9*pre(x);

This statement would set the new value of 'x' and perhaps remove 'x' from the initial value problem. The derivative of x would still need to be solved for, using the dynamic equations in the problem.

Jpye 10:55, 11 February 2012 (EST)