Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add two MRAC siso examples#914

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
murrayrm merged 1 commit intopython-control:mainfromKybernetikJo:mrac-examples
Jul 7, 2023

Conversation

KybernetikJo
Copy link
Contributor

  • direct mrac using mit rule
  • direct mrac using lyapunov rule

examples based on Aström & Wittenmark

@murrayrm
Copy link
Member

This PR will break once#916 is merged. The changes needed to use the new I/O system structure ar straightforward (eg, replaceLinearIOSystem withStateSpace or better yetss). I suggest we hold off on merging this until after#916, but running unit tests now to make sure there are no problems under various configurations.

sawyerbfuller reacted with thumbs up emoji

@coveralls
Copy link

coveralls commentedJun 19, 2023
edited
Loading

Coverage Status

coverage: 94.849%. remained the same when pullingf3713f1 on KybernetikJo:mrac-examples intod153035 on python-control:main.

Copy link
Member

@murrayrmmurrayrm left a comment

Choose a reason for 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 theLinearIOSystem class and adds act.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).

Comment on lines 36 to 37
mrac_siso_direct_mit_rule_statespace
mrac_siso_direct_lya_rule_statespace
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Perhaps use shorter filenames? It seems likemrac_siso_mit andmrac_siso_lyapunov would fit the bill.

@@ -0,0 +1,15 @@
Model-Reference Adaptive Control (MRAC) siso, direct lyapunov rule
Copy link
Member

Choose a reason for 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).

@@ -0,0 +1,185 @@
# mrac_siso_direct_lya_rule_statespace.py
# June 2023
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Add author information?

Comment on lines 24 to 32
G_plant_ss = ct.StateSpace(A,B,C,D)

io_plant = ct.LinearIOSystem(
G_plant_ss,
inputs=('u'),
outputs=('x'),
states=('x'),
name='plant'
)
Copy link
Member

Choose a reason for 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 toct.ss:

io_plant = ct.ss(A, B, C, D, inputs='u', outputs='x', states='x', name='plant')

Comment on lines 40 to 48
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'
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

As above, usess instead.

)

# Overall closed loop system
io_closed = ct.InterconnectedSystem(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Usect.interconnect rather than calling the class constructor.

Comment on lines 24 to 32
G_plant_ss = ct.StateSpace(A,B,C,D)

io_plant = ct.LinearIOSystem(
G_plant_ss,
inputs=('u'),
outputs=('x'),
states=('x'),
name='plant'
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Replace with call toct.ss.

Comment on lines 40 to 48
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'
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Replace with call toct.ss.


params={"gam":1, "Am":Am, "Bm":Bm, "signb":np.sign(B)}

io_controller = ct.NonlinearIOSystem(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Replace with call toct.nlsys.

)

# Overall closed loop system
io_closed = ct.InterconnectedSystem(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Replace with call toct.interconnect.

@KybernetikJo
Copy link
ContributorAuthor

Thanks for the review. I will incorporate your suggestions.

@KybernetikJo
Copy link
ContributorAuthor

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)
which branch must be updated & synchronized, main or feature?

Current situation of "mrac-examples".

  • Files and documentation should be ok.
  • But many of my commits are suboptimal. They pollute the log history.

Not sure how to fix this.

Comment on lines 36 to 42
<<<<<<< HEAD
mrac_siso_mit
mrac_siso_lyapunov
=======
mrac_siso_direct_mit_rule_statespace
mrac_siso_direct_lya_rule_statespace
>>>>>>> refs/remotes/origin/mrac-examples
Copy link
Contributor

Choose a reason for 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

Copy link
Contributor

Choose a reason for 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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

In reference to your comment: Do agit rebase -i main and "squash" some commits.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thx, I will trygit 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?

Copy link
Contributor

Choose a reason for 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

@murrayrmmurrayrm merged commita8658e4 intopython-control:mainJul 7, 2023
@murrayrmmurrayrm added this to the0.10.0 milestoneMar 31, 2024
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@bnavigatorbnavigatorbnavigator left review comments

@murrayrmmurrayrmAwaiting requested review from murrayrm

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
0.10.0
Development

Successfully merging this pull request may close these issues.

4 participants
@KybernetikJo@murrayrm@coveralls@bnavigator

[8]ページ先頭

©2009-2025 Movatter.jp