Skip to content

bug in place_acker #1190

Description

@miroslavfikar

The place_acker function works for SISO systems only and returns 1D array instead of 2D array.

1D->2D array can be corrected in:

K = K[-1, :] # Extract the last row

The original line
K = K[-1, :] # Extract the last row
should be changed for
K = K[-1:, :] # Extract the last row

MIMO system specification throws errors. Here is an example:

import numpy as np
import control as ct

nx = 3
nu = 1
ny = 1
sys = ct.rss(states=nx, inputs=nu, outputs=ny)
poles = - np.arange(1, nx+1, 1)
Kp = ct.place(sys.A, sys.B, poles)
Ka = ct.acker(sys.A, sys.B, poles)
print(Kp.shape, Ka.shape)

nx = 3
nu = 2
ny = 2
sys = ct.rss(states=nx, inputs=nu, outputs=ny)
poles = - np.arange(1, nx+1, 1)
Kp = ct.place(sys.A, sys.B, poles)
Ka = ct.acker(sys.A, sys.B, poles)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      Sponsor
      SponsoredKunjungi sekarang
      Promo