Summary

You should now be comfortable with adding basic data, init and calc sections to your models. Keep in mind that initialization performed in a data section fixes a variable's value. Initialization done in an init section is used only as a temporary starting point, which may be of benefit in finding solutions to nonlinear models.  Initialization in a calc section holds until another calc expression redefining a variable’s value is encountered.  The benefit of placing computations in a calc section as opposed to placing them in the general constraint section is that calc expressions are treated as side computations and aren’t fed into the main solver, thereby improving execution times.

We have only touched on some of the basic features of data and init sections in this chapter. In subsequent sections, you will see how to add hooks in your data and init sections to external files, spreadsheets, and databases.