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

lqe does not work with 3 arguments #1159

Open
@ovhnw

Description

@ovhnw
from control import lqe,ss,ctrb,obsvfrom numpy import diag,arrayfrom numpy.linalg import matrix_rankA = array([ [0,1,0],            [0,0,1],            [0,0,0]])B = array([[0],[0],[1]])C = array([[1,0,0]])D = array([[0]])sys=ss(A,B,C,D)print(matrix_rank(ctrb(A,B)))print(matrix_rank(obsv(A,C)))L,_,_=lqe(A,diag([1,1,1]),C,diag([1,1,1]),array([[1]]))print(L)L,_,_=lqe(sys,diag([1,1,1]),array([[1]]))

outputs

33[[2.41421356] [2.41421356] [1.        ]]Traceback (most recent call last):  File "/home/paul/Documents/paul/personal/properly named/tippy control with better control/test_lqe.py", line 19, in <module>    L,_,_=lqe(sys,diag([1,1,1]),array([[1]]))          ~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File "/home/paul/Documents/paul/personal/properly named/tippy control with better control/.venv/lib/python3.13/site-packages/control/stochsys.py", line 176, in lqe    _check_shape("QN", QN, G.shape[1], G.shape[1])    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File "/home/paul/Documents/paul/personal/properly named/tippy control with better control/.venv/lib/python3.13/site-packages/control/mateqn.py", line 643, in _check_shape    raise ControlDimension("Incompatible dimensions of %s matrix" % name)control.exception.ControlDimension: Incompatible dimensions of QN matrix

if the G matrix is manually specifiedlqe works, otherwise it seems to find a dimension mismatch

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


      [8]ページ先頭

      ©2009-2025 Movatter.jp