Causal Block Diagram Assignment [15%]

General Information

The assignment [10% of course grade]

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

  1. [10%] The construction of the dependency graph;
  2. [10%] Given an algebraic loop, detection of whether it is linear;
  3. [10%] 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
    // 
    //      [[ C11, C12, C13 ],
    // M1 =  [ C21, C22, C23 ],
    //       [ C31, C32, C33 ]]
    //
    // M2 =  [ C1,  C2,  C3 ]
    //
    // represents the following linear equation system:
    // {
    //   C11*x + C12*y + C13*z = C1
    //   C21*z + C22*y + C23*z = C2 
    //   C31*z + C32*y + C33*z = C3
    // }
    // where x, y, and x are signals (block outputs) inside a strong component.
    ///////////////////////////////////////////////////////////////////////////
    
  4. [10%] For each of the blocks, write the computation they need to perform. You need to implement all algebraic blocks, the test block, as well as the timeDelay blocks (delay, derivative, and integrator).

[50% -- 5% per item] Test all aspects of your simulator:

  1. Simple algebraic models without loop, one for each algebraic block;
  2. A non-trivial algebraic model without loop to test sorting;
  3. An algebraic model with a non-linear loop;
  4. An algebraic model with a linear loop ;
  5. An algebraic model with at least two linear loops, and computation in between;
  6. A simple Delay block model;
  7. A Derivative model using delay block. Test using simple linear input. Use the same test to check the hard-coded version.
  8. An Integrator model using delay block. Test using simple constant input. Use the same test to check the hard-coded version.
  9. A Circle Test model using hard-coded and modelled Integrators.
  10. Plot error (wrt. analytical solution) as a function of stepsize (comparing sin(t) using a Generic block with the approximate value obtained by solving x''=-x).
Provide visual representations of your models, and outputs. Provide links to all files.

For the last 10%: optimizations.

Download

Tutorial

An old tutorial is available here.