Week 4

Pull Request 3 …. Hello everyone, hope this blog finds you well.

Last week, I wrote about my second Pull Request concerning the Root-Locus and Nichols plots. Since we are collaborating on an open-source project, it’s important to consider the suggestions provided by every member. Unfortunately, I couldn’t address Oscar’s comment, resulting in a stalled pull request. As a group, we need to decide how to proceed with that specific pull request.

In addition, I’ve started making improvements in the codebase. In phase 2, my focus will be on adding more useful methods to the TransferFunction and TransferFunctionMatrix classes, making technical changes, and enhancing the design to improve user-friendliness.

Aim :

My purpose this week was to Add Instantiation Methods to the Transfer Functions.

I have made the pull request here - #25287. I could get it merged successfully !!

Work : Let us go through the Pull Request and the reviews I addressed in brief.

I will show brief examples on what I implemented in the pull request.

  1. from_coeff_lists - This is derived from the MATLAB and Python-control input schemes. We can inialize our transfer function through numerator and denominator sequences.
         >>> from sympy.abc import s, p
         >>> from sympy.physics.control.lti import TransferFunction
         >>> num = [1, 0, 2]
         >>> den = [3, 2, 2, 1]
         >>> tf = TransferFunction.from_coeff_lists(num, den, s)
         >>> tf
         TransferFunction(s**2 + 2, 3*s**3 + 2*s**2 + 2*s + 1, s)
    
  2. from_zpk - On many ocassions, users will have to build up a transfer functions from it’s poles and zeros. This method helps in such initializations.
         >>> from sympy.abc import s, p, k
         >>> from sympy.physics.control.lti import TransferFunction
         >>> zeros = [1, 2, 3]
         >>> poles = [6, 5, 4]
         >>> gain = 7
         >>> tf = TransferFunction.from_zpk(zeros, poles, gain, s)
         >>> tf
         TransferFunction(7*(s - 3)*(s - 2)*(s - 1), (s - 6)*(s - 5)*(s - 4), s)
    

Observations and Challenges :

This week went by smoothly and rather fast I would say. The new pull request got merged in 3-4 days and did not provide any major challenges. The challenge for the upcoming weeks is to make sure that we figure out a way to get Pull Request 2 in the codebase. Those plots are extremely essential for graphical analysis. Defeciency on my part in addressing the suggestion should not lead to stalling of the pull request.

Future Work : In this upcoming week I would be opening up some issues related to improvements and upgrades in the codebase as we are shifting into phase 2. It is crutial to discuss ideas on these issues, so that I have clarity on my future Pull Requests.

Address

Mumbai, Maharashtra, India