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
Input-output selection in bode_plot
#1916
Input-output selection in bode_plot
#1916
Conversation
bode_plot
#1767 bode_plot
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. Below are two comments.
It would be good to also add a test or edit the LTI system tutorial.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks much better now, I just have a few minor remarks below (the point about adding a test or editing the tutorial remains).
@pmli, For adding a tutorial part I am currently still working on it. sorry for being late but I think I found a bug so I am further investigating it before opening a new issue for it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few minor comments. I'll take a closer look tomorrow.
Oh, I just remembered, could you add yourself to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @MohamedAdelNaguib, thanks for your contribution! I have some minor comments, mostly regarding documentation.
@pmli, @MohamedAdelNaguib, what do you think about adding a subtitle to the plots (respectively the rows and columns) to make clear which inputs and outputs are displayed in the respective plot?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @MohamedAdelNaguib, welcome to pyMOR ✨
Thanks for your contribution, this feature is long overdue. I left some comments, let me know what you think.
@pmli This seems also related to the slicing of LTIModels
we talked about. At the moment, restricting the indices wouldn't really result in faster computations. If we had a slicing mechanism, we could envoke it here.
However, I'm not sure when we actually get around to implement that..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from the wording, this now looks good to me.
What do you think @artpelling, @pmli?
You should rebase on main @MohamedAdelNaguib, since |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from the import sorting, this looks good to me now 👍
@MohamedAdelNaguib Looking at the commits, it seems like some other PRs got mixed in. Could you try rebasing again on the main branch? On my system, I could do it by running
I thought about this, and I think it would be nice to do something similar to Matlab, but I don't know how to nicely add both horizontal and vertical subtitles. That's way I thought it would be better to do it later in another PR.
Yes, I agree it would be good to have slicing here, and that we'll do it some other time. |
@pmli I am currently working on it but there are a lot of issues while |
Ok, just let me know if you get stuck. |
…ion of a specific input-output
…nd the axs isn't None
…the new arguments
…ion of a specific input-output
c913d6b
to
2354eb6
Compare
Thanks @MohamedAdelNaguib and congrats for your first pyMOR contribution 🎉 |
Thank @pmli, @HenKlei and @artpelling for your help and support during this process. |
Problem statement :
Currently, the
bode_plot
function plots multiple graphs/plots depending on the values ofdim_input
anddim_output
.Goal:
The goal is to restrict one or more input-output pair from these plots to be displayed to the user instead of displaying all the plots.
Solution:
By introducing two new optional arguments ,
input_indices
andoutput_indices
, which indicate the index of the input or the output that we are interested in.Examples:
If we have
dim_input=3
,dim_output=3
,output_indices = [1,2]
andinput indices = [0,2]
that will result in displaying all the subplots with the following indices {(1,0), (1,2), (2,0), (2,2)}. also ifoutput_indices=None
andinput_indices = [1,2]
the function should display the subplot with the following indices {(0,1) , (0,2) , (1,1), (1,2) , (2,1) ,(2,2)}.input_indices=None
andoutput_indices=[1,2]
, that will result in displaying the subplots with the following indices{(1,0),(1,1),(1,2),(2,0),(2,1),(2,2)}
.input_indices
andoutput_indices
, all the subplots will be dispalyedI tested my implementation by using the same code here #1615 with some edits in the
bode_plot
calls giving it different values for the new added parametersinput_indices
andoutput_indices
and it gives me the corresponding plots of my chosen indices.closes #1767