Causal Block Diagram Assignment [15%]

General Information

The assignment [15%]

Implement the missing functions of the simulator (CausalBlockDiagram/ST_CBD/ST_Simulator.py) to accomplish the following requirements:

  1. [3.5%] The construction of the dependency graph;
  2. [3.5%] Given an algebraic loop, detection of whether it is linear;
  3. [4%] Given a linear algebraic loop, construct input for a linear solver; the format of the input should be:
    /////////////////////////////////////////////////////////
    // Input for the solver is of the form: [M1, M2], where
    // M1 =
    //      B1   B2   B3
    // B1 | a    b    c |
    // B2 | d    e    f |
    // B3 | g    h    i |
    //
    // M2 =
    //      B1   B2   B3
    //    | X    Y    Z |
    // represents the following linear equation system:
    // {
    //   a*B1 + b*B2 + c*B3 = X
    //   d*B1 + e*B2 + f*B3 = Y
    //   g*B1 + h*B2 + i*B3 = Z
    // }
    // where B1, B2, and B3 are blocks inside a strong component.
    
  4. [4%] For each of the blocks, write the computation they need to perform.

Use the following CBD models to test your simulator:
(You can use the Text Models (TM) directly, or modify the Visual Models (VM) first and use generated Text Models (TM) from AToM3 if you want to further customize these models)

  1. An algebraic model WITHOUT loop (TM: alg_without_loop.py   |   VM: alg_without_loop_MDL.py);
  2. An algebraic model WITH loop (TM: alg_with_loop.py   |   VM: alg_with_loop_MDL.py);
  3. A simple Delay Test model (TM: delay_test.py   |   VM: delay_test_MDL.py);
  4. An Integrator model using delay block (TM: integrator.py   |   VM: integrator_MDL.py);
  5. A Circle Test model (a hierarchical model) using Integrators (the previous model) (TM: circle_test.py   |   VM: circle_test_MDL.py).

NOTE: there are two more experiment scripts provided for you to directly run simulations (with visual plotting) of models:

Download

Tutorial

A tutorial is available here.