simple_function.cpp
Go to the documentation of this file.
00001 
00035 #include <acado_toolkit.hpp>                    // Include the ACADO toolkit
00036 #include <acado/utils/matlab_acado_utils.hpp>   // Include specific Matlab utils
00037 
00038 USING_NAMESPACE_ACADO                           // Open the namespace
00039 
00040 void mexFunction( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )  // Start the MEX function. Do NOT change the header of this function.
00041  { 
00042     clearAllStaticCounters( );                  // Clear software counters
00043  
00044     
00045     
00046     DifferentialState x;
00047     IntermediateState z;
00048     TIME              t;
00049     Function          f;
00050 
00051     z = 0.5*x + 1.0    ;
00052 
00053     f << exp(x) + t    ;
00054     f << exp(z+exp(z)) ;
00055 
00056     printf("the dimension of f is %d   \n",  f.getDim() );
00057     printf("f depends on  %d  states   \n",  f.getNX () );
00058     printf("f depends on  %d  controls \n",  f.getNU () );
00059 
00060     if( f.isConvex() == BT_TRUE )
00061         printf("all components of function f are convex. \n");
00062     
00063     
00064 
00065     clearAllStaticCounters( );                  // Clear software counters
00066 } 
00067 


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Thu Aug 27 2015 12:00:00