Menu

Workaround sought for required accuracy error

stuart
2014-11-13
2019-08-16
  • stuart

    stuart - 2014-11-13

    I would appreciate some guidance on working around the following errors, which occur whether or not the optimization is constrained:

    [ACADO] Error: The integration routine stopped as the required accuracy can not be obtained
    Code: (RET_UNSUCCESSFUL_RETURN_FROM_INTEGRATOR_BDF)
    File: /home/stuartg/ACADOtoolkit/src/integrator/integrator_bdf.cpp
    Line: 2021

    [ACADO] Error: Initialization of NLP solver failed
    Code: (RET_UNABLE_TO_INTEGRATE_SYSTEM)
    File: /home/stuartg/ACADOtoolkit/src/dynamic_discretization/shooting_method.cpp
    Line: 279

    [ACADO] Error: Initialization of NLP solver failed
    Code: (RET_NLP_INIT_FAILED)
    File: /home/stuartg/ACADOtoolkit/src/nlp_solver/scp_method.cpp
    Line: 214

    [ACADO] Error: Initialization of optimization algorithm failed
    Code: (RET_OPTALG_INIT_FAILED)
    File: /home/stuartg/ACADOtoolkit/src/optimization_algorithm/optimization_algorithm_base.cpp
    Line: 591

    Attached is a Pontryagin Maximum output for unconstrained optimization.

    The toy problem is shown below:

    #include <acado_toolkit.hpp>
    #include <include/acado_gnuplot/gnuplot_window.hpp>
    
    int main( ){
    
        USING_NAMESPACE_ACADO
    
    // INTRODUCE THE VARIABLES
    //  -------------------------------------
        DifferentialState        uu,k,temp   ;     // the differential states
        AlgebraicState           inv,prod,dam;     // the algebraic states
        Control                  mu,c        ;     // the control inputs
    //  Parameter                T           ;     // the time horizon T
        DifferentialEquation     f           ;     // the differential equation
        TIME                     t           ;     // time
    
        const double t_start = 0.0;
        const double t_end   = 100.0;
    
    // DEFINE A DIFFERENTIAL EQUATION
    //  -------------------------------------
        f << dot(uu)   == -exp(-0.015*t)*(-1 + c)/c;  // an implementation
        f << dot(k)    == inv-0.04*k;                 // of the model equations
        f << dot(temp) == pow(k,0.85)*(1-mu)/1000;   
        f<<          0 == prod-pow(k,0.85)*dam;
        f<<          0 == inv-prod+c;
        f<<          0 == dam-1/(1+0.01*pow(temp,2));
    
    // DEFINE AN OPTIMAL CONTROL PROBLEM
    //  -------------------------------------   
        OCP ocp( t_start, t_end, 10);            // time horizon & steps
        ocp.minimizeMayerTerm( uu );              // minimization obj
    
        ocp.subjectTo( f                       );  // minimize obj s.t. the model,
        ocp.subjectTo( AT_START, uu   == 0.0   );  // initial values:
        ocp.subjectTo( AT_START, k    == 8.0   );
        ocp.subjectTo( AT_START, c    == 1.7   );
        ocp.subjectTo( AT_START, temp == 0.5   );
        ocp.subjectTo( AT_START, mu   == 0.005 );
    
    //    ocp.subjectTo( AT_END  , s == 10.0 );   // the terminal constraints for s
    //    ocp.subjectTo( AT_END  , v ==  0.0 );   // and v,
    
        ocp.subjectTo( 0.0 <= mu  <=  1.0   );
        ocp.subjectTo( 0.0 <= k   <=  5.0e6 );
        ocp.subjectTo( 0.0 <= inv <=  0.3e6 );
    //  -------------------------------------
    
        GnuplotWindow window;
            window.addSubplot( uu, "THE UTILITY uu"         );
            window.addSubplot( k, "THE ASSETS k"            );
            window.addSubplot( c, "THE CONSUMPTION c"       );
        window.addSubplot( inv, "THE INVESTMENT inv"    );
        window.addSubplot( mu, "THE ABATEMENT mu"       );
            window.addSubplot( temp, "THE TEMPERATURE temp" );
    
    // DEFINE AN OPTIMIZATION AND SOLVE THE OCP:
    //  -------------------------------------   
        OptimizationAlgorithm algorithm(ocp);     // the optimization algorithm
    
    //    algorithm.set( ABSOLUTE_TOLERANCE    , 1e-7          );
    //    algorithm.set( INTEGRATOR_TOLERANCE  , 1e-7          );
    //    algorithm.set( HESSIAN_APPROXIMATION , EXACT_HESSIAN );
    
        algorithm << window;
        algorithm.solve();                        // solves the problem.
    
        return 0;
    }
    
     

    Last edit: stuart 2014-11-13
  • stuart

    stuart - 2014-11-19

    Hi, thought I would bump this post to see if anyone might suggest why this problem cannot solve? Thanks, Stuart

     
  • hcl734

    hcl734 - 2019-08-16

    Any updates? Running in the same problem

     

Log in to post a comment.

Auth0 Logo