I am new to this software and I am not able to figure out the following errors I am getting.
I am generating equation using Maple software (CodeGeneration).
error: cannot convert ‘ACADO::Expression’ to ‘double’ for argument ‘1’ to ‘double tanh(double)’
error: cannot convert ‘ACADO::Expression’ to ‘double’ for argument ‘1’ to ‘double sinh(double)’
The errors are coming from the following type of algebraic equations.
As far as I know, the hyperbolic functions "tanh" and "sinh" you are using are not defined in ACADO. Instead, you should probably use their equivalent expressions using exponentials etc. You could for example define a function yourself which reformulates each of those unrecognized calls as the correct algebraic expression.
For example, you would define something like this at the beginning of your code:
I am new to this software and I am not able to figure out the following errors I am getting.
I am generating equation using Maple software (CodeGeneration).
error: cannot convert ‘ACADO::Expression’ to ‘double’ for argument ‘1’ to ‘double tanh(double)’
error: cannot convert ‘ACADO::Expression’ to ‘double’ for argument ‘1’ to ‘double sinh(double)’
The errors are coming from the following type of algebraic equations.
f << 0== 0.9528621007e-6 * a24 - 0.3551453606e-4 * exp(-0.8072128017e1 / a21 + 0.8072128017e1) * pow( (1 - a29), 0.5e0) * pow( a29, 0.5e0) * sinh(0.1947138540e2 / a21 * (a26 + 0.57e-1 - 0.53e0 * exp(- (57 * a29)) + 0.184e0 * tanh(0.200000000000000e2 * a29 - 0.210000000000000e2) + 0.12e-1 * tanh(0.757575757575758e1 * a29 - 0.443181818181818e1) + 0.304e-1 * tanh(0.185185185185185e2 * a29 - 0.324074074074074e1) + 0.1e-1 * tanh(0.255102040816327e0 * a29 - 0.265306122448980e-1)));
f << 0== 0.5968480300e-6 * a25 - 0.2167614250e-3 * exp(-0.2340917124e2 / a21 + 0.2340917124e2) * pow( (1 - a31), 0.5e0) * pow( a31, 0.5e0) * sinh(0.1947138540e2 / a21 * (a27 - (-0.4656e1 + 0.88669e2 * a31 * a31 - 0.401119e3 * pow( a31, 4) + 0.342909e3 * pow( a31, 6) - 0.462471e3 * pow( a31, 8) + 0.433434e3 * pow( a31, 10)) / (-0.10e1 + 0.18933e2 * a31 * a31 - 0.79532e2 * pow( a31, 4) + 0.37311e2 * pow( a31, 6) - 0.73083e2 * pow( a31, 8) + 0.9596e2 * pow( a31, 10)) + 0.15e0));
Thanks in advance.
Regards
Bharat
Last edit: bharat 2014-12-01
Hey there,
As far as I know, the hyperbolic functions "tanh" and "sinh" you are using are not defined in ACADO. Instead, you should probably use their equivalent expressions using exponentials etc. You could for example define a function yourself which reformulates each of those unrecognized calls as the correct algebraic expression.
For example, you would define something like this at the beginning of your code:
IntermediateState tanh( IntermediateState x ){
}
Best,
Rien