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]
[--scheme SCHEME] [--order ORDER] [--adapt TOL] [--monitor MONITOR]
[--solver SOLVER] [--steady-solver SOLVER]
[--steady-solver-option KEY=VALUE]
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.--scheme SCHEMEOverride the discretisation scheme from the
simulatecommand —crank_nicolson(default),gauss,radauorlobatto_iiia. See Discretisation schemes.--order ORDERCollocation order for a multi-stage
--scheme(integer; the family default when omitted; not accepted forcrank_nicolson).--adapt TOLTurn on adaptive mesh refinement to the error tolerance
TOL(float);Nbecomes the starting resolution. See Time grids and adaptive refinement.--monitor MONITORThe error monitor driving
--adapt—residual(default) orrichardson. Requires--adapt. See Time grids and adaptive refinement.--solver SOLVERChoose the linear backend, overriding the
simulatedirective —auto(default),superlu,klu,klu-nobtf,umfpackorpardiso. An unavailable backend is reported as a clean error. See Linear solvers.--steady-solver SOLVERChoose the nonlinear steady-state algorithm, overriding the
steadydirective —auto(default),newton,hybr,lm,kinsol,homotopy,broyden,krylov,df-saneoranderson. See Steady-state solvers.--steady-solver-option KEY=VALUESet a backend-specific option for the steady solver; repeatable, e.g.
--steady-solver-option strategy=picard. Requires a named--steady-solver(the defaultautorejects options). Numeric values are coerced. See Steady-state solvers.
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 input file cannot be read, the output CSV cannot be written, or the macroprocessor / parser / IR / codegen / solver rejected it (a missing
simulatecommand with no-T/-Noverride surfaces as a solver error). The message is written tostderr, 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.