STUDY
STUDY is a METHOD-language statement for preparing or executing a parametric study from inside a model method such as on_load.
Syntax
STUDY observed_var_list
[VARY var FROM lower TO upper (STEPS n [LINEAR|LOG] | STEP delta | RATIO r)]
[RUN method_name]
[NOW]
[FILE "path"];
Examples:
STUDY accel_required, time_run;
STUDY accel_required, time_run
VARY time_run FROM 2 {s} TO 6 {s} STEPS 4
NOW
FILE "study.tsv";
STUDY y, x VARY x FROM 1 TO 10 STEP 0.1;
STUDY y, x VARY x FROM 1 TO 10 RATIO 1.1;
STUDY y, x VARY x FROM 1 TO 10 STEPS 8 LOG RUN reset;
See more examples in models/test/slvreq.
Semantics
- The observed variable list is required.
VARYis optional.RUN method_nameis optional and is executed before each study point.FILEis optional.NOWis optional.- The varied variable may also appear in the observed variable list.
- When
VARYis present, the varied variable is always included first in the Observer and in CLI tabular output, without duplication. - The current solver and options are taken from the existing GUI state and/or earlier METHOD
SOLVER/OPTIONstatements. They are not restated insideSTUDY.
Stepping modes:
STEPS nmeansnintervals with both endpoints included.STEP deltauses a linear increment.RATIO ruses a logarithmic/geometric progression.STEPS n LOGrequests logarithmic spacing.STEPS nwithoutLOGuses linear spacing.
Validation rules:
STEPmust be non-zero and must move from the lower bound toward the upper bound.RATIOmust be positive, not equal to1, and must move from the lower bound toward the upper bound.- Logarithmic studies require both bounds to be positive.
./a4 run
In the ascxx / CLI path, STUDY is interpreted in two different ways depending on whether VARY is present.
- If
VARYis present, the requested cases are solved in sequence. - If
RUNis present, the named method is run before each study point. NOWis accepted but has no additional effect in the CLI path; varying studies already execute immediately.- Output is tabular.
- The first column is always the varied variable.
- Column headers include units of measurement.
- If
FILEis present, the table is written there and a note is emitted telling the user where it went. - If
FILEis omitted, the table is written to standard output. - If
VARYis omitted, the observed variables are stored as the model’s default post-solve print list.a4 runthen prints them after the main solve usingname = valueformatting, but only when no explicit-p/--printarguments were supplied. Explicit-parguments take precedence over this model-defined list. - If any
STUDY ... VARY ...request is encountered during the run, the deferred no-VARYprint action is suppressed for that run.
Current output format is TSV.
GTK Browser
In the GTK browser, STUDY uses the existing Observer and Study dialog workflow.
- If no Observer exists yet, one is created.
- The observed variables are added to the active Observer.
- If
VARYis present, the varied variable is added first if it is not already present. - If
VARYis omitted, the Observer is populated and no Study dialog is opened. - If
VARYis present, the Study dialog is opened with the variable, bounds, stepping mode, distribution, and optionalRUNmethod pre-populated. - If
VARYis present andNOWis supplied, the pre-populated study is executed immediately without waiting for the user to pressOK. - Solving then proceeds through the existing interactive Study dialog behavior.
Current GTK limitation:
FILEis not yet implemented as an export path in the GTK browser. The GUI currently reports this and keeps the results in the Observer.
Not yet implemented:
ON_ERROR STOP | SKIP | CONTINUE
Tcl/Tk
The METHOD STUDY statement is currently not implemented in the Tcl/Tk GUI.