# Differences

This shows you the differences between two versions of the page.

 lesson_99 [2019/08/07 15:46]argemiro lesson_99 [2019/08/20 15:56] (current)argemiro ↷ Page name changed from lesson_13 to lesson_99 Both sides previous revision Previous revision 2019/08/20 15:56 argemiro ↷ Page name changed from lesson_13 to lesson_992019/08/07 16:14 argemiro 2019/08/07 16:04 argemiro 2019/08/07 15:46 argemiro ↷ Page name changed from lesson_111 to lesson_132019/08/07 15:46 argemiro 2019/08/07 15:41 argemiro ↷ Page name changed from lesson_13 to lesson_1112019/08/07 15:39 argemiro created Next revision Previous revision 2019/08/20 15:56 argemiro ↷ Page name changed from lesson_13 to lesson_992019/08/07 16:14 argemiro 2019/08/07 16:04 argemiro 2019/08/07 15:46 argemiro ↷ Page name changed from lesson_111 to lesson_132019/08/07 15:46 argemiro 2019/08/07 15:41 argemiro ↷ Page name changed from lesson_13 to lesson_1112019/08/07 15:39 argemiro created Line 4: Line 4: \\ \\ == Now that you have initial knowledges of Submodels on Dinamica EGO, we would like to demonstrate and explain how to create a Submodel and next we will learn how to use this Submodel created in a Model. ​ == Now that you have initial knowledges of Submodels on Dinamica EGO, we would like to demonstrate and explain how to create a Submodel and next we will learn how to use this Submodel created in a Model. ​ + \\ + \\ + For this, using the model developed in the previous exercise, we will answer the following question: + **How is the productivity for each crop along the analyzed period?** + \\ + \\ - ==For this, we will use the model created on the previous example.== + ==For this, we will use the model created on the lesson 11 (LINK).== \\ \\ + **Let'​s go!** + // + // + Select the functors of the Model that should be included in the Submodel: + \\ + \\ + {{ :​imagem79.png?​600 |}} + \\ + \\ + With this selection active, Click on Edit tab and next on the Create a Submodel to convert all selected functor into a local Submodel: + \\ + \\ + {{ :​imagem80.png?​400 |}} + \\ + \\ + In the Submodel Editor Window, insert a Submodel name (Calc Most Productive year) and define the input and output ports to this Submodel. ​ + \\ + \\ + {{ :​imagem81.png?​400 |}} + \\ + \\ + Now, our Submodel has been created:  ​ + \\ + \\ + {{ :​imagem82.jpg?​400 |}} + \\ + \\ + We can use this Submodel in an independent model. For demonstrate this, grab a “Load Table Functor” and place it on the sketch. Double click the Load Table Functor and open the IBGE_crop_information_complete.csv file. + \\ + \\ + Grab a “Reorder Table Column” and place it on the sketch to switch the order of the year and crop key columns. Connect the Load Table to Reorder Table Column. In the Functor Editor window insert the index of the column to be moved (“1”) and the new column index, similarly to previous exercise. + \\ + \\ + {{ :​imagem82.jpg?​400 |}} + \\ + \\ + Now, let's insert our previously created Submodel. First, click on the Submodels tab and from the library window grab a “Calc Most Productive year” Submodel and place it on the sketch. We want to calculate the most productive year for each crop; thus, we will use this Submodel 3 times, i.e. for the crops 1, 2 and 3. + \\ + \\ + {{ :​imagem83.png?​400 |}} + \\ + \\ + Now you need to save the results to a file. Grab three “Save Table” functors, place it on the sketch and connect to each Submodel (For the three crops). Open Save Map Functors, browse to the Guidebook Dinamica_4/​Models/​Set_2/​basics/​6_submodel and  write the name files (most_productive_year_for_crop_1.csv, ​ most_productive_year_for_crop_2.csv, ​ and most_productive_year_for_crop_3.csv). + \\ + \\ + The final model will look like this: - **Which Functors will you use in this lesson?**\\ \\ - • Functors:​ Calc areas and Calculate map \\ \\ \\ \\ - **We will use:** + {{ :imagem85.png?​400 |}} \\ \\ - - The protected areas map in the year 2000 (Guidebook Dinamica_4/​Database/​Protected_areas/​protected_areas_2000.tif) \\ \\ + Mark the eye button at the top of “Save Table” to view the results hereafter.\\ \\ \\ - - The Legal Amazon Conservation Priority map (Guidebook Dinamica_4/​Database/​Priority_areas/​priority_areas.tif) ​ + Save and run the model! ​ \\ \\ \\ \\ - - The Legal Amazon Biomass map (Guidebook Dinamica_4/​Database/​biomass/​biomass.tif) + Now, click on eye button of “Save Table” to see the result. These functors outputs are tables that looks like this: \\ \\ \\ \\ - **Let'​s go!** Initially, From the library window grab and place on the sketch the Load Categorical Map Functor, which are located in the Input/​Output tab. Double click, and open the protected_areas_2000.tif file. + {{ :imagem86.png?400 |}} \\ \\ \\ \\ + **What does this result say about the productivity for each crop along 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! Now let’s move to the next ones! + + +