Skip to content

AttributeError: 'ValueError' object has no attribute 'info' #347

Description

@peterfakhry

hi there, thanks a lot for having this powerful package. i updated recently to PYthon 3.7 and had this error upon using the control.care function that the object 'ValueError' has no attribute info. Got this error on line 517 in care, mateqn.py:
image

Activity

  1. bnavigator commented on Nov 15, 2019

    @bnavigator
    Contributor

    Slycot did not fill a proper .info attribute for the ValueError exception that you encounter. Your code or care() will still have an issue, but the error message should be more meaningful with python-control/Slycot#84.

    On the other hand, the condition leading to the ValueError should already be visible in the exception stack trace.

  2. peterfakhry commented on Nov 15, 2019

    @peterfakhry
    Author

    thanks a lot for your reply, but is there any corrections that we can do to get my code running?
    thank you

  3. bnavigator commented on Nov 15, 2019

    @bnavigator
    Contributor

    Can you post your full python Traceback?

  4. murrayrm commented on Nov 15, 2019

    @murrayrm
    Member

    Also, note that the reason you are getting this error is that sb02mt is throwing an error => something is wrong in the input you are sending to that function. You might check to make sure the matrices are the right dimensions, appropriate dimensions are full rank, etc.

  5. peterfakhry commented on Nov 15, 2019

    @peterfakhry
    Author

    thanks a lot for all, i tried to run my code again and again over the past hour but did not get that error again (dont know why :D). got this one instead
    S, eigvals, L = cl.care(A_subtelda, (Cm.T), H_subtelda, R_subtelda)

    File "C:\Users\Peter\Anaconda3\lib\site-packages\control\mateqn.py", line 503, in care
    raise ControlArgument("Q must be a symmetric matrix.")

    ControlArgument: Q must be a symmetric matrix.
    which is the H_subtelda matrix which i am sure that it is symmetric
    image
    thanks a lot

  6. murrayrm commented on Nov 15, 2019

    @murrayrm
    Member

    I suspect that the issue is a precision problem. The underlying check is

    (asarray(Q) == asarray(Q).T).all()
    

    Try computing Q - np.transpose(Q) and if there are nonzero entries, that is the problem. A "fix" would be to set Q to be (Q + np.transpose(Q))/2, which should be guaranteed to be symmetric.

  7. peterfakhry commented on Nov 15, 2019

    @peterfakhry
    Author

    WOW, thanks a lot sir, actually the difference did not get a zero (as in picture). i adjusted the Q is you said and the code is running smoothly. Day saver!
    Thanks a lot also' bnavigator'
    image

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