예제 #1
0
uint ModelData::addOutput( const OutputFcn& outputEquation_ ){

	if( rhs_name.isEmpty() && outputNames.size() == 0 ) {
		Expression next;
		outputEquation_.getExpression( next );
		outputExpressions.push_back( next );
		dim_outputs.push_back( next.getDim() );
	}
	else {
		return ACADOERROR( RET_INVALID_OPTION );
	}

	return dim_outputs.size();
}
예제 #2
0
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();
}