returnValue ModelData::setNonlinearFeedback( const DMatrix& C_, const OutputFcn& feedb_ ) { C = C_; feedb = feedb_; if( feedb_.getNDX() > 0 || feedb_.getNU() > 0 || feedb_.getNP() > 0 || feedb_.getNOD() > 0 ) return RET_NOT_IMPLEMENTED_YET; export_rhs = BT_TRUE; return SUCCESSFUL_RETURN; }
returnValue ModelData::setLinearOutput( const DMatrix& M3_, const DMatrix& A3_, const OutputFcn& rhs3_ ) { M3 = M3_; A3 = A3_; NX3 = A3.getNumCols(); rhs3 = rhs3_; if( NDX == 0 ) NDX = rhs3_.getNDX(); if( NU == 0 ) NU = rhs3_.getNU(); if( NP == 0 ) NP = rhs3_.getNP(); if( NOD == 0 ) NOD = rhs3_.getNOD(); export_rhs = BT_TRUE; return SUCCESSFUL_RETURN; }
uint ModelData::addOutput( const OutputFcn& outputEquation_, const Grid& grid ){ if( rhs_name.empty() && outputNames.size() == 0 ) { Expression next; outputEquation_.getExpression( next ); outputExpressions.push_back( next ); dim_outputs.push_back( next.getDim() ); if( NDX == 0 ) NDX = outputEquation_.getNDX(); if( NU == 0 ) NU = outputEquation_.getNU(); if( NP == 0 ) NP = outputEquation_.getNP(); if( NOD == 0 ) NOD = outputEquation_.getNOD(); outputGrids.push_back( grid ); uint numOuts = (int) ceil((double)grid.getNumIntervals()); num_meas.push_back( numOuts ); } else { return ACADOERROR( RET_INVALID_OPTION ); } return dim_outputs.size(); }