8000 _remove_useless_states() can change types to ndarrays · Issue #82 · python-control/python-control · GitHub
[go: up one dir, main page]

Skip to content
_remove_useless_states() can change types to ndarrays #82
Closed
@manuelli

Description

@manuelli

It seems that if you enter the if statement here then it replaces self.A withself.A with zeros(1,1) which is of type ndarray. This will cause problems later as the library is taking advantage of the fact that * is matrix multiplication not elementwise multiplcation as it would be for ndarrays.

Here is an example of the problem

sys1 = control.StateSpace(0,0,0,0)
sys2 = control.StateSpace(1,0,0,0)
print "type(sys1.A)", type(sys1.A)
print "type(sys2.A)", type(sys2.A)


type(sys1.A) <type 'numpy.ndarray'>
type(sys2.A) <class 'numpy.matrixlib.defmatrix.matrix'>

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

      0