Menu

Constraints handling in Grampc

2019-03-18
2019-03-19
  • Daniel Klöser

    Daniel Klöser - 2019-03-18

    Hi,
    I have another question regarding constraints handling of grampc. I have a state which is constrained very close to a discontinous value. In other words, in the ODE I take log(x) and x is constrained by 0.05. So far I run into issues (getting NaNs) when I get close to the inequality constraint. I tried to adapt the penalizing term cmin, but run into the same issue. Are there other parameters worth to tune in order to not run into this issue?
    Best regards
    Daniel

     
  • Felix Mesmer

    Felix Mesmer - 2019-03-18

    Hi Daniel,
    you can have a look at “PenaltyIncreaseFactor” and “PenaltyIncreaseThreshold”. These two parameters control the speed at which the penalty parameter is increased, see Section 4.4.2 in the manual. It might also be helpful to use the scaling option (difficult to say without further information of the system). Lastly, changing the number and ratio of inner gradient iterations and outer multiplier iterations could be useful (in conjunction with the parameter AugLagUpdateGradientRelTol).

    Regards,
    Felix

     
  • Andreas Völz

    Andreas Völz - 2019-03-18

    Hello Daniel,

    some additions to what Felix said: no matter how well you tune the penalty parameters, the states in intermediate iterations can violate the constraints. Since GRAMPC does not check for NaNs, you are responsible for preventing these values, i.e. you have to take care that x is greater than zero before you evaluate log(x). In your case, one option is to check whether x is smaller than some epsilon and if so, set x to epsilon in the problem function.

    Regards,
    Andreas

     
  • Daniel Klöser

    Daniel Klöser - 2019-03-19

    Hey Andreas and Felix,
    I tuned the parameters and it improved the results in term of convergency speed and constraints compliance, but the final solution to prevent NaNs was thresholding of x in the problem formulation. It seem to work pretty well now! Thank you :)
    Best regards,
    Daniel

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.