STUDY: Difference between revisions
Jump to navigation
Jump to search
Created page with '{{missing}} Category:Syntax' |
No edit summary |
||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
{{ | <code>STUDY</code> is a METHOD-language statement for preparing or executing a parametric study from inside a model method such as <code>on_load</code>. | ||
<span id="syntax"></span> | |||
== Syntax == | |||
<pre class="ascend">STUDY observed_var_list | |||
[VARY var FROM lower TO upper (STEPS n [LINEAR|LOG] | STEP delta | RATIO r)] | |||
[RUN method_name] | |||
[NOW] | |||
[FILE "path"];</pre> | |||
Examples: | |||
<pre class="ascend">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;</pre> | |||
<span id="semantics"></span> | |||
See more examples in {{srcdir|models/test/slvreq}}. | |||
== Semantics == | |||
* The observed variable list is required. | |||
* <code>VARY</code> is optional. | |||
* <code>RUN method_name</code> is optional and is executed before each study point. | |||
* <code>FILE</code> is optional. | |||
* <code>NOW</code> is optional. | |||
* The varied variable may also appear in the observed variable list. | |||
* When <code>VARY</code> is 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 <code>SOLVER</code> / <code>OPTION</code> statements. They are not restated inside <code>STUDY</code>. | |||
Stepping modes: | |||
* <code>STEPS n</code> means <code>n</code> intervals with both endpoints included. | |||
* <code>STEP delta</code> uses a linear increment. | |||
* <code>RATIO r</code> uses a logarithmic/geometric progression. | |||
* <code>STEPS n LOG</code> requests logarithmic spacing. | |||
* <code>STEPS n</code> without <code>LOG</code> uses linear spacing. | |||
Validation rules: | |||
* <code>STEP</code> must be non-zero and must move from the lower bound toward the upper bound. | |||
* <code>RATIO</code> must be positive, not equal to <code>1</code>, and must move from the lower bound toward the upper bound. | |||
* Logarithmic studies require both bounds to be positive. | |||
<span id="a4-run"></span> | |||
== <code>./a4 run</code> == | |||
In the <code>ascxx</code> / CLI path, <code>STUDY</code> is interpreted in two different ways depending on whether <code>VARY</code> is present. | |||
* If <code>VARY</code> is present, the requested cases are solved in sequence. | |||
* If <code>RUN</code> is present, the named method is run before each study point. | |||
* <code>NOW</code> is 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 <code>FILE</code> is present, the table is written there and a note is emitted telling the user where it went. | |||
* If <code>FILE</code> is omitted, the table is written to standard output. | |||
* If <code>VARY</code> is omitted, the observed variables are stored as the model’s default post-solve print list. <code>a4 run</code> then prints them after the main solve using <code>name = value</code> formatting, but only when no explicit <code>-p/--print</code> arguments were supplied. Explicit <code>-p</code> arguments take precedence over this model-defined list. | |||
* If any <code>STUDY ... VARY ...</code> request is encountered during the run, the deferred no-<code>VARY</code> print action is suppressed for that run. | |||
Current output format is TSV. | |||
<span id="gtk-browser"></span> | |||
== GTK Browser == | |||
In the GTK browser, <code>STUDY</code> 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 <code>VARY</code> is present, the varied variable is added first if it is not already present. | |||
* If <code>VARY</code> is omitted, the Observer is populated and no Study dialog is opened. | |||
* If <code>VARY</code> is present, the Study dialog is opened with the variable, bounds, stepping mode, distribution, and optional <code>RUN</code> method pre-populated. | |||
* If <code>VARY</code> is present and <code>NOW</code> is supplied, the pre-populated study is executed immediately without waiting for the user to press <code>OK</code>. | |||
* Solving then proceeds through the existing interactive Study dialog behavior. | |||
Current GTK limitation: | |||
* <code>FILE</code> is 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: | |||
* <code>ON_ERROR STOP | SKIP | CONTINUE</code> | |||
<span id="tcltk"></span> | |||
== Tcl/Tk == | |||
The METHOD <code>STUDY</code> statement is currently not implemented in the Tcl/Tk GUI. | |||
[[Category:Syntax]] | [[Category:Syntax]] | ||
Latest revision as of 00:58, 10 March 2026
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.