Intro_Course_2_6 - nasa/gunns GitHub Wiki
This describes the sequence of events when a network is propagated in time. This only details the Major Step performed in a linear network. Non-linear networks and their Minor Step loop is an advanced topic.
- Sim Bus inputs are read into the Network’s contained objects (usually just Links & Spotters) from the Sim Bus.
- The Network’s update method is called by the Trick “scheduled” job:
- The Network loops over all Spotters and calls their stepPreSolver method. This allows Spotters to process inputs before the system state is updated by the Solver.
- The Network calls the Solver’s step method once:
- The Solver loops over all Nodes and clears out their flows from last pass.
- The Solver loops over all Links and calls their step method:
- Links calculate their new contributions to [A] and {w}.
- The Solver loops over all Links and sums their contributions to the system’s [A] and {w}.
- The Solver solves [A] {p} = {w} for the new {p}, which are the new node potentials.
- New {p} values are given to the Nodes as their potentials and to the Links as their port potentials.
- The Solver loops over all Links and calls their computeFlows method:
- Links calculate flow rates corresponding to the new {p} and transport resulting flows between the Nodes.
- The Solver loops over all Nodes and calls their integrateFlows method:
- Nodes balance internal states in response to the incoming & outgoing flows.
- The Network loops over all Spotters and calls their stepPostSolver method. This allows Spotters to process outputs after the system state is updated by the Solver.
- Sim Bus outputs are written to the Sim Bus from the Network’s contained objects.