## 4 Simulation Modeling for CN Emotion Appraisal
### IMEA SD Model
#### 4.1.3 Stocks and Flows Diagram  
This modeling phase consists of setting up a complete formal model with equations, parameters and initial conditions that represent the IMEA system. The IMEA SD causal loop diagram is used to start this modelling process in order to capture the mental models. Although a causal loop diagram shows the relationships among variables that have the potential to change over time, it does not make the distinction between different types of variables. The stocks and flows diagram allows such distinctions and maintains the causal relationships of the variables. Therefore, stocks and flows, along with feedback, are the two core concepts of systems dynamics theory.  
In this context, the IMEA SD stocks and flows diagram is presented in Figure 4. This diagram is based on the IMEA SD causal loop diagram of Figure 3. Thereby, the IMEA SD stocks and flows diagram is a more detailed graphic representation, where the quantification of what was modeled with the causal loop diagram is performed. Besides the output state variables _Valence_ and _Arousal_, five other state variables are identified--_MembSatisf_, _Commitment_, _Communication_, _PotenConflictsCreat_ and _CollabDynam_. In this way, there are seven structures of stocks-and-flows in the IMEA SD stocks and flows diagram.  
These seven structures are modeled with the quantification of its structures. This quantification is formalized with a set of equations that should not be interpreted as the only solution for the IMEA SD modeling approach, but rather as an example of how it could be realized. Furthermore, the values of the given weights will also depend on the requirements and objectives of each CN environment to be modeled, and must be calibrated accordingly. An example of a structural quantification--the _MembSatisf_--is presented below.  
Figure 4: IMEA SD stocks and flows diagram.  
The _MembSatisf_ stock variable is then the integral of the difference of _SatisfRate_ and _DissatisRate_ added to the initial value of the stock, and is represented in Equation (1):  
\[\begin{array}{ll}\mathit{MembSatisf}(t)&=\mathit{MembSatisf}(0)\\ &+\ \int\left[\mathit{SatisfRate}(t)-\mathit{DissatisRate}(t)\right]dt\\ \text{where,}&\mathit{MembSatisf}\in\ \Re\ \wedge\ \left\{0\leq\mathit{MembSatisf}\leq 1 \right\}\end{array} \tag{1}\]  
The _SatisfRate_ inflow is considered to be primarily driven by the needs and expectations met (_NeedsExpectMet_) and the performance evaluation (_PerfEval_) values at time \(t\). Therefore, due to their importance, both parameters should have a multiplicative factor of _wi_ that is supposed to be superior in relation to the other involved parameters. The other parameters are _Profitability_, _RepuRecog_ (reputation and recognition) and the _Valence_ values at time \(t\), and have as a multiplicative factor the weight _wj_.  
Taking into consideration that Valence varies between \(-1\) and \(1\), and all the other variables between \(0\) and \(1\), it needs to be adjusted accordingly. The adopted criterion was to reference the Valence parameter between \(0\) and \(1\). Therefore, a linear function (of the form \(y=mx+c\)) was fitted in order to reference the range of values. The analytical expression that captures this adjustment is described in Equation (2):  
\[\mathit{ValAdj}(t)=0.5\times\mathit{Valence}(t)+0.5 \tag{2}\]  
Equation (3), represents the _SatisfRate_ inflow.  
\[\begin{array}{ll}\mathit{SatisfRate}(t)=&\left[w_{i}\times(\mathit{NeedsExpectMet }\right.\\ &\left.+\mathit{PerfEval}\right)+w_{j}\times(\mathit{ValAdj}(t)\\ &\left.+\mathit{Profitability}\right.\\ &\left.+\mathit{RepuRecog}\right)\right]/\left(2\times w_{i}+3\times w_{j} \right)\\ &\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \  
For the specific case of this IMEA SD model, the values of the weights of this structure quantification and the other six are not the focus, instead, the proof that this modeling framework and simulation approaches are promising for this work's hypotheses.