gEconpy icon indicating copy to clipboard operation
gEconpy copied to clipboard

Add indexing syntax to GCN parser for construction of multiple similar blocks

Open jessegrabowski opened this issue 2 years ago • 0 comments

The gEcon R package allows for (something like) the following:

<i=(1,3)>
block HOUSEHOLD_<i>
{
    identities
        {
            C_<i>[] + I_<i>[] = r[] * K_<i>[-1] + w[] * L_<i>[] + Div_<i>[];
        };
};

This will automatically generate 3 household blocks with indices 1,2,3, along with the associated variables. It also allows for automatic summation across indexed variables, like:

Div[] = Sum<i>(Div_<i>[]);

This would be a nice feature when thinking about e.g. multiple sectors.

jessegrabowski avatar Feb 03 '23 17:02 jessegrabowski