Menu

Using mathematical function for an ocp problem

Schukov
2017-10-21
2017-10-21
  • Schukov

    Schukov - 2017-10-21

    Hey guys,

    I am currently working on an optimization problem and decided to use acado to solve it.
    It's a great tool, but is it possible to use mathematial functions in the cost function with the matlab interface, like tanh, sign ? It seems that the allowed function are limited to polynomias and the exp- function.

    Is there a possibility to use the tanh-function in acado for an ocp problem?

    Thank You!

     
  • Ettore Zanetti

    Ettore Zanetti - 2017-10-21

    Hi Schukov, I am new to ACADO too, but as far as I understand, you can use just continuos functions on ACADO, so no sign, no modules etc... However you can use TANH by using the definition in form of exponentials (exp(x)-(exp(-x))/(exp(x)+exp(-x))

     
  • Francis

    Francis - 2017-10-26

    For the sign function, maybe you can trying rewriting sign(x) as x/abs(x)?

     
  • Schukov

    Schukov - 2017-10-26

    Hey,
    thank your for your response guys. I have used atan(x), it's not perfect but it works ;)

     

Log in to post a comment.

MongoDB Logo MongoDB