GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Add two MRAC siso examples by KybernetikJo · Pull Request #914 · python-control/python-control Conversation
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was an error while loading. Please reload this page.
|
coverage: 94.849%. remained the same when pulling f3713f1 on KybernetikJo:mrac-examples into d153035 on python-control:main. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This PR needs to be rebased on top of the current main branch to catch the changes in #916, which eliminates the LinearIOSystem class and adds a ct.nlsys factory function. In addition, it would be good to replace calls to the class constructors (NonlinearIOSystem, InterconnectedSystem, etc) with calls to factor functions (ct.nlsys, ct.interconnect, etc).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| mrac_siso_direct_mit_rule_statespace | ||
| mrac_siso_direct_lya_rule_statespace |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Perhaps use shorter filenames? It seems like mrac_siso_mit and mrac_siso_lyapunov would fit the bill.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| @@ -0,0 +1,15 @@ | |||
| Model-Reference Adaptive Control (MRAC) siso, direct lyapunov rule | |||
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I would change "siso" to "SISO" (since it is an acronym) and capitalize Lyapunov (since it is a proper name).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| @@ -0,0 +1,185 @@ | |||
| # mrac_siso_direct_lya_rule_statespace.py | |||
| # June 2023 | |||
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Add author information?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| G_plant_ss = ct.StateSpace(A,B,C,D) | ||
|
|
||
| io_plant = ct.LinearIOSystem( | ||
| G_plant_ss, | ||
| inputs=('u'), | ||
| outputs=('x'), | ||
| states=('x'), | ||
| name='plant' | ||
| ) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This can all be done by a single call to ct.ss:
io_plant = ct.ss(A, B, C, D, inputs='u', outputs='x', states='x', name='plant')
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| G_model_ss = ct.StateSpace(Am,Bm,Cm,Dm) | ||
|
|
||
| io_ref_model = ct.LinearIOSystem( | ||
| G_model_ss, | ||
| inputs=('r'), | ||
| outputs=('xm'), | ||
| states=('xm'), | ||
| name='ref_model' | ||
| ) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
As above, use ss instead.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| ) | ||
|
|
||
| # Overall closed loop system | ||
| io_closed = ct.InterconnectedSystem( |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Use ct.interconnect rather than calling the class constructor.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| G_plant_ss = ct.StateSpace(A,B,C,D) | ||
|
|
||
| io_plant = ct.LinearIOSystem( | ||
| G_plant_ss, | ||
| inputs=('u'), | ||
| outputs=('x'), | ||
| states=('x'), | ||
| name='plant' | ||
| ) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Replace with call toct.ss.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| G_model_ss = ct.StateSpace(Am,Bm,Cm,Dm) | ||
|
|
||
| io_ref_model = ct.LinearIOSystem( | ||
| G_model_ss, | ||
| inputs=('r'), | ||
| outputs=('xm'), | ||
| states=('xm'), | ||
| name='ref_model' | ||
| ) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Replace with call toct.ss.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| params={"gam":1, "Am":Am, "Bm":Bm, "signb":np.sign(B)} | ||
|
|
||
| io_controller = ct.NonlinearIOSystem( |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Replace with call toct.nlsys.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| ) | ||
|
|
||
| # Overall closed loop system | ||
| io_closed = ct.InterconnectedSystem( |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Replace with call toct.interconnect.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks for the review. I will incorporate your suggestions. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I need help. In fact, I'm not sure about the recent commits of this PR. I think I did something wrong. The old files have been merged back into the branch "mrac-examples" by "git rebase main". In steps 8 of the manual, (https://github.com/python-control/python-control/wiki/How-to-contribute-with-a-pull-request) Current situation of "mrac-examples".
Not sure how to fix this. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| <<<<<<< HEAD | ||
| mrac_siso_mit | ||
| mrac_siso_lyapunov | ||
| ======= | ||
| mrac_siso_direct_mit_rule_statespace | ||
| mrac_siso_direct_lya_rule_statespace | ||
| >>>>>>> refs/remotes/origin/mrac-examples |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This is an artifact of a merge, which must be fixed
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Oops I was looking at an intermediate commit. Please rebase so that it does not appear in the commit history.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
In reference to your comment: Do a git rebase -i main and "squash" some commits.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Thx, I will try git rebase -i main.
In steps 8 of the manual, (https://github.com/python-control/python-control/wiki/How-to-contribute-with-a-pull-request)
which branch must be updated & synchronized, main or feature?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Both. First get your local main branch in sync with upstream and then rebase feature onto your synced local main
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…ys, interconnect)
0c04a2c to
f3713f1
Compare
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.