LESSON 11: Creating local Submodels and using a Submodel in a Model


Local submodels can be created by simply selecting the parts of a model that will be converted to a submodel and clicking on the tab Edit → Create Submodel. The selection will be replaced by the new submodel and the visual representation of the new submodel will be available to be edited as a new tab on the script editor. At any time, the user can make changes to the local submodel and apply those changes clicking on Apply changes / Update Submodel Properties on the model toolbar.

It is also possible to select parts of a local submodel and create another local submodel using that selection. The new local submodel will be a dependency of the previous one, but the submodel creation process is basically the same. If the selection is empty, an empty local submodel will be created. The process for updating an empty submodel is the same process used to update any local submodel.

Initially, we will learn how to create a submodel and next we will learn how to use it in a Model. We will start with the model 5_calculate_lookup_table located in \Guidebook_Dinamica_5\Models\creating_and_using_local_submodels. Using this model we will answer the following question:

What is the productivity for each crop across the considered time window?

















Using the submodel in an independent model




To edit the submodel creating this input for the submodel, you need to open the submodel by clicking on its name in the lateral bar.









Next, click OK, and again OK:












The red box highlights the window in which the crop should be chosen








What does this result say about the productivity for each crop within the analyzed period?


We can infer that 2009 was the most productive year for Crop 1 along the analyzed period, with a productivity of 80.25549 tons/ha. For the Crop 2, 2015 was the most productive year, with a productivity of 3.535804 tons/ha and 2011 was the most productive year for Crop 3, with a productivity of 3.121386 tons/ha.

Congratulations, you have successfully completed this lesson!


Next Lesson
Back to Guidebook Start