⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 c5_lmdap_library_ncs.c

📁 m files for SIAM book, Numerical Computing with MATLAB
💻 C
📖 第 1 页 / 共 5 页
字号:
          0) && (_SFD_CCP_CALL(1,1,((*c5_Firefct2 < 0.0)!=0)) != 0))
        || ((_SFD_CCP_CALL(1,2,(((*c5_e)[1] > 0.0)!=0)) != 0) &&
         (_SFD_CCP_CALL(1,3,((*c5_Coastfct2 > 0.0)!=0)) != 0))) != 0U != 0) {
        if(sf_debug_transition_conflict_check_enabled()) {
          unsigned int transitionList[4];
          unsigned int numTransitions=1;
          transitionList[0] = 1;
          sf_debug_transition_conflict_check_begin();
          if(((*c5_e)[1] > 0.0) && (*c5_Coastfct2 >= 0.0) && (*c5_Firefct1 <
            0.0)) {
            transitionList[numTransitions] = 18;
            numTransitions++;
          }
          if((((*c5_e)[1] > 0.0) && (*c5_Firefct1 > 0.0)) || (((*c5_e)[1] < 0.0)
            && (*c5_Coastfct1 < 0.0))) {
            transitionList[numTransitions] = 19;
            numTransitions++;
          }
          if(((*c5_e)[1] < 0.0) && (*c5_Coastfct1 <= 0.0) && (*c5_Firefct2 >
            0.0)) {
            transitionList[numTransitions] = 16;
            numTransitions++;
          }
          sf_debug_transition_conflict_check_end();
          if(numTransitions>1) {
            _SFD_TRANSITION_CONFLICT(&(transitionList[0]),numTransitions);
          }
        }
        _SFD_CT_CALL(TRANSITION_ACTIVE_TAG,1);
        _SFD_CS_CALL(STATE_ENTER_EXIT_FUNCTION_TAG,5);
        chartInstance->c5_tp_Start = 0U;
        chartInstance->c5_is_c5_LMdap_Library_NCS =
          (uint8_T)c5_IN_NO_ACTIVE_CHILD;
        _SFD_CS_CALL(STATE_INACTIVE_TAG,5);
        _SFD_CS_CALL(EXIT_OUT_OF_FUNCTION_TAG,5);
        chartInstance->c5_is_c5_LMdap_Library_NCS = (uint8_T)c5_IN_Fire_region_2;
        _SFD_CS_CALL(STATE_ACTIVE_TAG,4);
        chartInstance->c5_tp_Fire_region_2 = 1U;
        *c5_jets = *c5_Nofjets;
        _SFD_DATA_RANGE_CHECK(*c5_jets, 0U);
        *c5_ton = *c5_tjcalc - *c5_tjcalc1;
        _SFD_DATA_RANGE_CHECK(*c5_ton, 3U);
      } else {
        _SFD_CT_CALL(TRANSITION_BEFORE_PROCESSING_TAG,18);
        if(CV_TRANSITION_EVAL(18U, (_SFD_CCP_CALL(18,0,(((*c5_e)[1] > 0.0)!=0))
           != 0) && (_SFD_CCP_CALL(18,1,((*c5_Coastfct2 >= 0.0)!=0))
           != 0) && (_SFD_CCP_CALL(18,2,((*c5_Firefct1 < 0.0)!=0)) != 0)) != 0U
         != 0) {
          if(sf_debug_transition_conflict_check_enabled()) {
            unsigned int transitionList[3];
            unsigned int numTransitions=1;
            transitionList[0] = 18;
            sf_debug_transition_conflict_check_begin();
            if((((*c5_e)[1] > 0.0) && (*c5_Firefct1 > 0.0)) || (((*c5_e)[1] <
               0.0) && (*c5_Coastfct1 < 0.0))) {
              transitionList[numTransitions] = 19;
              numTransitions++;
            }
            if(((*c5_e)[1] < 0.0) && (*c5_Coastfct1 <= 0.0) && (*c5_Firefct2 >
              0.0)) {
              transitionList[numTransitions] = 16;
              numTransitions++;
            }
            sf_debug_transition_conflict_check_end();
            if(numTransitions>1) {
              _SFD_TRANSITION_CONFLICT(&(transitionList[0]),numTransitions);
            }
          }
          _SFD_CT_CALL(TRANSITION_ACTIVE_TAG,18);
          _SFD_CS_CALL(STATE_ENTER_EXIT_FUNCTION_TAG,5);
          chartInstance->c5_tp_Start = 0U;
          chartInstance->c5_is_c5_LMdap_Library_NCS =
            (uint8_T)c5_IN_NO_ACTIVE_CHILD;
          _SFD_CS_CALL(STATE_INACTIVE_TAG,5);
          _SFD_CS_CALL(EXIT_OUT_OF_FUNCTION_TAG,5);
          chartInstance->c5_is_c5_LMdap_Library_NCS =
            (uint8_T)c5_IN_Coast_region_2;
          _SFD_CS_CALL(STATE_ACTIVE_TAG,0);
          chartInstance->c5_tp_Coast_region_2 = 1U;
          *c5_jets = 0.0;
          _SFD_DATA_RANGE_CHECK(*c5_jets, 0U);
          *c5_ton = 0.0;
          _SFD_DATA_RANGE_CHECK(*c5_ton, 3U);
          *c5_enable = 0.0;
          _SFD_DATA_RANGE_CHECK(*c5_enable, 9U);
        } else {
          _SFD_CT_CALL(TRANSITION_BEFORE_PROCESSING_TAG,19);
          if(CV_TRANSITION_EVAL(19U, ((_SFD_CCP_CALL(19,0,(((*c5_e)[1] >
                 0.0)!=0)) != 0) && (_SFD_CCP_CALL(19,1,((*c5_Firefct1 >
                 0.0)!=0)) !=
              0)) || ((_SFD_CCP_CALL(19,2,(((*c5_e)[1] < 0.0)!=0)) != 0) &&
             (_SFD_CCP_CALL(19,3,((*c5_Coastfct1 < 0.0)!=0)) != 0))) != 0U != 0)
          {
            if(sf_debug_transition_conflict_check_enabled()) {
              unsigned int transitionList[2];
              unsigned int numTransitions=1;
              transitionList[0] = 19;
              sf_debug_transition_conflict_check_begin();
              if(((*c5_e)[1] < 0.0) && (*c5_Coastfct1 <= 0.0) && (*c5_Firefct2 >
                0.0)) {
                transitionList[numTransitions] = 16;
                numTransitions++;
              }
              sf_debug_transition_conflict_check_end();
              if(numTransitions>1) {
                _SFD_TRANSITION_CONFLICT(&(transitionList[0]),numTransitions);
              }
            }
            _SFD_CT_CALL(TRANSITION_ACTIVE_TAG,19);
            _SFD_CS_CALL(STATE_ENTER_EXIT_FUNCTION_TAG,5);
            chartInstance->c5_tp_Start = 0U;
            chartInstance->c5_is_c5_LMdap_Library_NCS =
              (uint8_T)c5_IN_NO_ACTIVE_CHILD;
            _SFD_CS_CALL(STATE_INACTIVE_TAG,5);
            _SFD_CS_CALL(EXIT_OUT_OF_FUNCTION_TAG,5);
            chartInstance->c5_is_c5_LMdap_Library_NCS =
              (uint8_T)c5_IN_Fire_region_1;
            _SFD_CS_CALL(STATE_ACTIVE_TAG,2);
            chartInstance->c5_tp_Fire_region_1 = 1U;
            *c5_jets = -(*c5_Nofjets);
            _SFD_DATA_RANGE_CHECK(*c5_jets, 0U);
            *c5_ton = *c5_tjcalc + *c5_tjcalc1;
            _SFD_DATA_RANGE_CHECK(*c5_ton, 3U);
          } else {
            _SFD_CT_CALL(TRANSITION_BEFORE_PROCESSING_TAG,16);
            if(CV_TRANSITION_EVAL(16U, (_SFD_CCP_CALL(16,0,(((*c5_e)[1] <
                  0.0)!=0)) != 0) && (_SFD_CCP_CALL(16,1,((*c5_Coastfct1 <=
                  0.0)!=0))
               != 0) && (_SFD_CCP_CALL(16,2,((*c5_Firefct2 > 0.0)!=0)) != 0)) !=
             0U != 0) {
              _SFD_CT_CALL(TRANSITION_ACTIVE_TAG,16);
              _SFD_CS_CALL(STATE_ENTER_EXIT_FUNCTION_TAG,5);
              chartInstance->c5_tp_Start = 0U;
              chartInstance->c5_is_c5_LMdap_Library_NCS =
                (uint8_T)c5_IN_NO_ACTIVE_CHILD;
              _SFD_CS_CALL(STATE_INACTIVE_TAG,5);
              _SFD_CS_CALL(EXIT_OUT_OF_FUNCTION_TAG,5);
              chartInstance->c5_is_c5_LMdap_Library_NCS =
                (uint8_T)c5_IN_Coast_region_1;
              _SFD_CS_CALL(STATE_ACTIVE_TAG,3);
              chartInstance->c5_tp_Coast_region_1 = 1U;
              *c5_jets = 0.0;
              _SFD_DATA_RANGE_CHECK(*c5_jets, 0U);
              *c5_ton = 0.0;
              _SFD_DATA_RANGE_CHECK(*c5_ton, 3U);
              *c5_enable = 0.0;
              _SFD_DATA_RANGE_CHECK(*c5_enable, 9U);
            }
          }
        }
      }
      _SFD_CS_CALL(EXIT_OUT_OF_FUNCTION_TAG,5);
      break;
     case c5_IN_Wait_for_stable_rate:
      CV_CHART_EVAL(0,0,8);
      _SFD_CS_CALL(STATE_ENTER_DURING_FUNCTION_TAG,6);
      _SFD_CT_CALL(TRANSITION_BEFORE_PROCESSING_TAG,10);
      if(CV_TRANSITION_EVAL(10U,
        (int32_T)_SFD_CCP_CALL(10,0,((chartInstance->c5_count == 0.0)!=0))) !=
       0U != 0) {
        _SFD_CT_CALL(TRANSITION_ACTIVE_TAG,10);
        _SFD_CS_CALL(STATE_ENTER_EXIT_FUNCTION_TAG,6);
        chartInstance->c5_tp_Wait_for_stable_rate = 0U;
        _SFD_CS_CALL(STATE_INACTIVE_TAG,6);
        _SFD_CS_CALL(EXIT_OUT_OF_FUNCTION_TAG,6);
        chartInstance->c5_is_c5_LMdap_Library_NCS = (uint8_T)c5_IN_Start;
        _SFD_CS_CALL(STATE_ACTIVE_TAG,5);
        chartInstance->c5_tp_Start = 1U;
      } else {
        _SFD_CT_CALL(TRANSITION_BEFORE_PROCESSING_TAG,20);
        _SFD_CT_CALL(TRANSITION_ACTIVE_TAG,20);
        _SFD_CS_CALL(STATE_ENTER_EXIT_FUNCTION_TAG,6);
        chartInstance->c5_tp_Wait_for_stable_rate = 0U;
        _SFD_CS_CALL(STATE_INACTIVE_TAG,6);
        _SFD_CS_CALL(EXIT_OUT_OF_FUNCTION_TAG,6);
        chartInstance->c5_count = chartInstance->c5_count - 1.0;
        _SFD_DATA_RANGE_CHECK(chartInstance->c5_count, 7U);
        chartInstance->c5_is_c5_LMdap_Library_NCS =
          (uint8_T)c5_IN_Wait_for_stable_rate;
        _SFD_CS_CALL(STATE_ACTIVE_TAG,6);
        chartInstance->c5_tp_Wait_for_stable_rate = 1U;
      }
      _SFD_CS_CALL(EXIT_OUT_OF_FUNCTION_TAG,6);
      break;
     default:
      CV_CHART_EVAL(0,0,0);
      chartInstance->c5_is_c5_LMdap_Library_NCS = (uint8_T)c5_IN_NO_ACTIVE_CHILD;
      _SFD_CS_CALL(STATE_INACTIVE_TAG,3);
      break;
    }
  }
  _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG,0);
}

static void c5_Fire_region_1(SFc5_LMdap_Library_NCSInstanceStruct *chartInstance)
{
  real_T *c5_Coastfct1;
  real_T *c5_ton;
  real_T *c5_enable;
  real_T *c5_Nofjets;
  real_T *c5_jets;
  real_T *c5_tjcalc;
  real_T *c5_tjcalc1;
  real_T (*c5_e)[2];
  c5_jets = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1);
  c5_tjcalc = (real_T *)ssGetInputPortSignal(chartInstance->S, 7);
  c5_Coastfct1 = (real_T *)ssGetInputPortSignal(chartInstance->S, 3);
  c5_tjcalc1 = (real_T *)ssGetInputPortSignal(chartInstance->S, 6);
  c5_enable = (real_T *)ssGetOutputPortSignal(chartInstance->S, 2);
  c5_Nofjets = (real_T *)ssGetInputPortSignal(chartInstance->S, 0);
  c5_ton = (real_T *)ssGetOutputPortSignal(chartInstance->S, 3);
  c5_e = (real_T (*)[2])ssGetInputPortSignal(chartInstance->S, 1);
  _SFD_CS_CALL(STATE_ENTER_DURING_FUNCTION_TAG,2);
  _SFD_CT_CALL(TRANSITION_BEFORE_PROCESSING_TAG,17);
  if(CV_TRANSITION_EVAL(17U, (_SFD_CCP_CALL(17,0,(((*c5_e)[1] < 0.0)!=0)) != 0)
    && (_SFD_CCP_CALL(17,1,((*c5_Coastfct1 <= 0.0)!=0))
     != 0)) != 0U != 0) {
    if(sf_debug_transition_conflict_check_enabled()) {
      unsigned int transitionList[2];
      unsigned int numTransitions=1;
      transitionList[0] = 17;
      sf_debug_transition_conflict_check_begin();
      if(*c5_ton < 2.0 * chartInstance->c5_delt) {
        transitionList[numTransitions] = 0;
        numTransitions++;
      }
      sf_debug_transition_conflict_check_end();
      if(numTransitions>1) {
        _SFD_TRANSITION_CONFLICT(&(transitionList[0]),numTransitions);
      }
    }
    _SFD_CT_CALL(TRANSITION_ACTIVE_TAG,17);
    _SFD_CS_CALL(STATE_ENTER_EXIT_FUNCTION_TAG,2);
    chartInstance->c5_tp_Fire_region_1 = 0U;
    chartInstance->c5_is_c5_LMdap_Library_NCS = (uint8_T)c5_IN_NO_ACTIVE_CHILD;
    _SFD_CS_CALL(STATE_INACTIVE_TAG,2);
    _SFD_CS_CALL(EXIT_OUT_OF_FUNCTION_TAG,2);
    chartInstance->c5_is_c5_LMdap_Library_NCS = (uint8_T)c5_IN_Coast_region_1;
    _SFD_CS_CALL(STATE_ACTIVE_TAG,3);
    chartInstance->c5_tp_Coast_region_1 = 1U;
    *c5_jets = 0.0;
    _SFD_DATA_RANGE_CHECK(*c5_jets, 0U);
    *c5_ton = 0.0;
    _SFD_DATA_RANGE_CHECK(*c5_ton, 3U);
    *c5_enable = 0.0;
    _SFD_DATA_RANGE_CHECK(*c5_enable, 9U);
  } else {
    _SFD_CT_CALL(TRANSITION_BEFORE_PROCESSING_TAG,0);
    if(CV_TRANSITION_EVAL(0U, (int32_T)_SFD_CCP_CALL(0,0,((*c5_ton < 2.0 *
         chartInstance->c5_delt)!=0))) != 0U != 0) {
      _SFD_CT_CALL(TRANSITION_ACTIVE_TAG,0);
      *c5_enable = 1.0;
      _SFD_DATA_RANGE_CHECK(*c5_enable, 9U);
      _SFD_CT_CALL(TRANSITION_BEFORE_PROCESSING_TAG,3);
      if(CV_TRANSITION_EVAL(3U, (int32_T)_SFD_CCP_CALL(3,0,((*c5_ton >
           chartInstance->c5_tmin)!=0))) != 0U != 0) {
        _SFD_CT_CALL(TRANSITION_ACTIVE_TAG,3);
        chartInstance->c5_count = 2.0;
        _SFD_DATA_RANGE_CHECK(chartInstance->c5_count, 7U);
        _SFD_CS_CALL(STATE_ENTER_EXIT_FUNCTION_TAG,2);
        chartInstance->c5_tp_Fire_region_1 = 0U;
        chartInstance->c5_is_c5_LMdap_Library_NCS =
          (uint8_T)c5_IN_NO_ACTIVE_CHILD;
        _SFD_CS_CALL(STATE_INACTIVE_TAG,2);
        _SFD_CS_CALL(EXIT_OUT_OF_FUNCTION_TAG,2);
        chartInstance->c5_is_c5_LMdap_Library_NCS =
          (uint8_T)c5_IN_Skip_a_Sample_1;
        _SFD_CS_CALL(STATE_ACTIVE_TAG,7);
        chartInstance->c5_tp_Skip_a_Sample_1 = 1U;
        chartInstance->c5_count = chartInstance->c5_count - 1.0;
        _SFD_DATA_RANGE_CHECK(chartInstance->c5_count, 7U);
      } else {
        _SFD_CT_CALL(TRANSITION_BEFORE_PROCESSING_TAG,21);
        _SFD_CT_CALL(TRANSITION_ACTIVE_TAG,21);
        *c5_enable = 0.0;
        _SFD_DATA_RANGE_CHECK(*c5_enable, 9U);
        _SFD_CS_CALL(STATE_ENTER_EXIT_FUNCTION_TAG,2);
        chartInstance->c5_tp_Fire_region_1 = 0U;
        _SFD_CS_CALL(STATE_INACTIVE_TAG,2);
        _SFD_CS_CALL(EXIT_OUT_OF_FUNCTION_TAG,2);
        chartInstance->c5_is_c5_LMdap_Library_NCS =
          (uint8_T)c5_IN_Coast_region_1;
        _SFD_CS_CALL(STATE_ACTIVE_TAG,3);
        chartInstance->c5_tp_Coast_region_1 = 1U;
        *c5_jets = 0.0;
        _SFD_DATA_RANGE_CHECK(*c5_jets, 0U);
        *c5_ton = 0.0;
        _SFD_DATA_RANGE_CHECK(*c5_ton, 3U);
        *c5_enable = 0.0;
        _SFD_DATA_RANGE_CHECK(*c5_enable, 9U);
      }
    } else {
      _SFD_CT_CALL(TRANSITION_BEFORE_PROCESSING_TAG,4);
      _SFD_CT_CALL(TRANSITION_ACTIVE_TAG,4);
      _SFD_CS_CALL(STATE_ENTER_EXIT_FUNCTION_TAG,2);
      chartInstance->c5_tp_Fire_region_1 = 0U;
      _SFD_CS_CALL(STATE_INACTIVE_TAG,2);
      _SFD_CS_CALL(EXIT_OUT_OF_FUNCTION_TAG,2);
      chartInstance->c5_is_c5_LMdap_Library_NCS = (uint8_T)c5_IN_Fire_region_1;
      _SFD_CS_CALL(STATE_ACTIVE_TAG,2);
      chartInstance->c5_tp_Fire_region_1 = 1U;
      *c5_jets = -(*c5_Nofjets);
      _SFD_DATA_RANGE_CHECK(*c5_jets, 0U);
      *c5_ton = *c5_tjcalc + *c5_tjcalc1;
      _SFD_DATA_RANGE_CHECK(*c5_ton, 3U);
    }
  }
  _SFD_CS_CALL(EXIT_OUT_OF_FUNCTION_TAG,2);
}

static void c5_Coast_region_2(SFc5_LMdap_Library_NCSInstanceStruct
 *chartInstance)
{
  real_T *c5_Firefct1;
  real_T *c5_Nofjets;
  real_T *c5_jets;
  real_T *c5_tjcalc;
  real_T *c5_tjcalc1;
  real_T *c5_ton;
  real_T (*c5_e)[2];
  c5_jets = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -