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!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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))
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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!
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))
For the sign function, maybe you can trying rewriting sign(x) as x/abs(x)?
Hey,
thank your for your response guys. I have used atan(x), it's not perfect but it works ;)