Week 8 - GSoC 2020

This blog post describes my progress in week 8, the last week of Phase 2. Since we already have a SISO transfer function object available for block diagram algebra, so now, I thought of adding a MIMO transfer function object in this control systems engineering package. The way it works is that we have a matrix of SISO transfer functions, which leads to that object being called a TransferFunctionMatrix. Open PR for this week is 19761.

Here’s the work done so far in the aforementioned pull request:

  • The implementation was completed recently along with unit-tests. This is how we typically define a MIMO transfer function object now:
tf1 = TransferFunction(...) # tf1, tf2, tf3, tf4 are SISO transfer functions.
tf2 = TransferFunction(...)
tf3 = TransferFunction(...)
tf4 = TransferFunction(...)

# This is a MIMO transfer function.
tfm = TransferFunctionMatrix([tf1, tf2])
# `shape` attribute gives us a tuple - (no. of inputs, no. of outputs)
tfm.shape # this will give (1, 2).

# we can have more than one input..
tfm2 = TransferFunctionMatrix([[tf2, tf1], [tf3, tf4]])
tfm2.shape # gives (2, 2).

# The rest of the attributes are similar to the ones we have in
# `TransferFunction` class.
  • For MIMO transfer function interconnection, I will use the existing Series and Parallel classes. I’ve already modified the Parallel class to support this. Similarly, Series class needs to be modified in order to have Series object when two or more TransferFunctionMatrixs are multiplied. Right now though, addition of transfer function matrices returns a Parallel object.
tfm1 = TransferFunctionMatrix(...)
tfm2 = TransferFunctionMatrix(...)
tfm1 + tfm2 # returns `Parallel(tfm1, tfm2)`

I believe it was a productive week overall.