-
Notifications
You must be signed in to change notification settings - Fork 446
Robust hinfsyn: add suboptimal synth #1184
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -85,7 +85,7 @@ def h2syn(P, nmeas, ncon): | |
| return K | ||
|
|
||
|
|
||
| def hinfsyn(P, nmeas, ncon): | ||
| def hinfsyn(P, nmeas, ncon, gamTry=None): | ||
| # TODO: document significance of rcond | ||
| """H-infinity control synthesis for plant P. | ||
|
|
||
|
|
@@ -97,6 +97,8 @@ def hinfsyn(P, nmeas, ncon): | |
| Number of measurements (input to controller). | ||
| ncon : int | ||
| Number of control inputs (output from controller). | ||
| gamTry : int, optional | ||
| Target performance level (default = None). | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Although this is consistent with the current very terse docstring, I think a bit more information is needed, either here or in a Notes section later in the docstring. Something like:
|
||
|
|
||
| Returns | ||
| ------- | ||
|
|
@@ -137,7 +139,10 @@ def hinfsyn(P, nmeas, ncon): | |
| >>> P = ct.interconnect([P11, P12, P21, P22], inplist=['w', 'u'], outlist=['z', 'y']) | ||
|
|
||
| >>> # Synthesize Hinf optimal stabilizing controller | ||
| >>> K, CL, gam, rcond = ct.hinfsyn(P, nmeas=1, ncon=1) | ||
| >>> K_opt, CL_opt, gam_opt, rcond_opt = ct.hinfsyn(P, nmeas=1, ncon=1) | ||
|
|
||
| >>> # Synthesize suboptimal controller with better numerical properties | ||
| >>> K, CL, gam, rcond = ct.hinfsyn(P, nmeas=1, ncon=1, gamTry=1.1*gam_opt) | ||
| >>> T = ct.feedback(G, K, sign=1) | ||
| >>> all(T.poles() < 0) | ||
| True | ||
|
|
@@ -156,8 +161,13 @@ def hinfsyn(P, nmeas, ncon): | |
| n = np.size(P.A, 0) | ||
| m = np.size(P.B, 1) | ||
| np_ = np.size(P.C, 0) | ||
| gamma = 1.e100 | ||
| out = sb10ad(n, m, np_, ncon, nmeas, gamma, P.A, P.B, P.C, P.D) | ||
| if gamTry == None: | ||
| gamma = 1.e100, | ||
| job = 3 | ||
| else: | ||
| gamma = gamTry | ||
| job = 4 | ||
| out = sb10ad(n, m, np_, ncon, nmeas, gamma, P.A, P.B, P.C, P.D, job) | ||
| gam = out[0] | ||
| Ak = out[1] | ||
| Bk = out[2] | ||
|
|
||
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 parameter name doesn't not follow python-control naming conventions. From the developer notes:
I suggest something like
target_gammafor this parameter name.