====== Tutorial 1 - Creating the model objects ====== ===== 2/5 ===== **Creating a project** - Create a new project by clicking the {{:New24.png|New}}**New** button on the [[Menu_bar#Toolbar|toolbar]] or by selecting **File | New** from the [[Menu_bar|Menu bar]]. - Make sure that the [[Modeling_layout|Modeling layout]] is visible by clicking the {{:MatrixView24.png}} **Modelling** button on the [[Menu_bar#Toolbar|toolbar]]. \\ **Adding algebraic expressions** The algebraic expressions of the model are implemented by creating [[Expression|Expression]] blocks. There are several ways of creating [[Expression|Expression]] blocks: * In the [[Interaction_matrix|Interaction matrix]] of the [[Matrix_window|Matrix window]] * In the [[Blocks_window|Blocks window]] * When entering expressions for other objects. * In the [[Graph_window|Graph window]]. In this lesson we will explore the first three ways. The [[Graph_window|Graph window]] will be covered in a later tutorial. \\ **Creating Income using the [[Matrix_window|Matrix window]]** - Make sure that the [[Matrix_window|Matrix window]] is opened by selecting **Window | Matrix** from the [[Menu_bar|Menu bar]]. - Right-click the first diagonal element in the [[Interaction_matrix|Interaction matrix]]. Select **[[Expression|Expression]]** from the pop-up menu. - Double-click the [[Expression|Expression]], or right-click it and select **Edit** from the pop-up menu. - Make sure that the **Properties** tab is selected, and enter “Income” in the **Name** field. - Select the **Values** tab. In the **Value** column, write the expression “Sales + Fees” on the **Expression** row and press //Enter//. A window will appear as two unknown objects are referred to in the expression. These are both time-dependent input values, select “Lookup Table” from the **Type** drop-down list for both //Sales// and //Fees//. Click **Ok**. - Close the edit window by clicking **Ok** \\ **Creating Profit from the [[Blocks_window|Blocks window]]** - Make sure that the [[Blocks_window|Blocks window]] is visible by selecting **Window | Blocks** from the [[Menu_bar|Menu bar]]. The window should list the three [[Block|Block]]s that you have already created: //Income//, //Sales// and //Fees//. - Either select “Expression” from the **Type** drop-down list and click the {{:New24.png|New}}**New** button on the [[windows#Title_bar|title bar]], or right-click the window and select **Create | Expression** from the pop-up menu. - In the table, click the **Name** field for the newly created [[Expression|Expression]] and write “Profit”. - Next, click the **Value** field for the [[Expression|Expression]] and write “Income - Expenses”. Like before, Ecolego will discover unknown objects when you click //Enter//. The unknown object is “Expenses”; select “Expression” from the **Type** drop-down list. Click **Ok** to close the window. {{:Tutorial1-1b.png|screenshot}} - You should now see a new [[Expression|Expression]] in the list of [[Block|blocks]] named “Expenses”. Enter “Salary + Tax + Rent” in the **Value** field, where * //Salary// is a [[Parameter|Parameter]] * //Tax// is an [[Expression|Expression]] * //Rent// is a [[Parameter|Parameter]] \\ **Using the [[Expression_editing_tool|Expression editing tool]]** - Instead of writing the equation for the //Tax// [[Expression|Expression]] directly, right click the //Tax// block in the table and select **Edit** from the pop-up menu. - Make sure that the **Values** tab is selected. |Note|Instead of double-clicking income, try to use auto-completion: write "i" and press space, use the arrow keys to select Income and press enter. Read more [[Expression_editing_tool|here]]| - Click the **Equation** field of the table. The [[Expression_editing_tool|Expression editing tool]] will appear to assist you when writing the expression. As you see, there is a list of all [[Block|blocks]] of your model. Double-click //Income// to add it to the expression. Click the asterix (’*’) on the key-pad, and then write “TaxRate” so that the full expression becomes “Income * TaxRate”. When you press //Enter// and the “Unknown values” window appears, select “Parameter” for //TaxRate//. - Click **Ok** to close the windows.\\ \\ \\ **Next** * [[Tutorial_1-Defining_inputs|Defining inputs (3/5)]] **Previous** * [[Tutorial_1-Creating_a_simple_model|Creating a simple model]] **References** * [[Tutorials|Back to Tutorials]] * [[start|Home]]