Implement the missing functions (marked with # TO IMPLEMENT) of the simulator
(ST_Simulator.py) to realize the
following:
- [5%] The construction of the dependency graph (note that this is given in the code -- just add your own explanation);
- [10%] Given an algebraic loop, detection of whether it is linear;
- [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.
///////////////////////////////////////////////////////////////////////////
- [10%] For each of the blocks, write the computation they
need to perform. In this assignment, you only need to
implement the algebraic blocks and the delay block (not Integrator
and Derivative blocks).
[50% -- 10% per item] Provide test models and their results to demonstrate
the correctness of your solution:
- Simple algebraic models without loop, one for each algebraic block;
- A non-trivial algebraic model without loop to test sorting;
- An algebraic model with a non-linear loop;
- An algebraic model with a linear loop ;
- An algebraic model with at least two linear loops, and computation in between;
Provide links to all files.
[remaining 15%] proper documentation, both of your code, and of your report.
In particular, provide a visual representation of your models, as well as of your output signals (as plots).