Week 10

Phase 3: a new challenge, a new beginning ! …. Hello everyone, hope this blog finds you well.

As I had mentioned that the previous week was the last week of phase 2, a daunting task lies ahead of me. Phase 3 is the most crucial phase of my project. I’ll be adding the symbolic State Space model to SymPy. This is the moment or the challenge I would say, that I participated in Google Summer of Code for. I always knew that GSoC is not just adding attractive documentation or making improvements on already written code but expanding the horizon, the use cases of a project and making it more operational for users.

Aim :

This week I made a pull request showing the initial design of the State Space Model. It can be viewed here.
I also opened an issue showing all the potenial kinds of questions the State Space class will be able to solve once completed.

This week pull requests #25329, #25418 and #25463 got approved and will be merged anytime soon. With that a majority chunk of my phase 2 work will be merged into SymPy’s codebase.

Work : Let us go through the Pull Requests in brief.

  1. Design of the State Space Model :
    The easiest way to create a StateSpaceModel is via four matrices:
     >>> A = Matrix([[1, 2], [1, 0]])
     >>> B = Matrix([1, 1])
     >>> C = Matrix([[0, 1]])
     >>> D = Matrix([0])
     >>> StateSpace(A, B, C, D)
     StateSpace(Matrix([
     [1, 2],
     [1, 0]]), Matrix([
     [1],
     [1]]), Matrix([[0, 1]]), Matrix([[0]]))
    

    One can use less matrices. The rest will be filled with a minimum of zeros:

     >>> StateSpace(A, B)
     StateSpace(Matrix([
     [1, 2],
     [1, 0]]), Matrix([
     [1],
     [1]]), Matrix([[0, 0]]), Matrix([[0]]))
    
  2. Solved Questions to tackle using the State Space Model:

    This issue has been raised here These are some solved problems which sympy could be able to solve using the State Space Models. The purpose here is to demonstrate the usefulness of the State Space model and it’s methods which are being added.

    1. Frequency Response of Spring Mass Damping system. https://python-control.readthedocs.io/en/0.8.4/secord-matlab.html.

    2. Deriving State Space Model from physical systems. Example - State Space Representation of an electrical cirucit - https://www.javatpoint.com/control-system-state-space-model.
      Check out this Problem

    3. University Lecture Examples - https://ocw.snu.ac.kr/sites/default/files/NOTE/lecture%2012-14%20State%20Space_0.pdf.
      a. Questions on kinematics and dynamics.
      b. State Space to Transfer Function
      c. State Space to cannonical formats(observable, controllable, jordan)

    4. Course Textbook Examples - Refer chapter 1. Page 27 - 30 for Questions.
      Book - https://www.vssut.ac.in/lecture_notes/lecture1450172554.pdf

Future Work : For the next week, I intend to write extensive test and documentation for the first pull request of phase 3. Once we have an end to end test suite we can review the design thoroughly and not just have superficial comments on the commits.

Address

Mumbai, Maharashtra, India