m = pwAddE(m, *ID, *targetID, *rhs, *trigger)
 m = pwAddE(m, interactive)

 Adds an event to a model, where an assignment is applied when a trigger fires.
 In contrast to time-dependent events (pwAddTE), the trigger depends on
 values of variables and parameters.


Arguments for pwAddE

 ID          ID of the event (must be unique within the model)
 targetID    ID of the assigned quantity. Must be the ID of an existing
             dynamic variable X,
             a dynamic parameter K,
             an observation paramter S.
 rhs         Right-hand side: An algebraic expression comprising IDs of
             dynamic variables X,
             dynamic parameters K,
             observation paramters S,
             driving input U,
             algebraic quantities A,
             time t.
             Rule-based expressions are supported
             (see pwTutorial_Rule_based_modeling)
 trigger     An inequality equation comprising IDs of A, K, S, U, X
             and time t.

 Alternative function call for interactive specification:
 interactive If true, the user is prompted to enter the properties
             into a user interface.


Time-dependent events

 For time-dependent events, please either use pwAddU, pwAddA, or pwAddTE.



 Please set the maximum integration step-size to a small value in order to
 detect the event with sufficient accuracy, e.g. using

 config = pwGetConfig;
 config.integration.opt.MaxStep = 0.5;



 % Setting ProteinA to zero when ProteinB increases to a value of 10 or higher:
 m = pwAddE(m, 'Event01', 'ProteinA', '0', 'ProteinB >= 10');

 % Setting ProteinA to half of the value of ProteinC if ProteinB
 % decreases below the current value of ProteinA:
 m = pwAddE(m, 'Event02', 'ProteinA', 'ProteinC / 2', 'ProteinB < ProteinA');

See also