CREATE

<< Click to Display Table of Contents >>

Navigation:  Gekko User Manual > Gekko statements >

CREATE

Previous pageReturn to chapter overviewNext page

This statement creates a new series in the first-position databank. The series contains no data, and the statement is normally only used in so-called sim-mode for modeling (cf. MODE). (If you just need to construct an empty series x, you can always write = m();, putting missing values into the series).

 


 

Syntax

 

create variables;

 

variables

Variablename(s) or list(s)

 

If a variable is stated without databank, the databank is assumed to be the first-position databank.

 

The reason for CREATE in sim-mode is to avoid accidentally creating a new variable because of misspelling etc. Imagine a model with exogenous variable b_vat = 0.25. The user thinks that the variable name is vat. Without a mandatory CREATE, setting vat = 0.26 will just create a new series that has no relation to the model, and hence has no effect on the mode. With mandatory CREATE, setting vat = 0.26 will result in an error, and the user will hopefully discover that the proper name is b_vat.

 

There is an exception to the create rule: names beginning with xx can always be auto-created even in sim-mode (useful for temporary series variables).

 


 

Examples

 

In sim-mode, variables cannot be created on the fly, for instance:

 

reset;
mode sim;
= 100; //fails

 

Here, x cannot be auto-created. The following will work:

 

reset;
mode sim;
create x;
= 100; //ok

 

Series beginning with xx are always auto-created even in sim-mode.

 


 

Related options

 

option databank create auto = yes;

 


 

Related statements

 

MODEL, SERIES, SIM