Causal Block Diagram (continuous-time) 

General Information

  • The due date is Sunday 2 November 2014, before 23:55.

  • Submissions must be done via BlackBoard. Beware that BlackBoard's clock may differ slightly from yours. All results must be uploaded to BlackBoard and accessible from links in the main (index.html) file.

  • The assignment must be made in groups of maximum 2 people. It is understood that all partners will understand the complete assignment (and will be able to answer questions about it). Clearly identify who did what.

  • Grading will be done based on correctness and completeness of the solution. Do not forget to document your requirements, assumptions, design, implementation and modelling and simulation results in detail!

The assignment

You will implement the operational semantics of the Causal Block Diagram (CBD) formalism (i.e., a simulator) for continuous-time semantics. In particular, you will add support for Integrator and Derivative blocks to the discrete-time CBD simulator you developed for the first CBD assignment. The semantics of these blocks will not be encoded directly in CBDsimulator.py. Rather, you will replace

  • [10%] integrator and
  • [10%] derivative blocks
with their discrete-time approximations, using the arithmetic and delay blocks you implemented in the previous assignment. Pay special attention to the initial conditions of the delay blocks you use! Create your models in files like ExampleCBD.py.
A consequence of the discretization is that you will need a time-slice size (aka step-size) delta_t which can be encoded in a CBD as a constant. Note that if multiple integrator and/or derivative blocks are approximated in a CBD model, they must all use the same step-size!

Provide models (add test cases to CBDtest.py, but also create files like ExampleCBD.py where simulation results are plotted) to test your discrete-time approximation of

  • [5%] integrator (use a constant input so you can easily compare with the analytical solution) and
  • [5%] derivative (use a linear input so you can easily compare with the analytical solution).

[20%] Build the "circle test" model (d2x / dt2 = -x with x(0) = 0 and dx/dt(0) = 1), known in physics as a "harmonic oscillator" using

  • integrators only and
  • derivative only.

[10%] The smaller delta_t, the more accurate the discrete-time approximation of the continuous-time semantics of a model will be. This is nicely visible when x(t) is plotted versus dx/dt(t) for various values of delta_t. Demonstrate this for both the circle test model with integrators and with derivatives.

[30%] You should also compare the accuracy of the integrator and derivative approaches for the circle test. This means you will plot the total error for the integrator and the derivative approaches as a function of delta_t. The total error is the sum of the squares of the differences between the analytical solution (for x(t)) and its numerical approximation. The sum is over time points, over a sufficiently large time period.

[10%] for proper documentation/description/plots.

Maintained by Hans Vangheluwe. Last Modified: 2014/10/20 09:40:17.