8000 doc inconsistency about return type of lqr - matrix vs array · Issue #418 · python-control/python-control · GitHub
[go: up one dir, main page]

Skip to content
doc inconsistency about return type of lqr - matrix vs array #418
Closed
@jerabaul29

Description

@jerabaul29

I think the doc about the return type of the lqr function looks inconsistent:

https://python-control.readthedocs.io/en/0.8.1/generated/control.lqr.html

states that K is a 2-d array. But it looks a lot like a matrix actually :)

>>> K, _, _ = control.lqr(np.array([1]), np.array([1]), np.array([1]), np.array([1]))
>>> K
matrix([[2.41421356]])

This is Python 3.6.9, control 0.8.3, Ubuntu 18.04 defaults.

This leads to possibly subtle bugs:

https://stackoverflow.com/questions/62342225/how-to-squeeze-when-numpy-squeeze-does-not-seem-to-squeeze?

Do you think it may be a good idea to 1) update the doc 2) maybe change from matrix to array output altogether? :)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0