Command-line interface¶
The continuo console script is a thin wrapper over the Python API:
it parses a .mod file, runs the simulation, and writes the solved
path to a CSV.
Synopsis¶
continuo MODEL.mod [-o OUTPUT.csv] [-T HORIZON] [-N INTERVALS]
Positional argument¶
MODEL.modPath to the
.modfile to solve. The file must contain asimulatecommand (or supply-T/-Nto fill in the missing pieces).
Options¶
-o OUTPUT.csv,--output OUTPUT.csvPath of the CSV file to write. Defaults to
MODEL.csv(same directory and stem as the input).-T HORIZON,--horizon HORIZONOverride the simulation horizon
Tfrom thesimulatecommand. Float, positive.-N INTERVALS,--intervals INTERVALSOverride the grid resolution
N. Integer, positive.
Output format¶
The CSV has one row per grid point. The first column is the time
t; subsequent columns are the endogenous variables in declaration
order, with the header line giving their names:
t,K,A,C,Y
0.0,4.0163,1.05,1.1898,1.6613
0.2,4.0295,1.0452,1.1912,1.6556
...
50.0,4.0167,1.0,1.1806,1.5823
Exit status¶
0Success.
1A user-facing error: the file cannot be read, the macroprocessor / parser / IR / codegen / solver rejected it, or the file has no
simulatecommand and neither-Tnor-Nwere supplied. The error message is written tostderrand is prefixed withcontinuo:.
Anything else is a bug.
Examples¶
$ continuo rbc.mod # writes rbc.csv
continuo: wrote 251 rows to rbc.csv
$ continuo rbc.mod -T 100 -N 500 # longer horizon, finer grid
continuo: wrote 501 rows to rbc.csv
$ continuo rbc.mod -o /tmp/out.csv # explicit output path
continuo: wrote 251 rows to /tmp/out.csv
Programmatic equivalent¶
The CLI is implemented in continuo.cli and is exactly
equivalent to:
import continuo
model = continuo.parse("MODEL.mod")
sol = model.simul(horizon=T, intervals=N) # T, N optional overrides
# write sol.t and sol.path to CSV ...
See Python API for the Python interface.