Causal Block Diagram Assignment

General Information

The assignment

  1. [11%] Implement the algorithms for Causal Block Diagrams (CBD) in AToM3:
    1. [8%] Implement the missing functions of the simulator (CausalBlockDiagram/ST_CBD/ST_Simulator.py) to accomplish the following requirements:
      1. [2%] The construction of the dependency graph;
      2. [2%] Given an algebraic loop, detection of whether it is linear;
      3. [2%] 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. [2%] For each of the blocks, write the computation they need to perform.
    2. [3%] Implement an algorithm to print out the LaTeX form of a model: Both the "naieve" and the "sophisticated" format are possible. In the "naieve" format, for each block in the model, the relationship between all connected signals is given. Note that this will only give a meaningful result if all signals have a non-empty-string name. (Since the CBD formalism you are using for this assignment doesn't allow no-name block and will assign a unique name for any newly added block, you should name a block with an underscore as prefix to make it act as a no-name block.) In the "sophisticated" format (as a human modeller would write it), some signals may have an empty name (actually, a name starting with an underscore, as explained early) as they will not be written explicitly. In this format, all constant equations are written separately and there is one equation for each Integrator, Derivative, or Delay block.
      Your start point is here: >>GenLaTeX.py<< (download and put it in CausalBlockDiagram/ST_CBD/)
      >>testLatex.py<< shows how to generate LaTeX file from a model using methods in GenLaTeX.py.
      >>ballistic.tex<< is an example of generated LaTeX file for model >>thrown_ball_old_MDL.py<< which looks like this after rendering:
  2. [4%] Create Causal Block Diagrams (CBD) models in AToM3:
    1. [2%] Create two flat models (without Child blocks referring to other models) which can verify all functionalities described in part 1:
      1. [1%] A model WITH linear algebraic loop;
      2. [1%] A model WITHOUT linear algebraic loop.
    2. [2%] Hierarchical modelling for simulations only:
      1. [1%] An Integrator model (a model consists of blocks which functions as an integrator and can be referred to as a Child block in other models);
      2. [1%] A Circle Test Model using hierarchical modelling.

Note: a tutorial is available here.