GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add two MRAC siso examples by KybernetikJo · Pull Request #914 · python-control/python-control

Conversation

@KybernetikJo

@KybernetikJo KybernetikJo commented Jun 15, 2023

Copy link
Copy Markdown
Contributor
  • direct mrac using mit rule
  • direct mrac using lyapunov rule

examples based on Aström & Wittenmark

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@murrayrm

murrayrm commented Jun 19, 2023

Copy link
Copy Markdown
Member

This PR will break once #916 is merged. The changes needed to use the new I/O system structure ar straightforward (eg, replace LinearIOSystem with StateSpace or better yet ss). 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
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@coveralls

coveralls commented Jun 19, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Coverage Status

coverage: 94.849%. remained the same when pulling f3713f1 on KybernetikJo:mrac-examples into d153035 on python-control:main.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

murrayrm
murrayrm requested changes Jul 2, 2023
View reviewed changes

@murrayrm murrayrm left a comment

Copy link
Copy Markdown
Member

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.

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.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread doc/examples.rst Outdated
Comment on lines +36 to +37
mrac_siso_direct_mit_rule_statespace
mrac_siso_direct_lya_rule_statespace

@murrayrm murrayrm Jul 2, 2023

Copy link
Copy Markdown
Member

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.

Perhaps use shorter filenames? It seems like mrac_siso_mit and mrac_siso_lyapunov would fit the bill.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread doc/mrac_siso_direct_lya_rule_statespace.rst Outdated
@@ -0,0 +1,15 @@
Model-Reference Adaptive Control (MRAC) siso, direct lyapunov rule

@murrayrm murrayrm Jul 2, 2023

Copy link
Copy Markdown
Member

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.

I would change "siso" to "SISO" (since it is an acronym) and capitalize Lyapunov (since it is a proper name).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread examples/mrac_siso_direct_lya_rule_statespace.py Outdated
@@ -0,0 +1,185 @@
# mrac_siso_direct_lya_rule_statespace.py
# June 2023

@murrayrm murrayrm Jul 2, 2023

Copy link
Copy Markdown
Member

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.

Add author information?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread examples/mrac_siso_direct_lya_rule_statespace.py Outdated
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'
)

@murrayrm murrayrm Jul 2, 2023

Copy link
Copy Markdown
Member

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.

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.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread examples/mrac_siso_direct_lya_rule_statespace.py Outdated
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'
)

@murrayrm murrayrm Jul 2, 2023

Copy link
Copy Markdown
Member

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.

As above, use ss instead.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread examples/mrac_siso_direct_lya_rule_statespace.py Outdated
)

# Overall closed loop system
io_closed = ct.InterconnectedSystem(

@murrayrm murrayrm Jul 2, 2023

Copy link
Copy Markdown
Member

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.

Use ct.interconnect rather than calling the class constructor.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread examples/mrac_siso_direct_mit_rule_statespace.py Outdated
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'
)

@murrayrm murrayrm Jul 2, 2023

Copy link
Copy Markdown
Member

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.

Replace with call toct.ss.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread examples/mrac_siso_direct_mit_rule_statespace.py Outdated
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'
)

@murrayrm murrayrm Jul 2, 2023

Copy link
Copy Markdown
Member

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.

Replace with call toct.ss.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread examples/mrac_siso_direct_mit_rule_statespace.py Outdated

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

io_controller = ct.NonlinearIOSystem(

@murrayrm murrayrm Jul 2, 2023

Copy link
Copy Markdown
Member

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.

Replace with call toct.nlsys.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread examples/mrac_siso_direct_mit_rule_statespace.py Outdated
)

# Overall closed loop system
io_closed = ct.InterconnectedSystem(

@murrayrm murrayrm Jul 2, 2023

Copy link
Copy Markdown
Member

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.

Replace with call toct.interconnect.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@KybernetikJo

KybernetikJo commented Jul 3, 2023

Copy link
Copy Markdown
Contributor Author

Thanks for the review. I will incorporate your suggestions.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@KybernetikJo

KybernetikJo commented Jul 4, 2023

Copy link
Copy Markdown
Contributor Author

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bnavigator
bnavigator reviewed Jul 4, 2023
View reviewed changes
Comment thread doc/examples.rst Outdated
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

@bnavigator bnavigator Jul 4, 2023

Copy link
Copy Markdown
Contributor

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.

This is an artifact of a merge, which must be fixed

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@bnavigator bnavigator Jul 4, 2023

Copy link
Copy Markdown
Contributor

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.

Oops I was looking at an intermediate commit. Please rebase so that it does not appear in the commit history.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@bnavigator bnavigator Jul 4, 2023

Copy link
Copy Markdown
Contributor

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.

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@KybernetikJo KybernetikJo Jul 5, 2023

Copy link
Copy Markdown
Contributor Author

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.

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.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@bnavigator bnavigator Jul 5, 2023

Copy link
Copy Markdown
Contributor

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.

Both. First get your local main branch in sync with upstream and then rebase feature onto your synced local main

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@KybernetikJo
Add direct mrac siso examples, using new input/output system (ss, nls…
f3713f1
…ys, interconnect)
@KybernetikJo
KybernetikJo force-pushed the mrac-examples branch from 0c04a2c to f3713f1 Compare July 5, 2023 18:27
@KybernetikJo
KybernetikJo requested a review from murrayrm July 5, 2023 18:59
@murrayrm
murrayrm merged commit a8658e4 into python-control:main Jul 7, 2023
@murrayrm murrayrm added this to the 0.10.0 milestone Mar 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@bnavigator bnavigator bnavigator left review comments
@murrayrm murrayrm Awaiting requested review from murrayrm

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

0.10.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@KybernetikJo @murrayrm @coveralls @bnavigator
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.