Debugging Tools

There are several options available for ACADO users to help them debug their code.

In writing your model with ACADO's IntermediateState and DifferentialState, you are actually producing sxpression trees. Several options are available to inspect these trees.

Exporting to a C function

Simply flush your Expression to a Function and flush this function into a file:

        DifferentialState x,y;
        IntermediateState X=(some difficult expression involving x and y);
        Function f;
        f << X;
        FILE *file = fopen("debug.cpp", "w" );
        file << f;
        fclose(file);

The two differential states in the generated C code are visible as x[0] and x[1] by default. If the differential states were declared with a name, they would appear with this name in the generated C code:

        DifferentialState x("x"), y("y");

Using a Stream

Introduce a Stream object to flush to stdout:

        DifferentialState x,y;
        IntermediateState X=(some difficult expression involving x and y);
        Stream s;
        s << X;


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Sat Jun 8 2019 19:40:23