Difference between revisions of "Tutorial: Advanced System Dynamics Modelling"
m (Is output location changed from additional information to equation tab) |
|||
(30 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | |||
− | |||
− | |||
− | |||
In this tutorial, we are going to bild a work model with two projects and shared workforce. Both the workforce and a separate project (work) are going to be created as modules, so they can be reused several times. Actually the model doesn't limit the number of projects at all. | In this tutorial, we are going to bild a work model with two projects and shared workforce. Both the workforce and a separate project (work) are going to be created as modules, so they can be reused several times. Actually the model doesn't limit the number of projects at all. | ||
Line 11: | Line 7: | ||
Then create two new modules to your model. Right-click on the Modules folder and select New->Module. | Then create two new modules to your model. Right-click on the Modules folder and select New->Module. | ||
− | Name your model WorkModel and modules | + | Name your model WorkModel and modules WorkforceModule and WorkModule. You can rename them by right-clicking on the item on the model browser and selecting Rename. |
{| | {| | ||
Line 24: | Line 20: | ||
We will use a top-down approach in our model, so first we will make a simple model configuration with our modules. Open our model configuration by double-clicking Configuration in your model browser. | We will use a top-down approach in our model, so first we will make a simple model configuration with our modules. Open our model configuration by double-clicking Configuration in your model browser. | ||
− | Drag one | + | Drag one WorkforceModule and one WorkModule from your model browser to the WorkModel diagram. The modules are automatically named with a suffix number. Rename the modules to Workforce and Work1. You can rename objects on the diagram by double-clicking them or selecting them with one click and renaming them on the properties view below the diagram. |
<br style="clear: both" /> | <br style="clear: both" /> | ||
[[File:ConfigurationStart.png|right|frame|Workforce and Work modules, first inputs and connections]] | [[File:ConfigurationStart.png|right|frame|Workforce and Work modules, first inputs and connections]] | ||
− | When the modules are on the diagram, we should think what values we would like to get from the modules and what values would | + | When the modules are on the diagram, we should think what values we would like to get from the modules and what values we would like to use in the modules. |
− | Workforce needs to know, how much work is required and it should | + | Workforce needs to know, how much work is required and it should provide information on how much work can be done. To provide the information on how much work can be done, we need an Input variable. Variables can be dragged to the diagram from Symbols view or by using [[System Dynamics Modelling#Shortcut and control keys|shortcut keys]] (Shift+I for Input variable). Drag an input variable to the diagram and name it TotalPossibleWorkingSpeed. |
Work module on the other hand provides information on how much work is required in it and it needs to know when the work has to be ready. Create an input variable RequiredWorkingSpeed1 and an Auxiliary variable Work1CompletionTime and place all variables like in the picture on the right. | Work module on the other hand provides information on how much work is required in it and it needs to know when the work has to be ready. Create an input variable RequiredWorkingSpeed1 and an Auxiliary variable Work1CompletionTime and place all variables like in the picture on the right. | ||
Line 53: | Line 49: | ||
Now you have used all the basic components and connections. From now on the instructions will be a more simplified. | Now you have used all the basic components and connections. From now on the instructions will be a more simplified. | ||
− | Next we will create four Auxiliary variables: TimeToAllocateResources, WorkforceRequired, Productivity and PossibleWorkingSpeed. Place and connect them | + | Next we will create four Auxiliary variables: TimeToAllocateResources, WorkforceRequired, Productivity and PossibleWorkingSpeed. Place and connect them according to the picture on the right. |
− | To be able to simulate the model, all variables must have valid equations. To configure an equation, select a variable. | + | To be able to simulate the model, all variables must have valid equations. To configure an equation, select a variable. Variable's properties are shown in the Property view and you can input the required equations in the text fields. You can copy the equations directly from here or type them manually. Variables connected to the selected variable are shown in the Variables list. To speed up typing, you can double click on a variable name and it will be inserted to the equation. |
WorkforceStock <br /> | WorkforceStock <br /> | ||
Line 62: | Line 58: | ||
NetResourcing <br /> | NetResourcing <br /> | ||
= (WorkforceRequired - WorkforceStock)/TimeToAllocateResources | = (WorkforceRequired - WorkforceStock)/TimeToAllocateResources | ||
− | |||
− | |||
− | |||
TimeToAllocateResources <br /> | TimeToAllocateResources <br /> | ||
− | |||
= 2 | = 2 | ||
Productivity <br /> | Productivity <br /> | ||
− | |||
= 1 | = 1 | ||
+ | PossibleWorkingSpeed <br /> | ||
+ | = WorkforceStock * Productivity<br /> | ||
+ | Is Output | ||
+ | Variables can be set as output by selecting Is Output option from the Equation tab. | ||
<br style="clear: both" /> | <br style="clear: both" /> | ||
Line 90: | Line 85: | ||
[[File:WorkStocks.png|right|frame|Basic work with errors]] | [[File:WorkStocks.png|right|frame|Basic work with errors]] | ||
− | Open | + | Open Work1 module by selecting it from the WorkModel diagram, right-clicking it and selecting Show Module. Alternatively you can double click Work1 on the model browser. |
Create the basic flow of work with stocks and flows like in the picture on the right. | Create the basic flow of work with stocks and flows like in the picture on the right. | ||
Line 100: | Line 95: | ||
[[File:ProjectIsReady.png|right|frame|Smoothener for work is done]] | [[File:ProjectIsReady.png|right|frame|Smoothener for work is done]] | ||
− | Work needs to be stopped when the project is ready. Since the simulator might face some difficulties to determine the projects readyness when project is almost ready, we need to implement some smoothing to the limit. OpenModelica doesn't yet have a builtin function for smoothing, so we need to implement our own. | + | Work needs to be stopped when the project is ready. Since the simulator might face some difficulties to determine the projects readyness when project is almost ready, we need to implement some smoothing to the limit. OpenModelica doesn't yet have a builtin function for smoothing, so we need to implement our own. Create variables and connections according to the picture on the right. |
Use the following equations for variables: | Use the following equations for variables: | ||
Line 110: | Line 105: | ||
= (xidz(WorkDone, ProjectWorkAmount, 0.0) - ProjectIsReady) / 0.08 | = (xidz(WorkDone, ProjectWorkAmount, 0.0) - ProjectIsReady) / 0.08 | ||
− | xidz is short for function X if devided by zero. | + | xidz is short for function X if devided by zero. This means that the simulation calculates ''WorkDone / ProjectWorkAmount''. If ProjectWorkAmount is zero, the result is the third argument ''0.0''. |
[[File:ProjectWorkAmount.png|right|frame|ProjectWorkAmount input variable]] | [[File:ProjectWorkAmount.png|right|frame|ProjectWorkAmount input variable]] | ||
Line 127: | Line 122: | ||
WorkQuality<br /> | WorkQuality<br /> | ||
− | |||
= 0.9 | = 0.9 | ||
Line 135: | Line 129: | ||
Lookup table: {{0,5},{0.5,3},{1,0.5},{2,0.5}} | Lookup table: {{0,5},{0.5,3},{1,0.5},{2,0.5}} | ||
− | WithLookup is a variable type where the value is interpolated from a 2-dimensional table (Lookup table) using the value determined in the "With Lookup" field. | + | WithLookup is a variable type where the value is interpolated from a 2-dimensional table (Lookup table) using the value determined in the "With Lookup" field. Type can be changed from the drop-down menu Type. |
<br style="clear: both" /> | <br style="clear: both" /> | ||
− | [[File:WorkAllocation.png|right|frame| | + | [[File:WorkAllocation.png|right|frame|WorkAllocation and RequiredWorkingSpeed]] |
− | To calculate our own need | + | To calculate our own need for workforce we need to create and connect WorkCompletionTime input variable and the following auxliary variables: |
RequiredWorkingSpeed <br /> | RequiredWorkingSpeed <br /> | ||
− | = if ProjectIsReady < 1 then xidz(WorkToDo, TimeToDeadline, MaximumWorkingSpeed) else 0 | + | = if ProjectIsReady < 1 then xidz(WorkToDo, TimeToDeadline, MaximumWorkingSpeed) else 0<br /> |
+ | Is Output | ||
MaximumWorkingSpeed <br /> | MaximumWorkingSpeed <br /> | ||
− | |||
= 500 | = 500 | ||
TimeToDeadline <br /> | TimeToDeadline <br /> | ||
− | = max(0, | + | = max(0, WorkCompletionTime-time) |
time is a universal variable that gives the current simulation time. | time is a universal variable that gives the current simulation time. | ||
− | + | We need to decide how the workforce is allocated between all the work modules that are using the same workforce. For that we need to know how much work can be done and how much workforce other works require. | |
+ | |||
+ | Create two Inputs, RequiredWorkingSpeedTotalInput and PossibleWorkingSpeedInput, and an auxiliary variable WorkAllocation. Connect the variables like int the picture. | ||
+ | |||
+ | WorkAllocation<br /> | ||
+ | = xidz(RequiredWorkingSpeed, RequiredWorkingSpeedTotalInput, 0.0) * PossibleWorkingSpeedInput | ||
+ | <br style="clear: both" /> | ||
+ | |||
+ | Finally let's give initial values for all the remaining variables: | ||
+ | |||
+ | WorkingSpeed <br /> | ||
+ | = if ProjectIsReady < 1 then WorkAllocation else 0 | ||
+ | |||
+ | WorkToDo <br /> | ||
+ | Initial value: ProjectWorkAmount | ||
+ | |||
+ | WorkDone <br /> | ||
+ | Initial value: 0 | ||
+ | |||
+ | Errors <br /> | ||
+ | Initial value: 0 | ||
+ | |||
+ | ===Connecting modules=== | ||
+ | |||
+ | Our modules are complete. Let's get back to the WorkModel Configuration. | ||
+ | |||
+ | Set Work1CompletionTime to 10. | ||
+ | |||
+ | [[File:ModuleConnections1.png|right|frame|Module input connections]] | ||
+ | Connections between modules are made in the properties of the module. Select Work1 and open tab Inputs from the properties. The table lists all input variables in the module that are available. Clicking on the Refers to output column will open a drop-down menu that shows all available variables that are connected to the module. By selecting a variable, you connect that variable to the input. | ||
+ | <br style="clear: both" /> | ||
+ | |||
+ | [[File:RequiredWorkingSpeed1Connection.png|right|thumb|Connection from RequiredWorkingSpeed to Work1]] | ||
+ | [[File:ModuleConnections2.png|right|frame|Module input connections]] | ||
+ | Work1 need also information on how much working speed is required by all works. Since Work1 is the only work, create a dependency connection from RequiredWorkingSpeed1 to Work1 and in Work1's properties connect it to RequiredWorkingSpeedTotalInput. | ||
+ | <br style="clear: both" /> | ||
+ | |||
+ | In Outputs tab, make the only possible connection: from RequiredWorkingSpeed to RequiredWorkingSpeed1. | ||
+ | |||
+ | Workforce module has only one input and one output. Create the only possible connections:<br /> | ||
+ | (Inputs) RequiredWorkingSpeedInput -> RequiredWorkingSpeed1<br /> | ||
+ | (Outputs) PossibleWorkingSpeed -> TotalPossibleWorkingSpeed | ||
+ | |||
+ | Now your model is ready for simulation! | ||
+ | |||
+ | ===Simulating the model=== | ||
+ | |||
+ | To make the simulation time longer, select Configuration on the model browser. Give the model Stop time 24.0 | ||
+ | |||
+ | [[File:ActivateExperiment.png|right|frame|Experiment activation]] | ||
+ | To run simulations, you must activate an experiment. Expand the experiments folder on your model browser. There is one ready-made experiment. Double click on the experiment and the experiment control buttons appear on the toolbar. Press the play button [[File:ExperimentPlay.png]]. | ||
+ | |||
+ | System shows the simulation progress in the progress bar on the lower right corner of the screen. | ||
+ | |||
+ | [[File:SimulationProgress.png]] | ||
+ | |||
+ | When the progress indicator disappears, the simulation is complete. | ||
+ | |||
+ | If the Console view pops up and shows an error "Error: Too few equations, underdetermined system. The model has X equation(s) and Y variable(s)", the simulation has failed. The reason might be that you forgot to assign an equation to some variable or some connection in modules. See through all the variables, write the missing equation and simulate again. | ||
+ | |||
+ | After the simulation is succesfully run, you can select a variable and see its simulation results in the trend view. For example WorkDone variable in Work1 module will give the following graph. | ||
+ | |||
+ | [[File:FirstSimulation.png]] | ||
+ | |||
+ | <br style="clear: both" /> | ||
+ | |||
+ | ===Adding modules=== | ||
+ | |||
+ | [[File:ModulesFinal.png|right|frame|Final configuration with two modules]] | ||
+ | We created the WorkModule to be reusable. To use two WorkModules in the model, you must do the following. | ||
+ | |||
+ | Populate a second WorkModule to WorkModel configuration and name it Work2. | ||
+ | |||
+ | Create RequiredWorkingSpeed2 input variable and Work2CompletionTime auxiliary variable. | ||
+ | |||
+ | We need a sum of all working speed requirements to give to the work modules. For this purpose, create an auxiliary variable RequiredWorkingSpeedTotal which sums the requirements. | ||
+ | |||
+ | You can also have a different size work. To make Work2 smaller, create an auxiliary variable Work2Amount. | ||
+ | |||
+ | Use the following equations: | ||
+ | |||
+ | Work2CompletionTime<br /> | ||
+ | = 13 | ||
+ | |||
+ | Work2Amount<br /> | ||
+ | = 800 | ||
+ | |||
+ | RequiredWorkingSpeedTotal<br /> | ||
+ | = RequiredWorkingSpeed1 + RequiredWorkingSpeed2 | ||
+ | |||
+ | Update connections to match connections shown in the picture and connect the inputs and outputs to the modules. | ||
+ | |||
+ | Workforce<br /> | ||
+ | RequiredWorkingSpeedInput -> RequiredWorkingSpeedTotal | ||
+ | |||
+ | Work1 Inputs<br /> | ||
+ | RequiredWorkingSpeedTotalInput -> RequiredWorkingSpeedTotal | ||
+ | |||
+ | Work2 Outputs<br /> | ||
+ | RequiredWorkingSpeed -> RequiredWorkingSpeed2 | ||
+ | |||
+ | Work2 Inputs<br /> | ||
+ | [[File:Module2Inputs.png]] | ||
+ | |||
+ | |||
+ | When all the connections are made, you can simulate the model again. Now you have model with two work modules. Select variables from both modules in model browser to display them in trend view. | ||
+ | |||
+ | [[File:SecondSimulation.png]] | ||
+ | |||
+ | <br style="clear: both" /> | ||
+ | |||
+ | <!--- | ||
+ | Operating interfaces not supported right now | ||
+ | ===Creating an Operating Interface=== | ||
+ | |||
+ | [[File:NewOperatingUI.png|right|frame|New Operating UI]] | ||
+ | To use the model and adjust its parameters without seeing the actual model, we can use Operating interfaces. Create a new operating interface by right-clicking Operating interfaces on the model browser and selecting New -> Operating UI. Double click the created operating ui to open it. | ||
+ | |||
+ | Switch to Symbols view. WidgetLibrary shows all the widgets that can be used when creating an operating interface. We will create a simple interface with a trend and two sliders. | ||
+ | <br style="clear: both" /> | ||
+ | |||
+ | [[File:FirstOUI.png|right|frame|Operating UI with a trend and two sliders]] | ||
+ | Drag a trend to the diagram. Adjust the size of the trend so that it is larger. The size of the elements can be adjusted by first selecting the element and then draggign from the lower right corner of the element. | ||
+ | |||
+ | Then drag two sliders to the right side of the trend. | ||
+ | |||
+ | Now you should have an operating user interface that looks something like the picture on the right. | ||
− | + | To be able to use the interface, we need to configure the elements and connect them to the actual variables on the model. First let's configure the sliders. | |
+ | We are going to adjust the time when Work1 and Work2 are ready. Our simulation time ranges from 0 to 24, so that is the range that we are going to use in our sliders. Select one of the sliders. The Property view shows all the different properties that can be configured in the element. Do the following settings for both sliders: | ||
+ | |||
+ | [[File:SliderProperties.png|none|frame|Slider properties]] | ||
+ | |||
+ | Then select the trend element. Set its Title to "Work1 and Work2" and Y-Axis Label to "Work Done" | ||
+ | |||
+ | Now we need to connect the actual variables to the elements. From Model Browser, drag Work1CompletionTime to the first slider and Work2CompletionTime to the second slider. | ||
+ | |||
+ | Then from each of the Work module, drag WorkDone to the trend element. | ||
+ | |||
+ | Activate an experiment by double clicking it, activate the Operating UI by clicking it and switch it to operating mode with the switch button [[File:OperatingModeSwitch.png]] on the main toolbar. | ||
+ | |||
+ | Run a simulation. The trend element should show the results of the simulation. Adjust the completion times from the sliders and simulate again. | ||
+ | |||
+ | [[File:OperatingUI.png|none|frame|Ready Operating interface]] | ||
<br style="clear: both" /> | <br style="clear: both" /> | ||
+ | |||
+ | --> | ||
[[Category:Tutorials]] | [[Category:Tutorials]] |
Latest revision as of 09:05, 3 December 2013
In this tutorial, we are going to bild a work model with two projects and shared workforce. Both the workforce and a separate project (work) are going to be created as modules, so they can be reused several times. Actually the model doesn't limit the number of projects at all.
Contents
Creating model and modules
Let's start by creating the work model and the needed modules. First create a new model by right-clicking on the model browser and selecting New->Model. Alternatively you can select File->New Model from the main menu.
Then create two new modules to your model. Right-click on the Modules folder and select New->Module.
Name your model WorkModel and modules WorkforceModule and WorkModule. You can rename them by right-clicking on the item on the model browser and selecting Rename.
Initial configuration
We will use a top-down approach in our model, so first we will make a simple model configuration with our modules. Open our model configuration by double-clicking Configuration in your model browser.
Drag one WorkforceModule and one WorkModule from your model browser to the WorkModel diagram. The modules are automatically named with a suffix number. Rename the modules to Workforce and Work1. You can rename objects on the diagram by double-clicking them or selecting them with one click and renaming them on the properties view below the diagram.
When the modules are on the diagram, we should think what values we would like to get from the modules and what values we would like to use in the modules.
Workforce needs to know, how much work is required and it should provide information on how much work can be done. To provide the information on how much work can be done, we need an Input variable. Variables can be dragged to the diagram from Symbols view or by using shortcut keys (Shift+I for Input variable). Drag an input variable to the diagram and name it TotalPossibleWorkingSpeed.
Work module on the other hand provides information on how much work is required in it and it needs to know when the work has to be ready. Create an input variable RequiredWorkingSpeed1 and an Auxiliary variable Work1CompletionTime and place all variables like in the picture on the right.
Connect the variables to modules using dependency connections (arrows). Connections are created by holding down Alt key and first clicking on the variable where to start the connection and then clicking on the variable where to end.
Now we have the initial idea of the model, so let's configure the modules.
Workforce module
Open Workforce module by selecting it from the diagram, right-clicking it and selecting Show Module.
Create a Stock variable and name it WorkforceStock. Stock variables are created the same way as Input and Auxiliary variables. The level of the stock is controlled with a valve and a flow. To create the flow, hold down Alt and right-click on an empty space left of the stock. Then left-click on the stock. A cloud, valve and a flow is created. Rename the valve to NetResourcing.
NetResourcing works both ways. To display this also visually, delete the cloud by selecting it and pressing delete on your keyboard. Then create a flow starting from NetResourcing valve and ending on an empty space next to it.
Now you have used all the basic components and connections. From now on the instructions will be a more simplified.
Next we will create four Auxiliary variables: TimeToAllocateResources, WorkforceRequired, Productivity and PossibleWorkingSpeed. Place and connect them according to the picture on the right.
To be able to simulate the model, all variables must have valid equations. To configure an equation, select a variable. Variable's properties are shown in the Property view and you can input the required equations in the text fields. You can copy the equations directly from here or type them manually. Variables connected to the selected variable are shown in the Variables list. To speed up typing, you can double click on a variable name and it will be inserted to the equation.
WorkforceStock
Initial value: 0
NetResourcing
= (WorkforceRequired - WorkforceStock)/TimeToAllocateResources
TimeToAllocateResources
= 2
Productivity
= 1
PossibleWorkingSpeed
= WorkforceStock * Productivity
Is Output
Variables can be set as output by selecting Is Output option from the Equation tab.
On a previous phase, we wanted to give the value of RequiredWorkingSpeed1 to this workforce module. To get that value, we need to create an input. Create input RequiredWorkingSpeedInput, connect it to WorkforceRequired and write the following equation to WorkforceRequired.
WorkForceRequired
= RequiredWorkingSpeedInput/Productivity
Now this module is ready to be used as a part of the model.
Work module
Open Work1 module by selecting it from the WorkModel diagram, right-clicking it and selecting Show Module. Alternatively you can double click Work1 on the model browser.
Create the basic flow of work with stocks and flows like in the picture on the right.
The idea of the model is that first there is work. Work is done at a certain speed. When working, errors are also made. When errors are found, the amount of Errors is reduced, errors are removed from WorkDone and moved back to WorkToDo.
Work needs to be stopped when the project is ready. Since the simulator might face some difficulties to determine the projects readyness when project is almost ready, we need to implement some smoothing to the limit. OpenModelica doesn't yet have a builtin function for smoothing, so we need to implement our own. Create variables and connections according to the picture on the right.
Use the following equations for variables:
ProjectIsReady
Initial value: 0
ProjectReadyness
= (xidz(WorkDone, ProjectWorkAmount, 0.0) - ProjectIsReady) / 0.08
xidz is short for function X if devided by zero. This means that the simulation calculates WorkDone / ProjectWorkAmount. If ProjectWorkAmount is zero, the result is the third argument 0.0.
As you can see, ProjectWorkAmount is highlighted. Your model doesn't contain such variable and it is not connected to ProjectReadyness. Create an Input variable ProjectWorkAmount with default value 1000 and connect it to ProjectReadyness. The reason we are using input variable is that you can determine the default size of a project, but if you want to change it, you can change it from outside the module.
Next we need to define how errors are found. For that we need new variables: WorkQuality and ErrorsFoundTime. Create the variables and connections according to the picture and give variables their equations.
ErrorsGenerated
= (1-WorkQuality) * WorkingSpeed
ErrorsFoundRate
= Errors/ErrorsFoundTime
WorkQuality
= 0.9
ErrorsFoundTime
Type: WithLookup
With Lookup: xidz(WorkDone, ProjectWorkAmount, 0.0)
Lookup table: {{0,5},{0.5,3},{1,0.5},{2,0.5}}
WithLookup is a variable type where the value is interpolated from a 2-dimensional table (Lookup table) using the value determined in the "With Lookup" field. Type can be changed from the drop-down menu Type.
To calculate our own need for workforce we need to create and connect WorkCompletionTime input variable and the following auxliary variables:
RequiredWorkingSpeed
= if ProjectIsReady < 1 then xidz(WorkToDo, TimeToDeadline, MaximumWorkingSpeed) else 0
Is Output
MaximumWorkingSpeed
= 500
TimeToDeadline
= max(0, WorkCompletionTime-time)
time is a universal variable that gives the current simulation time.
We need to decide how the workforce is allocated between all the work modules that are using the same workforce. For that we need to know how much work can be done and how much workforce other works require.
Create two Inputs, RequiredWorkingSpeedTotalInput and PossibleWorkingSpeedInput, and an auxiliary variable WorkAllocation. Connect the variables like int the picture.
WorkAllocation
= xidz(RequiredWorkingSpeed, RequiredWorkingSpeedTotalInput, 0.0) * PossibleWorkingSpeedInput
Finally let's give initial values for all the remaining variables:
WorkingSpeed
= if ProjectIsReady < 1 then WorkAllocation else 0
WorkToDo
Initial value: ProjectWorkAmount
WorkDone
Initial value: 0
Errors
Initial value: 0
Connecting modules
Our modules are complete. Let's get back to the WorkModel Configuration.
Set Work1CompletionTime to 10.
Connections between modules are made in the properties of the module. Select Work1 and open tab Inputs from the properties. The table lists all input variables in the module that are available. Clicking on the Refers to output column will open a drop-down menu that shows all available variables that are connected to the module. By selecting a variable, you connect that variable to the input.
Work1 need also information on how much working speed is required by all works. Since Work1 is the only work, create a dependency connection from RequiredWorkingSpeed1 to Work1 and in Work1's properties connect it to RequiredWorkingSpeedTotalInput.
In Outputs tab, make the only possible connection: from RequiredWorkingSpeed to RequiredWorkingSpeed1.
Workforce module has only one input and one output. Create the only possible connections:
(Inputs) RequiredWorkingSpeedInput -> RequiredWorkingSpeed1
(Outputs) PossibleWorkingSpeed -> TotalPossibleWorkingSpeed
Now your model is ready for simulation!
Simulating the model
To make the simulation time longer, select Configuration on the model browser. Give the model Stop time 24.0
To run simulations, you must activate an experiment. Expand the experiments folder on your model browser. There is one ready-made experiment. Double click on the experiment and the experiment control buttons appear on the toolbar. Press the play button .
System shows the simulation progress in the progress bar on the lower right corner of the screen.
When the progress indicator disappears, the simulation is complete.
If the Console view pops up and shows an error "Error: Too few equations, underdetermined system. The model has X equation(s) and Y variable(s)", the simulation has failed. The reason might be that you forgot to assign an equation to some variable or some connection in modules. See through all the variables, write the missing equation and simulate again.
After the simulation is succesfully run, you can select a variable and see its simulation results in the trend view. For example WorkDone variable in Work1 module will give the following graph.
Adding modules
We created the WorkModule to be reusable. To use two WorkModules in the model, you must do the following.
Populate a second WorkModule to WorkModel configuration and name it Work2.
Create RequiredWorkingSpeed2 input variable and Work2CompletionTime auxiliary variable.
We need a sum of all working speed requirements to give to the work modules. For this purpose, create an auxiliary variable RequiredWorkingSpeedTotal which sums the requirements.
You can also have a different size work. To make Work2 smaller, create an auxiliary variable Work2Amount.
Use the following equations:
Work2CompletionTime
= 13
Work2Amount
= 800
RequiredWorkingSpeedTotal
= RequiredWorkingSpeed1 + RequiredWorkingSpeed2
Update connections to match connections shown in the picture and connect the inputs and outputs to the modules.
Workforce
RequiredWorkingSpeedInput -> RequiredWorkingSpeedTotal
Work1 Inputs
RequiredWorkingSpeedTotalInput -> RequiredWorkingSpeedTotal
Work2 Outputs
RequiredWorkingSpeed -> RequiredWorkingSpeed2
When all the connections are made, you can simulate the model again. Now you have model with two work modules. Select variables from both modules in model browser to display them in trend view.