The model block¶
The model; block lists the equations of the dynamic system. Each
equation is a continuous-time relation in the endogenous variables, the
exogenous processes, the parameters, and the reserved time t.
model;
diff(K) = Y - C - delta*K; // state equation
diff(A) = theta*(1 - A) + e; // state equation
diff(C) = C * (alpha*Y/K - delta - rho); // jump equation (Euler)
Y = A * K^alpha; // algebraic equation
end;
Equation forms¶
Two forms are accepted:
- Explicit
LHS = RHS ;— interpreted as the residualLHS - RHS = 0.- Bare
expr ;— interpreted asexpr = 0.
Both forms produce a residual; the assembled vector
F(ẋ, x, e, θ, t) = 0 is what the solver discretises and stacks.
Time derivatives: diff¶
The time derivative of a variable is written diff(x). Higher-order
derivatives may be written diff(x, k) (these are reduced to a chain
of first-order auxiliary states by the IR). diff is only meaningful
in the model block.
A var(state) or var(jump) must have its time derivative defined
on the left-hand side of exactly one equation; an algebraic var must
not.
What model does not accept¶
The shock-path shape helpers (
step,pulse,ramp,bump,expdecay,smoothstep) are forbidden inmodel. They are only meaningful as time-shape sugars inshockspaths; using one inmodelraises a clearCodegenError.Strings and dict literals have no numeric meaning in a model expression and are rejected.
For the operators and functions allowed in equations see Expressions.