Structural Dominance Analysis
of
Dynamic Systems

Sergey Naumov (snaumov@mit.edu), MIT
and
Rogelio Oliva (roliva@tamu.edu), Texas A&M

Wolfram Technology Conference
October 20, 2017
Champaign, IL

Join the Conversation #WolframTechConf

System Dynamics

computer simulation approach to the analysis of complex social, economic, environmental, and human systems

Roots in control theory.

Developed by Prof. Jay Forrester at MIT in the 1950s, who recognized that the principles of feedback control being used in engineering could also be used in the management of large-scale real-world systems (Forrester, 1961).

uses feedback thinking

The behavior of a system is viewed as an endogenous consequence of the interactions that occur between the elements in that system.

Feedback loops exist when the consequences of an action travel through a system and return, potentially changing the state of the system and influencing future.

focuses on endogenous explanations of behavior

Bass Model: feedback loop analysis

Traditional methods of analysis are largely trial-and-error simulations (experiments, sensitivity analysis) to discover structures by changing parameter values or switching individual links and feedback loops on and off.

S-shaped behavior of Adopters is the result of the interaction of two feedback loops:

2 – positive, word of mouth

1 – negative, exhaustion

Analysis of Large Models

Models are usually complex:

Most of them are nonlinear

Numerous feedback loops

Dozens of state variables, many soft variables

Traditional methods become an art. You can always miss something or not cover all parameter space. 
Even for simple models, observed behavior can be falsely attributed to certain feedback mechanisms, when in fact another set of feedbacks is driving the outcome.

Difficult to understand what causes the observed behavior without understanding dominance patterns in the underlying structure.

Needed: an exhaustive analysis and more robust and replicable method.

Mathematical Model analysis

A system can be described as a set of n coupled first-order ordinary differential equations, known as the state equations:

(((Subscript[dx, i])(t))/dt)=(Subscript[f, i])(x(t),u(t))

where x(t) is vector of state variables, and u(t) is vector of exogenous variables

Given f (model structure), x(0) (initial conditions), and u(t) (trajectories of input variables), the behavior of the system is completely determined.

In general form, however, there is no analytical solution to nonlinear systems. Even with few state variables x, the system can produce very complex behavior, including chaos (Richardson, 1988; Ott, 1993)

Linearization

The system can be linearized as:

(OverDot[x])(t)≈A x(t)+B u(t)

where A is n×n matrix of ((∂(Subscript[f, i]))/(∂(Subscript[x, j]))), and B is n×p matrix of ((∂(Subscript[f, i]))/(∂(Subscript[u, j])))

For a linear system, there is a solution as a function of its structure defined by the matrices A and B

A key element is the system eigenvalues, that is the eigenvalues (Subscript[λ, j]) of the matrix A. Then the solution is:

(Subscript[x, i])(t)=∑(Subscript[m, i j])(e^((Subscript[λ, j])t))

where (Subscript[m, i j]) is the weight of the behavior mode (e^((Subscript[λ, j])t))

State Space Representation

Suppose we have a system:

(Subscript[(OverDot[x]), 1])=-2(Subscript[p, 1]) (Subscript[x, 1])+(Subscript[x, 2])
(Subscript[(OverDot[x]), 2])=(Subscript[p, 1]) (Subscript[x, 1])-(Subscript[x, 2])

The system matrix A then is:

A=(({{-2p1, 1}, {p1, -1}}))

A={{-2p1,1},{1p1,-1}};
ev1=Eigenvalues[A]

ev=ev1/.{p1->1}

The system has two behavior modes:

(Subscript[ϕ, 1])=(e^((1/2) (-3-(Sqrt[5]))t))
(Subscript[ϕ, 2])=(e^((1/2) (-3+(Sqrt[5]))t))

phi1[t_]:=Exp[ev[[1]]t]
phi2[t_]:=Exp[ev[[2]]t]
Plot[
{phi1[t],phi2[t]},
{t,0,5},
PlotLegends->{Style["(Subscript[ϕ, 1])",20],Style["(Subscript[ϕ, 2])",20]},
PlotRange->All,
ImageSize->1000,
AxesLabel->{Style["Time",20],Style["Behavior Modes",20]},
TicksStyle->20,
PlotStyle->Thick
]

A brief (and partial) history of Structural Dominance Analysis

Forrester, N (1982)

Eigenvalue elasticity for dominant feedback loops

Kampmann (1996)

Eigenvalues explained in terms of the Independent Loop Set (ILS)

Saleh (2002)

Use of eigenvectors to determine projections of eigenvalues on state variables

Kampmann & Oliva (2006)

Testing of method on different type of models

Loop influence as more intuitive metric

Saleh, Oliva, Kampmann, Davidsen (2010)

Dynamic Decomposition Weights

Parameter elasticity to eigenvalue projection on state variables

Oliva (2016)

Test with “realistic” model

Large number of stocks

Random shocks to the system

Regularity on the analysis process

Structural Dominance Analysis

Loop Eigenvalues Elasticity Analysis (LEEA)

Why does the model do what it does? — structural explanations of behavior using loops

Loop influence (or elasticity) on eigenvalues -- effect of loop gain on eigenvalues

The gain of a loop is defined as the product of the gains of its links.

Independent loop set (ILS) -- a maximal set of loops whose gains can be determined or changed independently of each other. The gain of any loop outside this set is then dependent upon the loop gains in the ILS.

The problem is that ILS is not unique

We can use Shortest Independent Loop Set (Oliva 2004)

Dynamic Decomposition Weight Analysis (DDWA)

Based on the eigenvectors of the system matrix A and is concerned with what happens to the weights of behavior modes when changes are made to the system elements (parameter and link gains)

How to affect the system? — policy design and testing

Eigenvalue projection on stocks

Structural Dominance Analysis Toolset

Software

Streamlined workflow -- model -> Mathematica -> Report

A single Mathematica package

Transparent and easy dashboard interface

Model and data

Parsing and automatic conversion of model functions to Mathematica

Built-in Euler integration

Ability to load exogenously generated data

Analyses

Algorithm speedups

Full integration of LEEA and DDWA

Export data to CSV for further processing or PDF for publishing

Demo

SetDirectory[NotebookDirectory[]];
<<"SDA v1.01 WTC.wl"

Deploy@mdlDash[]

Interface-related takeaways

Have a clear interface flow control

DynamicModule[{loaded=False},
Grid[{{
Button[Style["Load",20,Bold],loaded=True,Enabled->True,ImageSize->200],
Button[Style["Run",20,Bold],Print[Style["Hello",20,Bold]],Enabled->Dynamic@loaded,ImageSize->200]
}}]
]

Message capturing is useful

SetAttributes[evaluateWithoutMessage,HoldAllComplete];
evaluateWithoutMessage[expr_,myMessageList_,length_]:=
Internal`InheritedBlock[{Message,$InMsg=False},
Unprotect[Message];
Message[msg_,vars___]/;!$InMsg&&msg=!=$Off[]&&FreeQ[Off/.Internal`QuietStatus[],Unevaluated[msg]]&&FreeQ[Stack[],Quiet]:=Block[{$InMsg=True,controlstring},
controlstring:=If[MatchQ[msg,$Off[_]],msg/.$Off[x_]:>x,First@ReleaseHold[msg/.Cases[HoldPattern@msg,HoldPattern[MessageName[x_,_]]:>Messages@x]]];
controlstring=If[StringLength[controlstring]<length,StringPadRight[controlstring,length],controlstring];
AppendTo[myMessageList,Style[StringForm[controlstring,vars],Red]]
];
expr
]

msg={};
Dynamic@msg

evaluateWithoutMessage[1/0,msg,30];

evaluateWithoutMessage[Log[0]*0,msg,30];

Future improvements and directions

Model

Parsing non-traditional model functions.

Automatic adaptation of non-continuous functions (essential for logic and boundary control).

Analysis

DDWA updates to work with non constant input variables.

Using Machine Learning Control for parameter estimation and analysis, and policy design (adaptive feedforward control etc.)

Interface

Current version is standalone desktop based, lots of Dynamic objects, user needs a desktop license. We are going to move to a web-based interface with Wolfram engine behind – no need for a user to have a Mathematica license – Wolfram Cloud?

Feedback and suggestions are welcome!

Contacts

THANK YOU!

Sergey Naumov (snaumov@mit.edu)

Rogelio Oliva (roliva@tamu.edu)

References

Forrester JW. 1961. Industrial Dynamics. Productivity Press: Cambridge MA.

Forrester N. 1982. A Dynamic Synthesis of Basic Macroeconomic Policy: Implications for Stabilization Policy Analysis. PhD Thesis. Sloan School of Management, Mass. Inst. of Technology: Cambridge, MA.

Kampmann CE. 1996. Feedback loop gains and system behavior (unpublished manuscript). In Proceedings of the Int. System Dynamics Conference. System Dynamics Society: Cambridge, MA; 260–263 (summarized).

Kampmann CE, Oliva R. 2006. Loop eigenvalue elasticity analysis: three case studies. System Dynamics Review Vol. 22 (2): 146–162.

Oliva R. 2004. Model Structure Analysis Through Graph Theory: Partition Heuristics and Feedback Structure Decomposition. System Dynamics Review Vol. 20(4): 313–336

Oliva R. 2016. Structural dominance analysis of large and stochastic models. System Dynamics Review Vol. 32 (1): 26–51

Ott E. 1993. Chaos in Dynamical Systems. Cambridge University Press: New York.

Richardson GP. (ed.) 1988. System Dynamics Review: Special Issue on Chaos. Vol. 4 (1–2).

Saleh M. 2002. The characterization of model behavior and its causal foundation. PhD Thesis. Dept. of Information Science, University of Bergen: Bergen, Norway.

Saleh M, Oliva R, Kampmann CE, Davidsen PI. 2010. A comprehensive analytical approach for policy analysis of system dynamics models. European Journal of Operational Research 203(3): 673–683.