Skip to content

_remove_useless_states() can change types to ndarrays #82

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'>

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