Week 13

Final evaluations approaching :) …. Hello everyone, hope this blog finds you well.

From now I have 2 weeks remaining in Google Summer Of Code’23. Implementation of the State Space Model is finished. This week I focused on how operators interact with the State Space class.

Aim :

This week I made some comments towards the State Space model. It can be viewed here. I also opened up an issue - Planner on future implementations in the State Space Class.

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

  1. Addition and Multiplication :
    >>> from sympy import Matrix
    >>> from sympy.physics.control import StateSpace
    >>> A1 = Matrix([[1]])
    >>> B1 = Matrix([[2]])
    >>> C1 = Matrix([[-1]])
    >>> D1 = Matrix([[-2]])
    >>> A2 = Matrix([[-1]])
    >>> B2 = Matrix([[-2]])
    >>> C2 = Matrix([[1]])
    >>> D2 = Matrix([[2]])
    >>> ss1 = StateSpace(A1, B1, C1, D1)
    >>> ss2 = StateSpace(A2, B2, C2, D2)
    >>> ss1 + ss2
    StateSpace(Matrix([
    [1,  0],
    [0, -1]]), Matrix([
    [ 2],
    [-2]]), Matrix([[-1, 1]]), Matrix([[0]]))
       
    >>> A = Matrix([[-5, -1], [3, -1]])
    >>> B = Matrix([2, 5])
    >>> C = Matrix([[1, 2]])
    >>> D = Matrix([0])
    >>> ss = StateSpace(A, B, C, D)
    >>> ss*5
    StateSpace(Matrix([
    [-5, -1],
    [ 3, -1]]), Matrix([
    [2],
    [5]]), Matrix([[5, 10]]), Matrix([[0]]))
    
  2. Future Implementations in the State Space Class :

    Make the class more feature rich -

    • Solve examples mentioned in issue and add them to the control_problems file . The required functionality is already supported in the pull request.
    • Add a symbolic solver (and a numeric solver if required) with the help of the ODE module to solve x' = Ax + Bu form.
    • Read about Laub’s or Horner’s method to evaluate system transfer function at complex frequency. This will be the equivalent of eval_frequency for Transfer Functions.
    • Add Feedback interconnection between 2 state space LTI systems.
    • Other features can be picked up on comparison with MATLAB and python-control.

    Extension of the class (long term)

    • Allow the argument dt to create a discrete time model following the completion of continuous time model. It will be nice if we could support this for both Transfer Function model and State Space model.

Future Work : Now, the pull request and issues are completed from my end. I am waiting for the maintainers to suggest suitable improvements so that it can be merged soon.
The next week I will have my minor exams at university so I won’t be able to do too much work.
Following week will be my last official active week for Google Summer Of Code. It has been an amazing journey with a few final touches remaining.

Address

Mumbai, Maharashtra, India