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

H-infinity mixed-synthesis#151

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 6 commits intopython-control:masterfromroryyorke:rory/augw
Jan 6, 2018

Conversation

roryyorke
Copy link
Contributor

This adds methods "augw" and "mixsyn", with interfaces similar to the Matlab and Octave functions of the same name. They are for so-called mixed-sensitivity design, in which the sensitivity, complementary sensitivity, and "input sensitivity" (K*S, or reference to input mapping) can be weighted and stacked for H-infinity synthesis.

As part of this, I've fixed what I think is a bug, namely that empty StateSpace objects could not be created. Such empty objects are convenient in the augw implementation.

I've added two examples for mixsyn, one SISO and one MIMO.

augw is the major part of the new code. It may be that there is some better way to implement it, but I have tried to write it in a way that no uncontrollable or unobservable modes are introduced, and so that is still (somewhat) clear.

@coveralls
Copy link

coveralls commentedJul 1, 2017
edited
Loading

Coverage Status

Coverage increased (+0.5%) to 78.162% when pullingb41fe06 on roryyorke:rory/augw into05d6bc5 on python-control:master.

@murrayrmmurrayrm self-requested a reviewDecember 27, 2017 16:35
@murrayrmmurrayrm added this to the0.8.0 milestoneDec 27, 2017
@murrayrm
Copy link
Member

@roryyorke There's a small conflict with master that it would be good to fix. Will try to do a more thorough review in the coming days...

@murrayrmmurrayrm self-assigned thisJan 2, 2018
@roryyorke
Copy link
ContributorAuthor

Will have a look at the conflict.

New functions augw and mixsyn modelled after Matlab and Octave'sfunction of the same names.python-control doesn't currently support input group naming, so thatis not implemented.
Both examples taken from Skogestad and Postlethwaite's MultivariableFeedback Control.
@coveralls
Copy link

coveralls commentedJan 2, 2018
edited
Loading

Coverage Status

Coverage increased (+0.4%) to 78.954% when pulling7b883ef on roryyorke:rory/augw into33bebc1 on python-control:master.



def _size_as_needed(w,wname,n):
"""_size_as_needed(w,wname,n) -> w2
Copy link
Member

Choose a reason for hiding this comment

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

Nonstandard docstring. I don't think we use this type of docstring (fcn(args) -> output) anyplace else. In addition, parameters, returns, etc are documented in a different format. Would prefer to use a consistent style, as done inhinfsyn in this file.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Will fix here and elsewhere (augw, _matrix, ...). I see I also used this in xferfcn.py in310f580 in_dc_gain_cont.



def augw(g,w1=None,w2=None,w3=None):
"""augw(g,w1=None,w2=None,w3=None) -> p
Copy link
Member

Choose a reason for hiding this comment

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

Nonstandard docstring.

cl: closed system mapping evaluation inputs to evaluation outputs; if p is the augmented plant, with
[z] = [p11 p12] [w], then cl is the system from w->z with u=-k*y. StateSpace object.
[y] [p21 g] [u]
info: namedtuple with fields, in order,
Copy link
Member

Choose a reason for hiding this comment

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

This is the first use of anamedtuple inpython-control. Is there a more standard way to return this sort of information innumpy orscipy? If so, perhaps we use that format?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

namedtuple has been around since Python 2.6, so it's hardly non-standard ;). I couldn't find namedtuple use in numpy, but it is used in scipy (stats/stats.py, for example).

I can change this to a plain tuple; if we do keep the namedtuple, I'd like to remove the leading underscore from the name.

@@ -54,7 +54,7 @@
import math
import numpy as np
from numpy import all, angle, any, array, asarray, concatenate, cos, delete, \
dot, empty, exp, eye, matrix, ones, poly, poly1d, roots, shape, sin, \
dot, empty, exp, eye, matrix, ones,pi,poly, poly1d, roots, shape, sin, \
Copy link
Member

Choose a reason for hiding this comment

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

We should avoid usingnumpy.pi since this can generate errors whennumpy is incorporated as amock function. SeePR 171, commit b881b7. Replace withmath.pi.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

unqualifiedpi no longer used following youraa6e0df anyway. Will remove.

def _matrix(a):
"""_matrix(a) -> numpy.matrix
a - passed to numpy.matrix
Wrapper around numpy.matrix; unlike that function, _matrix([]) will be 0x0
Copy link
Member

Choose a reason for hiding this comment

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

Not clear to my why this is useful? Can you say a bit here (or in a comment in the code)?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

I'll expand the commentary; it's just a helper to make it easier to get 0x0 matrices, which are needed for empty state space systems.

control/robust.py:  - doc-strings conform to python-control conventions  - use plain tuple instead of namedtuple for auxiliary output in mixsyncontrol/statesp.py:  - don't import pi from numpy  - doc-string for _matrix expanded, conforms to conventionscontrol/tests/robust_test.py  - change test to accept plain tuple
@roryyorke
Copy link
ContributorAuthor

I thought I'd check the docstrings via sphinx, but when I runmake html in thedoc sub-directory, I get

  File "/home/rory/miniconda3/envs/control-python27/lib/python2.7/re.py", line 155, in sub    return _compile(pattern, flags).sub(repl, string, count)TypeError: expected string or buffer

I get the same error on master.

I seedoc-requirements.txt references Sphinx from github, but that is somewhat older (log talks about Sphinx 1.3.1, I've got 1.6 installed from conda).

This is my conda environment (2.7-based, and AFAIK up-to-date; don't know why I don't have Scipy 1.0):

alabaster                 0.7.10                   py27_0  babel                     2.5.0                    py27_0  cairo                     1.14.8                        0  certifi                   2016.2.28                py27_0  cycler                    0.10.0                   py27_0  dbus                      1.10.20                       0  docutils                  0.14                     py27_0  expat                     2.1.0                         0  fontconfig                2.12.1                        3  freetype                  2.5.5                         2  funcsigs                  1.0.2                    py27_0  functools32               3.2.3.2                  py27_0  glib                      2.50.2                        1  gst-plugins-base          1.8.0                         0  gstreamer                 1.8.0                         0  icu                       54.1                          0  imagesize                 0.7.1                    py27_0  jinja2                    2.9.6                    py27_0  jpeg                      9b                            0  libffi                    3.2.1                         1  libgcc                    5.2.0                         0  libgfortran               3.0.0                         1  libiconv                  1.14                          0  libpng                    1.6.30                        1  libxcb                    1.12                          1  libxml2                   2.9.4                         0  markupsafe                1.0                      py27_0  matplotlib                2.0.2               np113py27_0  mkl                       2017.0.3                      0  mock                      2.0.0                    py27_0  nose                      1.3.7                    py27_1  numpy                     1.13.1                   py27_0  numpydoc                  0.7.0                    py27_0  openssl                   1.0.2l                        0  pbr                       1.10.0                   py27_0  pcre                      8.39                          1  pip                       9.0.1                    py27_1  pixman                    0.34.0                        0  pycairo                   1.10.0                   py27_0  pygments                  2.2.0                    py27_0  pyparsing                 2.2.0                    py27_0  pyqt                      5.6.0                    py27_2  python                    2.7.13                        0  python-dateutil           2.6.1                    py27_0  pytz                      2017.2                   py27_0  qt                        5.6.2                         5  readline                  6.2                           2  requests                  2.14.2                   py27_0  scipy                     0.19.1              np113py27_0  setuptools                36.4.0                   py27_1  sip                       4.18                     py27_0  six                       1.10.0                   py27_0  snowballstemmer           1.2.1                    py27_0  sphinx                    1.6.3                    py27_0  sphinxcontrib             1.0                      py27_0  sphinxcontrib-websupport  1.0.1                    py27_0  sqlite                    3.13.0                        0  subprocess32              3.2.7                    py27_0  tk                        8.5.18                        0  typing                    3.6.2                    py27_0  wheel                     0.29.0                   py27_0  zlib                      1.2.11                        0

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.5%) to 78.051% when pullinge24c7de on roryyorke:rory/augw into33bebc1 on python-control:master.

1 similar comment
@coveralls
Copy link

coveralls commentedJan 5, 2018
edited
Loading

Coverage Status

Coverage decreased (-0.5%) to 78.051% when pullinge24c7de on roryyorke:rory/augw into33bebc1 on python-control:master.

@murrayrm
Copy link
Member

@roryyorke I had the same problem with sphinx on my local machine. For some reason it seems to work on readthedocs.org. I think the issue may be with the way that version string is being reported (somehow comes in as a float). We should probably chase this down, but perhaps via a separate issue.

I'll try to make sure things look OK on readthedocs when I get a chance (probably tonight or this weekend).

@murrayrm
Copy link
Member

murrayrm commentedJan 6, 2018
edited
Loading

Sent@roryyorke a PR that creates the documentation on readthedocs.

@coveralls
Copy link

coveralls commentedJan 6, 2018
edited
Loading

Coverage Status

Coverage decreased (-0.4%) to 78.073% when pulling36e0b0f on roryyorke:rory/augw into33bebc1 on python-control:master.

@murrayrmmurrayrm merged commit1801c9a intopython-control:masterJan 6, 2018
@roryyorkeroryyorke deleted the rory/augw branchJanuary 9, 2018 19:13
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@murrayrmmurrayrmmurrayrm left review comments

Assignees

@murrayrmmurrayrm

Labels
None yet
Projects
None yet
Milestone
0.8.0
Development

Successfully merging this pull request may close these issues.

3 participants
@roryyorke@coveralls@murrayrm

[8]ページ先頭

©2009-2025 Movatter.jp