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

Possible bug: control.interconnect fails to construct a extended system with zero input and one output (D matrix shape mismatch) #1176

Open
Milestone
@yuu5g0g0

Description

@yuu5g0g0

About the problem

Summary

I attempted to simulate a control system with an output-feedback controller, defining a plant and a controller as subsystems.
When usingcontrol.interconnect to connect these subsystems, an error occurs because an extended system obtained by connecting subsystems has zero input and one output.
Is it impossible to define a system with zero input and one output using thecontrol.interconnect function?

Error message

control.exception.ControlDimension: Incompatible dimensions of D matrix; expected (1, 0) but found (0, 0)

System information

  • OS: macOS Sonoma 14.3.1
  • Python: 3.12.2
  • python-control: 0.10.2

Cause of this problem

When we set the inputs and outputs of the extended system as zero input and one input, the D matrix of the extended system has(1, 0) dimension.
However, the dimension of D matrix is converted to(0, 0) dimension by_ssmatrix function at line 218 ofstatesp.py.
As a result, the mismatch of the dimensions occurs.
(When we set both inputs and outputs to zero, the error does not occur.)

To reproduce the error

importnumpyasnpimportcontrolasctdefmain():# Define the coefficient matrices of plant PA=np.array(        [            [1.00,1.00],            [0.00,-2.0],        ]    )B=np.array(        [            [0.00],            [1.00]        ]    )C=np.array(        [            [1.00,0.00]        ]    )# Define the coefficient matrices of controller CA_c=np.array(        [            [2.25,1.00],            [-5.0,-0.5]        ]    )B_c=np.array(        [            [-1.25],            [4.500]        ]    )C_c=np.array(        [            [-0.50,1.500]        ]    )# Define the subsystemsP=ct.ss(A,B,C,np.zeros([C.shape[0],B.shape[1]]),inputs=[f'u_p{i}'foriinrange(B.shape[1])],outputs=[f'y_p{i}'foriinrange(C.shape[0])],name='P',dt=True    )C=ct.ss(A_c,B_c,C_c,np.zeros([C_c.shape[0],B_c.shape[1]]),inputs=[f'y_p{i}'foriinrange(B_c.shape[1])],outputs=[f'u_p{i}'foriinrange(C_c.shape[0])],name='C',dt=True    )sys=ct.interconnect(        [P,C],inplist=None,outlist=[f'y_p{i}'foriinrange(P.C.shape[0])]    )if__name__=='__main__':main()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp