New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Discussion regarding the API for control package #18460
Comments
I totally agree. In addition to that, we could have a combined control system, as well as a signal processing package as both applications, go hand in hand (to a certain extent). I had raised a PR to try and include magnitude response, phase responses, magnitude plots as well as phase plots, finding out the poles and zeros of an equation as well as pole-zero plots. The link to the PR can be found here [PR #18419.]. I think this could be added to the control package. I also wanted to add some other features that could help in the signal processing domain as well as the control system domain. I have elaborated my ideas in this discussion: https://groups.google.com/forum/#!msg/sympy/K5i87mX8Dwo/hCxjVzk6EwAJ. |
I agree that these disciplines overlap to a certain extent. But it's just that they are separated by a set of common tools. |
In my opinion, Often, system model can be a candidate for a full symbolic model more than just a simple solver. |
Wouldn't it be better if we write this module as a set of few functions?
Maybe that is better if we're trying to use other sympy methods such as
OK, I'll consider that when I'll implement those 2 classes. |
It can be different if it is rewritten as a set of functions, than writing to Basic would not be an issue for a while But if anything new is going to be implemented as a class and that wraps around sympy types, then it's better to be inheriting |
What kind of features do you think that StateSpaceModel is lacking for python-control? I think that most of the stuff already mirrors python-control. |
This would be a symbolic version of linear control systems. I guess that would be one of the reasons.. |
However, there can be some differences of enabling symbolics partially in computation, or making the whole model symbolic. |
I don't know how difficult that would turn out to be. Please refer this comment. |
Often, I think that converting the objects to the form that are compatible with
And I'd believe that other things would be easier. |
That is a great idea :) Seems like there are so many benefits while we subclass Thanks for the suggestions, @sylee957 |
Yes, but I'd try to name |
OK. I'll follow snake_case naming style. |
I'd also make anchor an additional symbol |
Maybe s should be optional, i.e. |
But is it a good idea to specify |
I still don't understand what a Dummy is. So I don't know. But this is similar to the Beam module where you formulate polynomials in the class methods and need access to the independent variable for further analysis. @oscarbenjamin gave some nice suggestions on how to handle this in an issue somewhere. I forget where... |
Here: #17714 is where he proposed ideas for dealing with the implicit variable for time in the physics vector package. |
I just read https://docs.sympy.org/1.5.1/modules/core.html?highlight=dummy#sympy.core.symbol.Dummy and see that it is a symbol that ensures uniqueness regardless of its string base. So my question is then what advantage does this give over a symbol in this case? Why is it important to make the independent variable of the polynomial unique? |
It's because I'm thinking of defining the equalities between each system models not to depend on the names of the variables. |
I see. That could be valuable. |
Apart from the methods that are already there in #17866, these are the following methods that I propose to add in the
I'll also update with the methods for |
There are also some ideas from #12189 to grab. |
Cool. Noted! |
Also, Can anyone please let me know who would be my potential mentor for this project? So that I discuss all the things with him/her in advance. Thanks. |
Take a look at #7977 (comment) as well. |
Hi everyone, Phase 1: Adding Phase 2: In this phase, I will implement more methods such as Phase 3: At the starting of this phase, I'll add tests for the work done in Phase 1 and Phase 2. Phase 4: In this phase, I will add @moorepants @sylee957 Please give some reviews on this. I'll add Phase 1 implementation plan in my application tomorrow. I want to start working on this project as soon as I can so as to maximize my chances of selection. |
This all sounds cool. I think the Bode plot is used much more widely than the Nyquist plot, so I'd implement that before Nyquist. |
Thanks, @moorepants I think we should have plenty of examples in the docs. Because people tend to use the software more if the docs are top-notch. |
I think a Bode plot and root locus are two of the most popular control related plots used. |
Alright, we can add them. One is a frequency response plot and the other is a root locus plot for the transfer function. Should I write the prototypes for all the features that I will add? |
Or just the outside APIs would suffice? |
I think that you should write tests for each part at the same time as implementing it. Writing tests afterwards is not usually a good idea as you will forget what needs to be tested. Writing tests at the same time helps to ensure that everything is implemented correctly. |
I agree with @oscarbenjamin. And a GSoC proposal that shows examples of use (like the "examples" sections in SymPy documentation) or even unit tests will provide a very clear picture of what you want to do. |
Thanks for the suggestions. I'll write tests in the last week of each phase. |
I have added Phase 1 implementation plan. Please check this and leave comments if any changes are required. Thanks! |
@moorepants We can drop |
I think that numerical solutions can be fine if this is something that is added generally in sympy for working with ODEs i.e. #18023 |
@moorepants, I have completed Phase 1, 2, and almost 4. Please review my proposal whenever you get time. I just want to make sure I'm doing it the right way. Thanks. |
@moorepants Please give your final feedback on my application. Looking forward to hearing from you. |
Can this, #18436 be closed? Or #18436 is going to be continued? |
Actually, i want to copy the file from the most recent commit in #17866 and start my work from there in a new PR. |
Hello everyone,
Before this, some contributors made efforts to add
control
package tosympy.physics
here and here.There is a great python library for the operations of control systems.
https://python-control.readthedocs.io/en/latest/index.html
But I want sympy to have a symbolic version of that.
A basic overview of what needs to be added can be found here. But I think some more operations can also be added to enhance the toolbox. Like given in this link: https://www.wolframalpha.com/examples/science-and-technology/engineering/control-systems/
I have already raised a Pull request for adding such toolbox and this can be done in these 5 steps:
Any advice from the community would be really appreciated.
The text was updated successfully, but these errors were encountered: