View Revisions: Issue #543

Summary 0000543: Add support for declaration of Observers from within METHODs
Revision 2012-04-10 05:06 by john
Description Setting up observers for often-used models is a bit tedious. It would be helpful if observers and/or studies (STUDY) would be possible from within the METHODS section of a model.

Possibly this would have to be implemented using something similar to the 'slvreq' functionality, which currently supports the 'SOLVER', 'SOLVE' and 'OPTION' commands.

METHOD on_load
  FIX T;
  (* declare the observer *)
  OBSERVE T, p, h, s;
  (* perform a study *)
  STUDY T := 273.15 {K} .. 873.15 {K} WITH 100 LINEAR RUN on_load;
END on_load;

-- or --

METHOD on_load
  FIX T;
  (* declare the observer within the study statement... *)
  STUDY T, p, h, s FOR T IN 273.15{K}..873.15{K} STEPS 100 LINEAR RUN on_load;
END on_load;


Whether this is the best approach, or whether something more Pythonised is a good move is not yet clear.

Design discussion needed before we could proceed with this one.
Revision 2012-04-10 05:04 by john
Description Setting up observers for often-used models is a bit tedious. It would be helpful if observers and/or studies (STUDY) would be possible from within the METHODS section of a model.

Possibly this would have to be implemented using something similar to the 'slvreq' functionality, which currently supports the 'SOLVER', 'SOLVE' and 'OPTION' commands.

METHOD on_load
  FIX T;
  (* declare the observer *)
  OBSERVE T, p, h, s;
  (* perform a study *)
  STUDY T := 273.15 {K} .. 873.15 {K} WITH 100 LINEAR RUN on_load;
END on_load;

Whether this is the best approach, or whether something more Pythonised is a good move is not yet clear.

Design discussion needed before we could proceed with this one.