www.pudn.com > pi_svpwm.zip > c5_mpc_svpwm.c, change:2014-03-20,size:60804b


/* Include files */ 
 
#include <stddef.h> 
#include "blas.h" 
#include "mpc_svpwm_sfun.h" 
#include "c5_mpc_svpwm.h" 
#include "mwmathutil.h" 
#define CHARTINSTANCE_CHARTNUMBER      (chartInstance->chartNumber) 
#define CHARTINSTANCE_INSTANCENUMBER   (chartInstance->instanceNumber) 
#include "mpc_svpwm_sfun_debug_macros.h" 
#define _SF_MEX_LISTEN_FOR_CTRL_C(S)   sf_mex_listen_for_ctrl_c(sfGlobalDebugInstanceStruct,S); 
 
/* Type Definitions */ 
 
/* Named Constants */ 
#define CALL_EVENT                     (-1) 
 
/* Variable Declarations */ 
 
/* Variable Definitions */ 
static const char * c5_debug_family_names[13] = { "C3s2s", "U32", "I32", 
  "nargin", "nargout", "Uabc", "Iabc", "uD", "uQ", "iD", "iQ", "sinu", "cosu" }; 
 
/* Function Declarations */ 
static void initialize_c5_mpc_svpwm(SFc5_mpc_svpwmInstanceStruct *chartInstance); 
static void initialize_params_c5_mpc_svpwm(SFc5_mpc_svpwmInstanceStruct 
  *chartInstance); 
static void enable_c5_mpc_svpwm(SFc5_mpc_svpwmInstanceStruct *chartInstance); 
static void disable_c5_mpc_svpwm(SFc5_mpc_svpwmInstanceStruct *chartInstance); 
static void c5_update_debugger_state_c5_mpc_svpwm(SFc5_mpc_svpwmInstanceStruct 
  *chartInstance); 
static const mxArray *get_sim_state_c5_mpc_svpwm(SFc5_mpc_svpwmInstanceStruct 
  *chartInstance); 
static void set_sim_state_c5_mpc_svpwm(SFc5_mpc_svpwmInstanceStruct 
  *chartInstance, const mxArray *c5_st); 
static void finalize_c5_mpc_svpwm(SFc5_mpc_svpwmInstanceStruct *chartInstance); 
static void sf_c5_mpc_svpwm(SFc5_mpc_svpwmInstanceStruct *chartInstance); 
static void c5_chartstep_c5_mpc_svpwm(SFc5_mpc_svpwmInstanceStruct 
  *chartInstance); 
static void initSimStructsc5_mpc_svpwm(SFc5_mpc_svpwmInstanceStruct 
  *chartInstance); 
static void registerMessagesc5_mpc_svpwm(SFc5_mpc_svpwmInstanceStruct 
  *chartInstance); 
static void init_script_number_translation(uint32_T c5_machineNumber, uint32_T 
  c5_chartNumber); 
static const mxArray *c5_sf_marshallOut(void *chartInstanceVoid, void *c5_inData); 
static real_T c5_emlrt_marshallIn(SFc5_mpc_svpwmInstanceStruct *chartInstance, 
  const mxArray *c5_cosu, const char_T *c5_identifier); 
static real_T c5_b_emlrt_marshallIn(SFc5_mpc_svpwmInstanceStruct *chartInstance, 
  const mxArray *c5_u, const emlrtMsgIdentifier *c5_parentId); 
static void c5_sf_marshallIn(void *chartInstanceVoid, const mxArray 
  *c5_mxArrayInData, const char_T *c5_varName, void *c5_outData); 
static const mxArray *c5_b_sf_marshallOut(void *chartInstanceVoid, void 
  *c5_inData); 
static const mxArray *c5_c_sf_marshallOut(void *chartInstanceVoid, void 
  *c5_inData); 
static void c5_c_emlrt_marshallIn(SFc5_mpc_svpwmInstanceStruct *chartInstance, 
  const mxArray *c5_u, const emlrtMsgIdentifier *c5_parentId, real_T c5_y[2]); 
static void c5_b_sf_marshallIn(void *chartInstanceVoid, const mxArray 
  *c5_mxArrayInData, const char_T *c5_varName, void *c5_outData); 
static const mxArray *c5_d_sf_marshallOut(void *chartInstanceVoid, void 
  *c5_inData); 
static void c5_info_helper(c5_ResolvedFunctionInfo c5_info[23]); 
static void c5_eml_error(SFc5_mpc_svpwmInstanceStruct *chartInstance); 
static void c5_eml_scalar_eg(SFc5_mpc_svpwmInstanceStruct *chartInstance); 
static real_T c5_power(SFc5_mpc_svpwmInstanceStruct *chartInstance, real_T c5_a); 
static void c5_b_eml_scalar_eg(SFc5_mpc_svpwmInstanceStruct *chartInstance); 
static const mxArray *c5_e_sf_marshallOut(void *chartInstanceVoid, void 
  *c5_inData); 
static int32_T c5_d_emlrt_marshallIn(SFc5_mpc_svpwmInstanceStruct *chartInstance, 
  const mxArray *c5_u, const emlrtMsgIdentifier *c5_parentId); 
static void c5_c_sf_marshallIn(void *chartInstanceVoid, const mxArray 
  *c5_mxArrayInData, const char_T *c5_varName, void *c5_outData); 
static uint8_T c5_e_emlrt_marshallIn(SFc5_mpc_svpwmInstanceStruct *chartInstance, 
  const mxArray *c5_b_is_active_c5_mpc_svpwm, const char_T *c5_identifier); 
static uint8_T c5_f_emlrt_marshallIn(SFc5_mpc_svpwmInstanceStruct *chartInstance, 
  const mxArray *c5_u, const emlrtMsgIdentifier *c5_parentId); 
static void init_dsm_address_info(SFc5_mpc_svpwmInstanceStruct *chartInstance); 
 
/* Function Definitions */ 
static void initialize_c5_mpc_svpwm(SFc5_mpc_svpwmInstanceStruct *chartInstance) 
{ 
  chartInstance->c5_sfEvent = CALL_EVENT; 
  _sfTime_ = (real_T)ssGetT(chartInstance->S); 
  chartInstance->c5_is_active_c5_mpc_svpwm = 0U; 
} 
 
static void initialize_params_c5_mpc_svpwm(SFc5_mpc_svpwmInstanceStruct 
  *chartInstance) 
{ 
} 
 
static void enable_c5_mpc_svpwm(SFc5_mpc_svpwmInstanceStruct *chartInstance) 
{ 
  _sfTime_ = (real_T)ssGetT(chartInstance->S); 
} 
 
static void disable_c5_mpc_svpwm(SFc5_mpc_svpwmInstanceStruct *chartInstance) 
{ 
  _sfTime_ = (real_T)ssGetT(chartInstance->S); 
} 
 
static void c5_update_debugger_state_c5_mpc_svpwm(SFc5_mpc_svpwmInstanceStruct 
  *chartInstance) 
{ 
} 
 
static const mxArray *get_sim_state_c5_mpc_svpwm(SFc5_mpc_svpwmInstanceStruct 
  *chartInstance) 
{ 
  const mxArray *c5_st; 
  const mxArray *c5_y = NULL; 
  real_T c5_hoistedGlobal; 
  real_T c5_u; 
  const mxArray *c5_b_y = NULL; 
  real_T c5_b_hoistedGlobal; 
  real_T c5_b_u; 
  const mxArray *c5_c_y = NULL; 
  real_T c5_c_hoistedGlobal; 
  real_T c5_c_u; 
  const mxArray *c5_d_y = NULL; 
  real_T c5_d_hoistedGlobal; 
  real_T c5_d_u; 
  const mxArray *c5_e_y = NULL; 
  real_T c5_e_hoistedGlobal; 
  real_T c5_e_u; 
  const mxArray *c5_f_y = NULL; 
  real_T c5_f_hoistedGlobal; 
  real_T c5_f_u; 
  const mxArray *c5_g_y = NULL; 
  uint8_T c5_g_hoistedGlobal; 
  uint8_T c5_g_u; 
  const mxArray *c5_h_y = NULL; 
  real_T *c5_cosu; 
  real_T *c5_iD; 
  real_T *c5_iQ; 
  real_T *c5_sinu; 
  real_T *c5_uD; 
  real_T *c5_uQ; 
  c5_cosu = (real_T *)ssGetOutputPortSignal(chartInstance->S, 6); 
  c5_sinu = (real_T *)ssGetOutputPortSignal(chartInstance->S, 5); 
  c5_iQ = (real_T *)ssGetOutputPortSignal(chartInstance->S, 4); 
  c5_iD = (real_T *)ssGetOutputPortSignal(chartInstance->S, 3); 
  c5_uQ = (real_T *)ssGetOutputPortSignal(chartInstance->S, 2); 
  c5_uD = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1); 
  c5_st = NULL; 
  c5_st = NULL; 
  c5_y = NULL; 
  sf_mex_assign(&c5_y, sf_mex_createcellarray(7), FALSE); 
  c5_hoistedGlobal = *c5_cosu; 
  c5_u = c5_hoistedGlobal; 
  c5_b_y = NULL; 
  sf_mex_assign(&c5_b_y, sf_mex_create("y", &c5_u, 0, 0U, 0U, 0U, 0), FALSE); 
  sf_mex_setcell(c5_y, 0, c5_b_y); 
  c5_b_hoistedGlobal = *c5_iD; 
  c5_b_u = c5_b_hoistedGlobal; 
  c5_c_y = NULL; 
  sf_mex_assign(&c5_c_y, sf_mex_create("y", &c5_b_u, 0, 0U, 0U, 0U, 0), FALSE); 
  sf_mex_setcell(c5_y, 1, c5_c_y); 
  c5_c_hoistedGlobal = *c5_iQ; 
  c5_c_u = c5_c_hoistedGlobal; 
  c5_d_y = NULL; 
  sf_mex_assign(&c5_d_y, sf_mex_create("y", &c5_c_u, 0, 0U, 0U, 0U, 0), FALSE); 
  sf_mex_setcell(c5_y, 2, c5_d_y); 
  c5_d_hoistedGlobal = *c5_sinu; 
  c5_d_u = c5_d_hoistedGlobal; 
  c5_e_y = NULL; 
  sf_mex_assign(&c5_e_y, sf_mex_create("y", &c5_d_u, 0, 0U, 0U, 0U, 0), FALSE); 
  sf_mex_setcell(c5_y, 3, c5_e_y); 
  c5_e_hoistedGlobal = *c5_uD; 
  c5_e_u = c5_e_hoistedGlobal; 
  c5_f_y = NULL; 
  sf_mex_assign(&c5_f_y, sf_mex_create("y", &c5_e_u, 0, 0U, 0U, 0U, 0), FALSE); 
  sf_mex_setcell(c5_y, 4, c5_f_y); 
  c5_f_hoistedGlobal = *c5_uQ; 
  c5_f_u = c5_f_hoistedGlobal; 
  c5_g_y = NULL; 
  sf_mex_assign(&c5_g_y, sf_mex_create("y", &c5_f_u, 0, 0U, 0U, 0U, 0), FALSE); 
  sf_mex_setcell(c5_y, 5, c5_g_y); 
  c5_g_hoistedGlobal = chartInstance->c5_is_active_c5_mpc_svpwm; 
  c5_g_u = c5_g_hoistedGlobal; 
  c5_h_y = NULL; 
  sf_mex_assign(&c5_h_y, sf_mex_create("y", &c5_g_u, 3, 0U, 0U, 0U, 0), FALSE); 
  sf_mex_setcell(c5_y, 6, c5_h_y); 
  sf_mex_assign(&c5_st, c5_y, FALSE); 
  return c5_st; 
} 
 
static void set_sim_state_c5_mpc_svpwm(SFc5_mpc_svpwmInstanceStruct 
  *chartInstance, const mxArray *c5_st) 
{ 
  const mxArray *c5_u; 
  real_T *c5_cosu; 
  real_T *c5_iD; 
  real_T *c5_iQ; 
  real_T *c5_sinu; 
  real_T *c5_uD; 
  real_T *c5_uQ; 
  c5_cosu = (real_T *)ssGetOutputPortSignal(chartInstance->S, 6); 
  c5_sinu = (real_T *)ssGetOutputPortSignal(chartInstance->S, 5); 
  c5_iQ = (real_T *)ssGetOutputPortSignal(chartInstance->S, 4); 
  c5_iD = (real_T *)ssGetOutputPortSignal(chartInstance->S, 3); 
  c5_uQ = (real_T *)ssGetOutputPortSignal(chartInstance->S, 2); 
  c5_uD = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1); 
  chartInstance->c5_doneDoubleBufferReInit = TRUE; 
  c5_u = sf_mex_dup(c5_st); 
  *c5_cosu = c5_emlrt_marshallIn(chartInstance, sf_mex_dup(sf_mex_getcell(c5_u, 
    0)), "cosu"); 
  *c5_iD = c5_emlrt_marshallIn(chartInstance, sf_mex_dup(sf_mex_getcell(c5_u, 1)), 
    "iD"); 
  *c5_iQ = c5_emlrt_marshallIn(chartInstance, sf_mex_dup(sf_mex_getcell(c5_u, 2)), 
    "iQ"); 
  *c5_sinu = c5_emlrt_marshallIn(chartInstance, sf_mex_dup(sf_mex_getcell(c5_u, 
    3)), "sinu"); 
  *c5_uD = c5_emlrt_marshallIn(chartInstance, sf_mex_dup(sf_mex_getcell(c5_u, 4)), 
    "uD"); 
  *c5_uQ = c5_emlrt_marshallIn(chartInstance, sf_mex_dup(sf_mex_getcell(c5_u, 5)), 
    "uQ"); 
  chartInstance->c5_is_active_c5_mpc_svpwm = c5_e_emlrt_marshallIn(chartInstance, 
    sf_mex_dup(sf_mex_getcell(c5_u, 6)), "is_active_c5_mpc_svpwm"); 
  sf_mex_destroy(&c5_u); 
  c5_update_debugger_state_c5_mpc_svpwm(chartInstance); 
  sf_mex_destroy(&c5_st); 
} 
 
static void finalize_c5_mpc_svpwm(SFc5_mpc_svpwmInstanceStruct *chartInstance) 
{ 
} 
 
static void sf_c5_mpc_svpwm(SFc5_mpc_svpwmInstanceStruct *chartInstance) 
{ 
  int32_T c5_i0; 
  int32_T c5_i1; 
  real_T *c5_uD; 
  real_T *c5_uQ; 
  real_T *c5_iD; 
  real_T *c5_iQ; 
  real_T *c5_sinu; 
  real_T *c5_cosu; 
  real_T (*c5_Iabc)[3]; 
  real_T (*c5_Uabc)[3]; 
  c5_cosu = (real_T *)ssGetOutputPortSignal(chartInstance->S, 6); 
  c5_sinu = (real_T *)ssGetOutputPortSignal(chartInstance->S, 5); 
  c5_iQ = (real_T *)ssGetOutputPortSignal(chartInstance->S, 4); 
  c5_iD = (real_T *)ssGetOutputPortSignal(chartInstance->S, 3); 
  c5_Iabc = (real_T (*)[3])ssGetInputPortSignal(chartInstance->S, 1); 
  c5_uQ = (real_T *)ssGetOutputPortSignal(chartInstance->S, 2); 
  c5_uD = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1); 
  c5_Uabc = (real_T (*)[3])ssGetInputPortSignal(chartInstance->S, 0); 
  _sfTime_ = (real_T)ssGetT(chartInstance->S); 
  _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG, 1U, chartInstance->c5_sfEvent); 
  for (c5_i0 = 0; c5_i0 < 3; c5_i0++) { 
    _SFD_DATA_RANGE_CHECK((*c5_Uabc)[c5_i0], 0U); 
  } 
 
  _SFD_DATA_RANGE_CHECK(*c5_uD, 1U); 
  _SFD_DATA_RANGE_CHECK(*c5_uQ, 2U); 
  for (c5_i1 = 0; c5_i1 < 3; c5_i1++) { 
    _SFD_DATA_RANGE_CHECK((*c5_Iabc)[c5_i1], 3U); 
  } 
 
  _SFD_DATA_RANGE_CHECK(*c5_iD, 4U); 
  _SFD_DATA_RANGE_CHECK(*c5_iQ, 5U); 
  _SFD_DATA_RANGE_CHECK(*c5_sinu, 6U); 
  _SFD_DATA_RANGE_CHECK(*c5_cosu, 7U); 
  chartInstance->c5_sfEvent = CALL_EVENT; 
  c5_chartstep_c5_mpc_svpwm(chartInstance); 
  _SFD_CHECK_FOR_STATE_INCONSISTENCY(_mpc_svpwmMachineNumber_, 
    chartInstance->chartNumber, chartInstance->instanceNumber); 
} 
 
static void c5_chartstep_c5_mpc_svpwm(SFc5_mpc_svpwmInstanceStruct 
  *chartInstance) 
{ 
  int32_T c5_i2; 
  real_T c5_Uabc[3]; 
  int32_T c5_i3; 
  real_T c5_Iabc[3]; 
  uint32_T c5_debug_family_var_map[13]; 
  real_T c5_C3s2s[6]; 
  real_T c5_U32[2]; 
  real_T c5_I32[2]; 
  real_T c5_nargin = 2.0; 
  real_T c5_nargout = 6.0; 
  real_T c5_uD; 
  real_T c5_uQ; 
  real_T c5_iD; 
  real_T c5_iQ; 
  real_T c5_sinu; 
  real_T c5_cosu; 
  int32_T c5_i4; 
  static real_T c5_a[6] = { 0.66666666666666663, 0.0, -0.33333333333333331, 
    0.57735026918962573, -0.33333333333333331, -0.57735026918962573 }; 
 
  int32_T c5_i5; 
  real_T c5_b[3]; 
  int32_T c5_i6; 
  int32_T c5_i7; 
  int32_T c5_i8; 
  real_T c5_C[2]; 
  int32_T c5_i9; 
  int32_T c5_i10; 
  int32_T c5_i11; 
  int32_T c5_i12; 
  int32_T c5_i13; 
  int32_T c5_i14; 
  real_T c5_x; 
  real_T c5_b_x; 
  real_T c5_A; 
  real_T c5_B; 
  real_T c5_c_x; 
  real_T c5_y; 
  real_T c5_d_x; 
  real_T c5_b_y; 
  real_T c5_e_x; 
  real_T c5_f_x; 
  real_T c5_b_A; 
  real_T c5_b_B; 
  real_T c5_g_x; 
  real_T c5_c_y; 
  real_T c5_h_x; 
  real_T c5_d_y; 
  int32_T c5_i15; 
  int32_T c5_i16; 
  int32_T c5_i17; 
  int32_T c5_i18; 
  int32_T c5_i19; 
  int32_T c5_i20; 
  int32_T c5_i21; 
  int32_T c5_i22; 
  int32_T c5_i23; 
  int32_T c5_i24; 
  real_T *c5_b_uD; 
  real_T *c5_b_uQ; 
  real_T *c5_b_iD; 
  real_T *c5_b_iQ; 
  real_T *c5_b_sinu; 
  real_T *c5_b_cosu; 
  real_T (*c5_b_Iabc)[3]; 
  real_T (*c5_b_Uabc)[3]; 
  c5_b_cosu = (real_T *)ssGetOutputPortSignal(chartInstance->S, 6); 
  c5_b_sinu = (real_T *)ssGetOutputPortSignal(chartInstance->S, 5); 
  c5_b_iQ = (real_T *)ssGetOutputPortSignal(chartInstance->S, 4); 
  c5_b_iD = (real_T *)ssGetOutputPortSignal(chartInstance->S, 3); 
  c5_b_Iabc = (real_T (*)[3])ssGetInputPortSignal(chartInstance->S, 1); 
  c5_b_uQ = (real_T *)ssGetOutputPortSignal(chartInstance->S, 2); 
  c5_b_uD = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1); 
  c5_b_Uabc = (real_T (*)[3])ssGetInputPortSignal(chartInstance->S, 0); 
  _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 1U, chartInstance->c5_sfEvent); 
  for (c5_i2 = 0; c5_i2 < 3; c5_i2++) { 
    c5_Uabc[c5_i2] = (*c5_b_Uabc)[c5_i2]; 
  } 
 
  for (c5_i3 = 0; c5_i3 < 3; c5_i3++) { 
    c5_Iabc[c5_i3] = (*c5_b_Iabc)[c5_i3]; 
  } 
 
  _SFD_SYMBOL_SCOPE_PUSH_EML(0U, 13U, 13U, c5_debug_family_names, 
    c5_debug_family_var_map); 
  _SFD_SYMBOL_SCOPE_ADD_EML(c5_C3s2s, 0U, c5_d_sf_marshallOut); 
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(c5_U32, 1U, c5_c_sf_marshallOut, 
    c5_b_sf_marshallIn); 
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(c5_I32, 2U, c5_c_sf_marshallOut, 
    c5_b_sf_marshallIn); 
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c5_nargin, 3U, c5_sf_marshallOut, 
    c5_sf_marshallIn); 
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c5_nargout, 4U, c5_sf_marshallOut, 
    c5_sf_marshallIn); 
  _SFD_SYMBOL_SCOPE_ADD_EML(c5_Uabc, 5U, c5_b_sf_marshallOut); 
  _SFD_SYMBOL_SCOPE_ADD_EML(c5_Iabc, 6U, c5_b_sf_marshallOut); 
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c5_uD, 7U, c5_sf_marshallOut, 
    c5_sf_marshallIn); 
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c5_uQ, 8U, c5_sf_marshallOut, 
    c5_sf_marshallIn); 
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c5_iD, 9U, c5_sf_marshallOut, 
    c5_sf_marshallIn); 
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c5_iQ, 10U, c5_sf_marshallOut, 
    c5_sf_marshallIn); 
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c5_sinu, 11U, c5_sf_marshallOut, 
    c5_sf_marshallIn); 
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c5_cosu, 12U, c5_sf_marshallOut, 
    c5_sf_marshallIn); 
  CV_EML_FCN(0, 0); 
  _SFD_EML_CALL(0U, chartInstance->c5_sfEvent, 4); 
  for (c5_i4 = 0; c5_i4 < 6; c5_i4++) { 
    c5_C3s2s[c5_i4] = c5_a[c5_i4]; 
  } 
 
  _SFD_EML_CALL(0U, chartInstance->c5_sfEvent, 5); 
  for (c5_i5 = 0; c5_i5 < 3; c5_i5++) { 
    c5_b[c5_i5] = c5_Uabc[c5_i5]; 
  } 
 
  c5_eml_scalar_eg(chartInstance); 
  c5_eml_scalar_eg(chartInstance); 
  for (c5_i6 = 0; c5_i6 < 2; c5_i6++) { 
    c5_U32[c5_i6] = 0.0; 
  } 
 
  for (c5_i7 = 0; c5_i7 < 2; c5_i7++) { 
    c5_U32[c5_i7] = 0.0; 
  } 
 
  for (c5_i8 = 0; c5_i8 < 2; c5_i8++) { 
    c5_C[c5_i8] = c5_U32[c5_i8]; 
  } 
 
  for (c5_i9 = 0; c5_i9 < 2; c5_i9++) { 
    c5_U32[c5_i9] = c5_C[c5_i9]; 
  } 
 
  for (c5_i10 = 0; c5_i10 < 2; c5_i10++) { 
    c5_C[c5_i10] = c5_U32[c5_i10]; 
  } 
 
  for (c5_i11 = 0; c5_i11 < 2; c5_i11++) { 
    c5_U32[c5_i11] = c5_C[c5_i11]; 
  } 
 
  for (c5_i12 = 0; c5_i12 < 2; c5_i12++) { 
    c5_U32[c5_i12] = 0.0; 
    c5_i13 = 0; 
    for (c5_i14 = 0; c5_i14 < 3; c5_i14++) { 
      c5_U32[c5_i12] += c5_a[c5_i13 + c5_i12] * c5_b[c5_i14]; 
      c5_i13 += 2; 
    } 
  } 
 
  _SFD_EML_CALL(0U, chartInstance->c5_sfEvent, 6); 
  c5_uD = c5_U32[0]; 
  _SFD_EML_CALL(0U, chartInstance->c5_sfEvent, 6); 
  c5_uQ = c5_U32[1]; 
  _SFD_EML_CALL(0U, chartInstance->c5_sfEvent, 7); 
  c5_x = c5_power(chartInstance, c5_uD) + c5_power(chartInstance, c5_uQ); 
  c5_b_x = c5_x; 
  if (c5_b_x < 0.0) { 
    c5_eml_error(chartInstance); 
  } 
 
  c5_b_x = muDoubleScalarSqrt(c5_b_x); 
  c5_A = c5_uD; 
  c5_B = c5_b_x; 
  c5_c_x = c5_A; 
  c5_y = c5_B; 
  c5_d_x = c5_c_x; 
  c5_b_y = c5_y; 
  c5_cosu = c5_d_x / c5_b_y; 
  _SFD_EML_CALL(0U, chartInstance->c5_sfEvent, 8); 
  c5_e_x = c5_power(chartInstance, c5_uD) + c5_power(chartInstance, c5_uQ); 
  c5_f_x = c5_e_x; 
  if (c5_f_x < 0.0) { 
    c5_eml_error(chartInstance); 
  } 
 
  c5_f_x = muDoubleScalarSqrt(c5_f_x); 
  c5_b_A = c5_uQ; 
  c5_b_B = c5_f_x; 
  c5_g_x = c5_b_A; 
  c5_c_y = c5_b_B; 
  c5_h_x = c5_g_x; 
  c5_d_y = c5_c_y; 
  c5_sinu = c5_h_x / c5_d_y; 
  _SFD_EML_CALL(0U, chartInstance->c5_sfEvent, 11); 
  for (c5_i15 = 0; c5_i15 < 3; c5_i15++) { 
    c5_b[c5_i15] = c5_Iabc[c5_i15]; 
  } 
 
  c5_eml_scalar_eg(chartInstance); 
  c5_eml_scalar_eg(chartInstance); 
  for (c5_i16 = 0; c5_i16 < 2; c5_i16++) { 
    c5_I32[c5_i16] = 0.0; 
  } 
 
  for (c5_i17 = 0; c5_i17 < 2; c5_i17++) { 
    c5_I32[c5_i17] = 0.0; 
  } 
 
  for (c5_i18 = 0; c5_i18 < 2; c5_i18++) { 
    c5_C[c5_i18] = c5_I32[c5_i18]; 
  } 
 
  for (c5_i19 = 0; c5_i19 < 2; c5_i19++) { 
    c5_I32[c5_i19] = c5_C[c5_i19]; 
  } 
 
  for (c5_i20 = 0; c5_i20 < 2; c5_i20++) { 
    c5_C[c5_i20] = c5_I32[c5_i20]; 
  } 
 
  for (c5_i21 = 0; c5_i21 < 2; c5_i21++) { 
    c5_I32[c5_i21] = c5_C[c5_i21]; 
  } 
 
  for (c5_i22 = 0; c5_i22 < 2; c5_i22++) { 
    c5_I32[c5_i22] = 0.0; 
    c5_i23 = 0; 
    for (c5_i24 = 0; c5_i24 < 3; c5_i24++) { 
      c5_I32[c5_i22] += c5_a[c5_i23 + c5_i22] * c5_b[c5_i24]; 
      c5_i23 += 2; 
    } 
  } 
 
  _SFD_EML_CALL(0U, chartInstance->c5_sfEvent, 12); 
  c5_iD = c5_I32[0]; 
  _SFD_EML_CALL(0U, chartInstance->c5_sfEvent, 12); 
  c5_iQ = c5_I32[1]; 
  _SFD_EML_CALL(0U, chartInstance->c5_sfEvent, -12); 
  _SFD_SYMBOL_SCOPE_POP(); 
  *c5_b_uD = c5_uD; 
  *c5_b_uQ = c5_uQ; 
  *c5_b_iD = c5_iD; 
  *c5_b_iQ = c5_iQ; 
  *c5_b_sinu = c5_sinu; 
  *c5_b_cosu = c5_cosu; 
  _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 1U, chartInstance->c5_sfEvent); 
} 
 
static void initSimStructsc5_mpc_svpwm(SFc5_mpc_svpwmInstanceStruct 
  *chartInstance) 
{ 
} 
 
static void registerMessagesc5_mpc_svpwm(SFc5_mpc_svpwmInstanceStruct 
  *chartInstance) 
{ 
} 
 
static void init_script_number_translation(uint32_T c5_machineNumber, uint32_T 
  c5_chartNumber) 
{ 
} 
 
static const mxArray *c5_sf_marshallOut(void *chartInstanceVoid, void *c5_inData) 
{ 
  const mxArray *c5_mxArrayOutData = NULL; 
  real_T c5_u; 
  const mxArray *c5_y = NULL; 
  SFc5_mpc_svpwmInstanceStruct *chartInstance; 
  chartInstance = (SFc5_mpc_svpwmInstanceStruct *)chartInstanceVoid; 
  c5_mxArrayOutData = NULL; 
  c5_u = *(real_T *)c5_inData; 
  c5_y = NULL; 
  sf_mex_assign(&c5_y, sf_mex_create("y", &c5_u, 0, 0U, 0U, 0U, 0), FALSE); 
  sf_mex_assign(&c5_mxArrayOutData, c5_y, FALSE); 
  return c5_mxArrayOutData; 
} 
 
static real_T c5_emlrt_marshallIn(SFc5_mpc_svpwmInstanceStruct *chartInstance, 
  const mxArray *c5_cosu, const char_T *c5_identifier) 
{ 
  real_T c5_y; 
  emlrtMsgIdentifier c5_thisId; 
  c5_thisId.fIdentifier = c5_identifier; 
  c5_thisId.fParent = NULL; 
  c5_y = c5_b_emlrt_marshallIn(chartInstance, sf_mex_dup(c5_cosu), &c5_thisId); 
  sf_mex_destroy(&c5_cosu); 
  return c5_y; 
} 
 
static real_T c5_b_emlrt_marshallIn(SFc5_mpc_svpwmInstanceStruct *chartInstance, 
  const mxArray *c5_u, const emlrtMsgIdentifier *c5_parentId) 
{ 
  real_T c5_y; 
  real_T c5_d0; 
  sf_mex_import(c5_parentId, sf_mex_dup(c5_u), &c5_d0, 1, 0, 0U, 0, 0U, 0); 
  c5_y = c5_d0; 
  sf_mex_destroy(&c5_u); 
  return c5_y; 
} 
 
static void c5_sf_marshallIn(void *chartInstanceVoid, const mxArray 
  *c5_mxArrayInData, const char_T *c5_varName, void *c5_outData) 
{ 
  const mxArray *c5_cosu; 
  const char_T *c5_identifier; 
  emlrtMsgIdentifier c5_thisId; 
  real_T c5_y; 
  SFc5_mpc_svpwmInstanceStruct *chartInstance; 
  chartInstance = (SFc5_mpc_svpwmInstanceStruct *)chartInstanceVoid; 
  c5_cosu = sf_mex_dup(c5_mxArrayInData); 
  c5_identifier = c5_varName; 
  c5_thisId.fIdentifier = c5_identifier; 
  c5_thisId.fParent = NULL; 
  c5_y = c5_b_emlrt_marshallIn(chartInstance, sf_mex_dup(c5_cosu), &c5_thisId); 
  sf_mex_destroy(&c5_cosu); 
  *(real_T *)c5_outData = c5_y; 
  sf_mex_destroy(&c5_mxArrayInData); 
} 
 
static const mxArray *c5_b_sf_marshallOut(void *chartInstanceVoid, void 
  *c5_inData) 
{ 
  const mxArray *c5_mxArrayOutData = NULL; 
  int32_T c5_i25; 
  real_T c5_b_inData[3]; 
  int32_T c5_i26; 
  real_T c5_u[3]; 
  const mxArray *c5_y = NULL; 
  SFc5_mpc_svpwmInstanceStruct *chartInstance; 
  chartInstance = (SFc5_mpc_svpwmInstanceStruct *)chartInstanceVoid; 
  c5_mxArrayOutData = NULL; 
  for (c5_i25 = 0; c5_i25 < 3; c5_i25++) { 
    c5_b_inData[c5_i25] = (*(real_T (*)[3])c5_inData)[c5_i25]; 
  } 
 
  for (c5_i26 = 0; c5_i26 < 3; c5_i26++) { 
    c5_u[c5_i26] = c5_b_inData[c5_i26]; 
  } 
 
  c5_y = NULL; 
  sf_mex_assign(&c5_y, sf_mex_create("y", c5_u, 0, 0U, 1U, 0U, 1, 3), FALSE); 
  sf_mex_assign(&c5_mxArrayOutData, c5_y, FALSE); 
  return c5_mxArrayOutData; 
} 
 
static const mxArray *c5_c_sf_marshallOut(void *chartInstanceVoid, void 
  *c5_inData) 
{ 
  const mxArray *c5_mxArrayOutData = NULL; 
  int32_T c5_i27; 
  real_T c5_b_inData[2]; 
  int32_T c5_i28; 
  real_T c5_u[2]; 
  const mxArray *c5_y = NULL; 
  SFc5_mpc_svpwmInstanceStruct *chartInstance; 
  chartInstance = (SFc5_mpc_svpwmInstanceStruct *)chartInstanceVoid; 
  c5_mxArrayOutData = NULL; 
  for (c5_i27 = 0; c5_i27 < 2; c5_i27++) { 
    c5_b_inData[c5_i27] = (*(real_T (*)[2])c5_inData)[c5_i27]; 
  } 
 
  for (c5_i28 = 0; c5_i28 < 2; c5_i28++) { 
    c5_u[c5_i28] = c5_b_inData[c5_i28]; 
  } 
 
  c5_y = NULL; 
  sf_mex_assign(&c5_y, sf_mex_create("y", c5_u, 0, 0U, 1U, 0U, 1, 2), FALSE); 
  sf_mex_assign(&c5_mxArrayOutData, c5_y, FALSE); 
  return c5_mxArrayOutData; 
} 
 
static void c5_c_emlrt_marshallIn(SFc5_mpc_svpwmInstanceStruct *chartInstance, 
  const mxArray *c5_u, const emlrtMsgIdentifier *c5_parentId, real_T c5_y[2]) 
{ 
  real_T c5_dv0[2]; 
  int32_T c5_i29; 
  sf_mex_import(c5_parentId, sf_mex_dup(c5_u), c5_dv0, 1, 0, 0U, 1, 0U, 1, 2); 
  for (c5_i29 = 0; c5_i29 < 2; c5_i29++) { 
    c5_y[c5_i29] = c5_dv0[c5_i29]; 
  } 
 
  sf_mex_destroy(&c5_u); 
} 
 
static void c5_b_sf_marshallIn(void *chartInstanceVoid, const mxArray 
  *c5_mxArrayInData, const char_T *c5_varName, void *c5_outData) 
{ 
  const mxArray *c5_I32; 
  const char_T *c5_identifier; 
  emlrtMsgIdentifier c5_thisId; 
  real_T c5_y[2]; 
  int32_T c5_i30; 
  SFc5_mpc_svpwmInstanceStruct *chartInstance; 
  chartInstance = (SFc5_mpc_svpwmInstanceStruct *)chartInstanceVoid; 
  c5_I32 = sf_mex_dup(c5_mxArrayInData); 
  c5_identifier = c5_varName; 
  c5_thisId.fIdentifier = c5_identifier; 
  c5_thisId.fParent = NULL; 
  c5_c_emlrt_marshallIn(chartInstance, sf_mex_dup(c5_I32), &c5_thisId, c5_y); 
  sf_mex_destroy(&c5_I32); 
  for (c5_i30 = 0; c5_i30 < 2; c5_i30++) { 
    (*(real_T (*)[2])c5_outData)[c5_i30] = c5_y[c5_i30]; 
  } 
 
  sf_mex_destroy(&c5_mxArrayInData); 
} 
 
static const mxArray *c5_d_sf_marshallOut(void *chartInstanceVoid, void 
  *c5_inData) 
{ 
  const mxArray *c5_mxArrayOutData = NULL; 
  int32_T c5_i31; 
  int32_T c5_i32; 
  int32_T c5_i33; 
  real_T c5_b_inData[6]; 
  int32_T c5_i34; 
  int32_T c5_i35; 
  int32_T c5_i36; 
  real_T c5_u[6]; 
  const mxArray *c5_y = NULL; 
  SFc5_mpc_svpwmInstanceStruct *chartInstance; 
  chartInstance = (SFc5_mpc_svpwmInstanceStruct *)chartInstanceVoid; 
  c5_mxArrayOutData = NULL; 
  c5_i31 = 0; 
  for (c5_i32 = 0; c5_i32 < 3; c5_i32++) { 
    for (c5_i33 = 0; c5_i33 < 2; c5_i33++) { 
      c5_b_inData[c5_i33 + c5_i31] = (*(real_T (*)[6])c5_inData)[c5_i33 + c5_i31]; 
    } 
 
    c5_i31 += 2; 
  } 
 
  c5_i34 = 0; 
  for (c5_i35 = 0; c5_i35 < 3; c5_i35++) { 
    for (c5_i36 = 0; c5_i36 < 2; c5_i36++) { 
      c5_u[c5_i36 + c5_i34] = c5_b_inData[c5_i36 + c5_i34]; 
    } 
 
    c5_i34 += 2; 
  } 
 
  c5_y = NULL; 
  sf_mex_assign(&c5_y, sf_mex_create("y", c5_u, 0, 0U, 1U, 0U, 2, 2, 3), FALSE); 
  sf_mex_assign(&c5_mxArrayOutData, c5_y, FALSE); 
  return c5_mxArrayOutData; 
} 
 
const mxArray *sf_c5_mpc_svpwm_get_eml_resolved_functions_info(void) 
{ 
  const mxArray *c5_nameCaptureInfo; 
  c5_ResolvedFunctionInfo c5_info[23]; 
  const mxArray *c5_m0 = NULL; 
  int32_T c5_i37; 
  c5_ResolvedFunctionInfo *c5_r0; 
  c5_nameCaptureInfo = NULL; 
  c5_nameCaptureInfo = NULL; 
  c5_info_helper(c5_info); 
  sf_mex_assign(&c5_m0, sf_mex_createstruct("nameCaptureInfo", 1, 23), FALSE); 
  for (c5_i37 = 0; c5_i37 < 23; c5_i37++) { 
    c5_r0 = &c5_info[c5_i37]; 
    sf_mex_addfield(c5_m0, sf_mex_create("nameCaptureInfo", c5_r0->context, 15, 
      0U, 0U, 0U, 2, 1, strlen(c5_r0->context)), "context", "nameCaptureInfo", 
                    c5_i37); 
    sf_mex_addfield(c5_m0, sf_mex_create("nameCaptureInfo", c5_r0->name, 15, 0U, 
      0U, 0U, 2, 1, strlen(c5_r0->name)), "name", "nameCaptureInfo", c5_i37); 
    sf_mex_addfield(c5_m0, sf_mex_create("nameCaptureInfo", c5_r0->dominantType, 
      15, 0U, 0U, 0U, 2, 1, strlen(c5_r0->dominantType)), "dominantType", 
                    "nameCaptureInfo", c5_i37); 
    sf_mex_addfield(c5_m0, sf_mex_create("nameCaptureInfo", c5_r0->resolved, 15, 
      0U, 0U, 0U, 2, 1, strlen(c5_r0->resolved)), "resolved", "nameCaptureInfo", 
                    c5_i37); 
    sf_mex_addfield(c5_m0, sf_mex_create("nameCaptureInfo", &c5_r0->fileTimeLo, 
      7, 0U, 0U, 0U, 0), "fileTimeLo", "nameCaptureInfo", c5_i37); 
    sf_mex_addfield(c5_m0, sf_mex_create("nameCaptureInfo", &c5_r0->fileTimeHi, 
      7, 0U, 0U, 0U, 0), "fileTimeHi", "nameCaptureInfo", c5_i37); 
    sf_mex_addfield(c5_m0, sf_mex_create("nameCaptureInfo", &c5_r0->mFileTimeLo, 
      7, 0U, 0U, 0U, 0), "mFileTimeLo", "nameCaptureInfo", c5_i37); 
    sf_mex_addfield(c5_m0, sf_mex_create("nameCaptureInfo", &c5_r0->mFileTimeHi, 
      7, 0U, 0U, 0U, 0), "mFileTimeHi", "nameCaptureInfo", c5_i37); 
  } 
 
  sf_mex_assign(&c5_nameCaptureInfo, c5_m0, FALSE); 
  sf_mex_emlrtNameCapturePostProcessR2012a(&c5_nameCaptureInfo); 
  return c5_nameCaptureInfo; 
} 
 
static void c5_info_helper(c5_ResolvedFunctionInfo c5_info[23]) 
{ 
  c5_info[0].context = ""; 
  c5_info[0].name = "mrdivide"; 
  c5_info[0].dominantType = "double"; 
  c5_info[0].resolved = 
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/mrdivide.p"; 
  c5_info[0].fileTimeLo = 1357926348U; 
  c5_info[0].fileTimeHi = 0U; 
  c5_info[0].mFileTimeLo = 1319708366U; 
  c5_info[0].mFileTimeHi = 0U; 
  c5_info[1].context = 
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/mrdivide.p"; 
  c5_info[1].name = "rdivide"; 
  c5_info[1].dominantType = "double"; 
  c5_info[1].resolved = 
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/rdivide.m"; 
  c5_info[1].fileTimeLo = 1346488788U; 
  c5_info[1].fileTimeHi = 0U; 
  c5_info[1].mFileTimeLo = 0U; 
  c5_info[1].mFileTimeHi = 0U; 
  c5_info[2].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/rdivide.m"; 
  c5_info[2].name = "eml_scalexp_compatible"; 
  c5_info[2].dominantType = "double"; 
  c5_info[2].resolved = 
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_scalexp_compatible.m"; 
  c5_info[2].fileTimeLo = 1286797196U; 
  c5_info[2].fileTimeHi = 0U; 
  c5_info[2].mFileTimeLo = 0U; 
  c5_info[2].mFileTimeHi = 0U; 
  c5_info[3].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/rdivide.m"; 
  c5_info[3].name = "eml_div"; 
  c5_info[3].dominantType = "double"; 
  c5_info[3].resolved = 
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_div.m"; 
  c5_info[3].fileTimeLo = 1313326210U; 
  c5_info[3].fileTimeHi = 0U; 
  c5_info[3].mFileTimeLo = 0U; 
  c5_info[3].mFileTimeHi = 0U; 
  c5_info[4].context = ""; 
  c5_info[4].name = "sqrt"; 
  c5_info[4].dominantType = "double"; 
  c5_info[4].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elfun/sqrt.m"; 
  c5_info[4].fileTimeLo = 1343808786U; 
  c5_info[4].fileTimeHi = 0U; 
  c5_info[4].mFileTimeLo = 0U; 
  c5_info[4].mFileTimeHi = 0U; 
  c5_info[5].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elfun/sqrt.m"; 
  c5_info[5].name = "eml_error"; 
  c5_info[5].dominantType = "char"; 
  c5_info[5].resolved = 
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_error.m"; 
  c5_info[5].fileTimeLo = 1343808758U; 
  c5_info[5].fileTimeHi = 0U; 
  c5_info[5].mFileTimeLo = 0U; 
  c5_info[5].mFileTimeHi = 0U; 
  c5_info[6].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elfun/sqrt.m"; 
  c5_info[6].name = "eml_scalar_sqrt"; 
  c5_info[6].dominantType = "double"; 
  c5_info[6].resolved = 
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elfun/eml_scalar_sqrt.m"; 
  c5_info[6].fileTimeLo = 1286797138U; 
  c5_info[6].fileTimeHi = 0U; 
  c5_info[6].mFileTimeLo = 0U; 
  c5_info[6].mFileTimeHi = 0U; 
  c5_info[7].context = ""; 
  c5_info[7].name = "mtimes"; 
  c5_info[7].dominantType = "double"; 
  c5_info[7].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/mtimes.m"; 
  c5_info[7].fileTimeLo = 1289494492U; 
  c5_info[7].fileTimeHi = 0U; 
  c5_info[7].mFileTimeLo = 0U; 
  c5_info[7].mFileTimeHi = 0U; 
  c5_info[8].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/mtimes.m"; 
  c5_info[8].name = "eml_index_class"; 
  c5_info[8].dominantType = ""; 
  c5_info[8].resolved = 
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_index_class.m"; 
  c5_info[8].fileTimeLo = 1323145378U; 
  c5_info[8].fileTimeHi = 0U; 
  c5_info[8].mFileTimeLo = 0U; 
  c5_info[8].mFileTimeHi = 0U; 
  c5_info[9].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/mtimes.m"; 
  c5_info[9].name = "eml_scalar_eg"; 
  c5_info[9].dominantType = "double"; 
  c5_info[9].resolved = 
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_scalar_eg.m"; 
  c5_info[9].fileTimeLo = 1286797196U; 
  c5_info[9].fileTimeHi = 0U; 
  c5_info[9].mFileTimeLo = 0U; 
  c5_info[9].mFileTimeHi = 0U; 
  c5_info[10].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/mtimes.m"; 
  c5_info[10].name = "eml_xgemm"; 
  c5_info[10].dominantType = "char"; 
  c5_info[10].resolved = 
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/eml_xgemm.m"; 
  c5_info[10].fileTimeLo = 1299051572U; 
  c5_info[10].fileTimeHi = 0U; 
  c5_info[10].mFileTimeLo = 0U; 
  c5_info[10].mFileTimeHi = 0U; 
  c5_info[11].context = 
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/eml_xgemm.m"; 
  c5_info[11].name = "eml_blas_inline"; 
  c5_info[11].dominantType = ""; 
  c5_info[11].resolved = 
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/eml_blas_inline.m"; 
  c5_info[11].fileTimeLo = 1299051568U; 
  c5_info[11].fileTimeHi = 0U; 
  c5_info[11].mFileTimeLo = 0U; 
  c5_info[11].mFileTimeHi = 0U; 
  c5_info[12].context = 
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/external/eml_blas_xgemm.m!below_threshold"; 
  c5_info[12].name = "mtimes"; 
  c5_info[12].dominantType = "double"; 
  c5_info[12].resolved = 
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/mtimes.m"; 
  c5_info[12].fileTimeLo = 1289494492U; 
  c5_info[12].fileTimeHi = 0U; 
  c5_info[12].mFileTimeLo = 0U; 
  c5_info[12].mFileTimeHi = 0U; 
  c5_info[13].context = 
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/external/eml_blas_xgemm.m"; 
  c5_info[13].name = "eml_index_class"; 
  c5_info[13].dominantType = ""; 
  c5_info[13].resolved = 
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_index_class.m"; 
  c5_info[13].fileTimeLo = 1323145378U; 
  c5_info[13].fileTimeHi = 0U; 
  c5_info[13].mFileTimeLo = 0U; 
  c5_info[13].mFileTimeHi = 0U; 
  c5_info[14].context = 
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/external/eml_blas_xgemm.m"; 
  c5_info[14].name = "eml_scalar_eg"; 
  c5_info[14].dominantType = "double"; 
  c5_info[14].resolved = 
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_scalar_eg.m"; 
  c5_info[14].fileTimeLo = 1286797196U; 
  c5_info[14].fileTimeHi = 0U; 
  c5_info[14].mFileTimeLo = 0U; 
  c5_info[14].mFileTimeHi = 0U; 
  c5_info[15].context = 
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/external/eml_blas_xgemm.m"; 
  c5_info[15].name = "eml_refblas_xgemm"; 
  c5_info[15].dominantType = "char"; 
  c5_info[15].resolved = 
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/refblas/eml_refblas_xgemm.m"; 
  c5_info[15].fileTimeLo = 1299051574U; 
  c5_info[15].fileTimeHi = 0U; 
  c5_info[15].mFileTimeLo = 0U; 
  c5_info[15].mFileTimeHi = 0U; 
  c5_info[16].context = ""; 
  c5_info[16].name = "power"; 
  c5_info[16].dominantType = "double"; 
  c5_info[16].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/power.m"; 
  c5_info[16].fileTimeLo = 1348170330U; 
  c5_info[16].fileTimeHi = 0U; 
  c5_info[16].mFileTimeLo = 0U; 
  c5_info[16].mFileTimeHi = 0U; 
  c5_info[17].context = 
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/power.m!fltpower"; 
  c5_info[17].name = "eml_scalar_eg"; 
  c5_info[17].dominantType = "double"; 
  c5_info[17].resolved = 
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_scalar_eg.m"; 
  c5_info[17].fileTimeLo = 1286797196U; 
  c5_info[17].fileTimeHi = 0U; 
  c5_info[17].mFileTimeLo = 0U; 
  c5_info[17].mFileTimeHi = 0U; 
  c5_info[18].context = 
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/power.m!fltpower"; 
  c5_info[18].name = "eml_scalexp_alloc"; 
  c5_info[18].dominantType = "double"; 
  c5_info[18].resolved = 
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_scalexp_alloc.m"; 
  c5_info[18].fileTimeLo = 1352399660U; 
  c5_info[18].fileTimeHi = 0U; 
  c5_info[18].mFileTimeLo = 0U; 
  c5_info[18].mFileTimeHi = 0U; 
  c5_info[19].context = 
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/power.m!fltpower"; 
  c5_info[19].name = "floor"; 
  c5_info[19].dominantType = "double"; 
  c5_info[19].resolved = 
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elfun/floor.m"; 
  c5_info[19].fileTimeLo = 1343808780U; 
  c5_info[19].fileTimeHi = 0U; 
  c5_info[19].mFileTimeLo = 0U; 
  c5_info[19].mFileTimeHi = 0U; 
  c5_info[20].context = 
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elfun/floor.m"; 
  c5_info[20].name = "eml_scalar_floor"; 
  c5_info[20].dominantType = "double"; 
  c5_info[20].resolved = 
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elfun/eml_scalar_floor.m"; 
  c5_info[20].fileTimeLo = 1286797126U; 
  c5_info[20].fileTimeHi = 0U; 
  c5_info[20].mFileTimeLo = 0U; 
  c5_info[20].mFileTimeHi = 0U; 
  c5_info[21].context = 
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/power.m!scalar_float_power"; 
  c5_info[21].name = "eml_scalar_eg"; 
  c5_info[21].dominantType = "double"; 
  c5_info[21].resolved = 
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_scalar_eg.m"; 
  c5_info[21].fileTimeLo = 1286797196U; 
  c5_info[21].fileTimeHi = 0U; 
  c5_info[21].mFileTimeLo = 0U; 
  c5_info[21].mFileTimeHi = 0U; 
  c5_info[22].context = 
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/power.m!scalar_float_power"; 
  c5_info[22].name = "mtimes"; 
  c5_info[22].dominantType = "double"; 
  c5_info[22].resolved = 
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/mtimes.m"; 
  c5_info[22].fileTimeLo = 1289494492U; 
  c5_info[22].fileTimeHi = 0U; 
  c5_info[22].mFileTimeLo = 0U; 
  c5_info[22].mFileTimeHi = 0U; 
} 
 
static void c5_eml_error(SFc5_mpc_svpwmInstanceStruct *chartInstance) 
{ 
  int32_T c5_i38; 
  static char_T c5_cv0[30] = { 'C', 'o', 'd', 'e', 'r', ':', 't', 'o', 'o', 'l', 
    'b', 'o', 'x', ':', 'E', 'l', 'F', 'u', 'n', 'D', 'o', 'm', 'a', 'i', 'n', 
    'E', 'r', 'r', 'o', 'r' }; 
 
  char_T c5_u[30]; 
  const mxArray *c5_y = NULL; 
  int32_T c5_i39; 
  static char_T c5_cv1[4] = { 's', 'q', 'r', 't' }; 
 
  char_T c5_b_u[4]; 
  const mxArray *c5_b_y = NULL; 
  for (c5_i38 = 0; c5_i38 < 30; c5_i38++) { 
    c5_u[c5_i38] = c5_cv0[c5_i38]; 
  } 
 
  c5_y = NULL; 
  sf_mex_assign(&c5_y, sf_mex_create("y", c5_u, 10, 0U, 1U, 0U, 2, 1, 30), FALSE); 
  for (c5_i39 = 0; c5_i39 < 4; c5_i39++) { 
    c5_b_u[c5_i39] = c5_cv1[c5_i39]; 
  } 
 
  c5_b_y = NULL; 
  sf_mex_assign(&c5_b_y, sf_mex_create("y", c5_b_u, 10, 0U, 1U, 0U, 2, 1, 4), 
                FALSE); 
  sf_mex_call_debug("error", 0U, 1U, 14, sf_mex_call_debug("message", 1U, 2U, 14, 
    c5_y, 14, c5_b_y)); 
} 
 
static void c5_eml_scalar_eg(SFc5_mpc_svpwmInstanceStruct *chartInstance) 
{ 
} 
 
static real_T c5_power(SFc5_mpc_svpwmInstanceStruct *chartInstance, real_T c5_a) 
{ 
  real_T c5_b_a; 
  real_T c5_ak; 
  real_T c5_c_a; 
  real_T c5_d_a; 
  real_T c5_b; 
  c5_b_a = c5_a; 
  c5_b_eml_scalar_eg(chartInstance); 
  c5_ak = c5_b_a; 
  c5_c_a = c5_ak; 
  c5_b_eml_scalar_eg(chartInstance); 
  c5_d_a = c5_c_a; 
  c5_b = c5_c_a; 
  return c5_d_a * c5_b; 
} 
 
static void c5_b_eml_scalar_eg(SFc5_mpc_svpwmInstanceStruct *chartInstance) 
{ 
} 
 
static const mxArray *c5_e_sf_marshallOut(void *chartInstanceVoid, void 
  *c5_inData) 
{ 
  const mxArray *c5_mxArrayOutData = NULL; 
  int32_T c5_u; 
  const mxArray *c5_y = NULL; 
  SFc5_mpc_svpwmInstanceStruct *chartInstance; 
  chartInstance = (SFc5_mpc_svpwmInstanceStruct *)chartInstanceVoid; 
  c5_mxArrayOutData = NULL; 
  c5_u = *(int32_T *)c5_inData; 
  c5_y = NULL; 
  sf_mex_assign(&c5_y, sf_mex_create("y", &c5_u, 6, 0U, 0U, 0U, 0), FALSE); 
  sf_mex_assign(&c5_mxArrayOutData, c5_y, FALSE); 
  return c5_mxArrayOutData; 
} 
 
static int32_T c5_d_emlrt_marshallIn(SFc5_mpc_svpwmInstanceStruct *chartInstance, 
  const mxArray *c5_u, const emlrtMsgIdentifier *c5_parentId) 
{ 
  int32_T c5_y; 
  int32_T c5_i40; 
  sf_mex_import(c5_parentId, sf_mex_dup(c5_u), &c5_i40, 1, 6, 0U, 0, 0U, 0); 
  c5_y = c5_i40; 
  sf_mex_destroy(&c5_u); 
  return c5_y; 
} 
 
static void c5_c_sf_marshallIn(void *chartInstanceVoid, const mxArray 
  *c5_mxArrayInData, const char_T *c5_varName, void *c5_outData) 
{ 
  const mxArray *c5_b_sfEvent; 
  const char_T *c5_identifier; 
  emlrtMsgIdentifier c5_thisId; 
  int32_T c5_y; 
  SFc5_mpc_svpwmInstanceStruct *chartInstance; 
  chartInstance = (SFc5_mpc_svpwmInstanceStruct *)chartInstanceVoid; 
  c5_b_sfEvent = sf_mex_dup(c5_mxArrayInData); 
  c5_identifier = c5_varName; 
  c5_thisId.fIdentifier = c5_identifier; 
  c5_thisId.fParent = NULL; 
  c5_y = c5_d_emlrt_marshallIn(chartInstance, sf_mex_dup(c5_b_sfEvent), 
    &c5_thisId); 
  sf_mex_destroy(&c5_b_sfEvent); 
  *(int32_T *)c5_outData = c5_y; 
  sf_mex_destroy(&c5_mxArrayInData); 
} 
 
static uint8_T c5_e_emlrt_marshallIn(SFc5_mpc_svpwmInstanceStruct *chartInstance, 
  const mxArray *c5_b_is_active_c5_mpc_svpwm, const char_T *c5_identifier) 
{ 
  uint8_T c5_y; 
  emlrtMsgIdentifier c5_thisId; 
  c5_thisId.fIdentifier = c5_identifier; 
  c5_thisId.fParent = NULL; 
  c5_y = c5_f_emlrt_marshallIn(chartInstance, sf_mex_dup 
    (c5_b_is_active_c5_mpc_svpwm), &c5_thisId); 
  sf_mex_destroy(&c5_b_is_active_c5_mpc_svpwm); 
  return c5_y; 
} 
 
static uint8_T c5_f_emlrt_marshallIn(SFc5_mpc_svpwmInstanceStruct *chartInstance, 
  const mxArray *c5_u, const emlrtMsgIdentifier *c5_parentId) 
{ 
  uint8_T c5_y; 
  uint8_T c5_u0; 
  sf_mex_import(c5_parentId, sf_mex_dup(c5_u), &c5_u0, 1, 3, 0U, 0, 0U, 0); 
  c5_y = c5_u0; 
  sf_mex_destroy(&c5_u); 
  return c5_y; 
} 
 
static void init_dsm_address_info(SFc5_mpc_svpwmInstanceStruct *chartInstance) 
{ 
} 
 
/* SFunction Glue Code */ 
#ifdef utFree 
#undef utFree 
#endif 
 
#ifdef utMalloc 
#undef utMalloc 
#endif 
 
#ifdef __cplusplus 
 
extern "C" void *utMalloc(size_t size); 
extern "C" void utFree(void*); 
 
#else 
 
extern void *utMalloc(size_t size); 
extern void utFree(void*); 
 
#endif 
 
void sf_c5_mpc_svpwm_get_check_sum(mxArray *plhs[]) 
{ 
  ((real_T *)mxGetPr((plhs[0])))[0] = (real_T)(950222572U); 
  ((real_T *)mxGetPr((plhs[0])))[1] = (real_T)(3134416558U); 
  ((real_T *)mxGetPr((plhs[0])))[2] = (real_T)(1396207966U); 
  ((real_T *)mxGetPr((plhs[0])))[3] = (real_T)(804366100U); 
} 
 
mxArray *sf_c5_mpc_svpwm_get_autoinheritance_info(void) 
{ 
  const char *autoinheritanceFields[] = { "checksum", "inputs", "parameters", 
    "outputs", "locals" }; 
 
  mxArray *mxAutoinheritanceInfo = mxCreateStructMatrix(1,1,5, 
    autoinheritanceFields); 
 
  { 
    mxArray *mxChecksum = mxCreateString("mao8JoZ2h9oEYN5CG4IgXF"); 
    mxSetField(mxAutoinheritanceInfo,0,"checksum",mxChecksum); 
  } 
 
  { 
    const char *dataFields[] = { "size", "type", "complexity" }; 
 
    mxArray *mxData = mxCreateStructMatrix(1,2,3,dataFields); 
 
    { 
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL); 
      double *pr = mxGetPr(mxSize); 
      pr[0] = (double)(3); 
      pr[1] = (double)(1); 
      mxSetField(mxData,0,"size",mxSize); 
    } 
 
    { 
      const char *typeFields[] = { "base", "fixpt" }; 
 
      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields); 
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10)); 
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL)); 
      mxSetField(mxData,0,"type",mxType); 
    } 
 
    mxSetField(mxData,0,"complexity",mxCreateDoubleScalar(0)); 
 
    { 
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL); 
      double *pr = mxGetPr(mxSize); 
      pr[0] = (double)(3); 
      pr[1] = (double)(1); 
      mxSetField(mxData,1,"size",mxSize); 
    } 
 
    { 
      const char *typeFields[] = { "base", "fixpt" }; 
 
      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields); 
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10)); 
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL)); 
      mxSetField(mxData,1,"type",mxType); 
    } 
 
    mxSetField(mxData,1,"complexity",mxCreateDoubleScalar(0)); 
    mxSetField(mxAutoinheritanceInfo,0,"inputs",mxData); 
  } 
 
  { 
    mxSetField(mxAutoinheritanceInfo,0,"parameters",mxCreateDoubleMatrix(0,0, 
                mxREAL)); 
  } 
 
  { 
    const char *dataFields[] = { "size", "type", "complexity" }; 
 
    mxArray *mxData = mxCreateStructMatrix(1,6,3,dataFields); 
 
    { 
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL); 
      double *pr = mxGetPr(mxSize); 
      pr[0] = (double)(1); 
      pr[1] = (double)(1); 
      mxSetField(mxData,0,"size",mxSize); 
    } 
 
    { 
      const char *typeFields[] = { "base", "fixpt" }; 
 
      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields); 
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10)); 
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL)); 
      mxSetField(mxData,0,"type",mxType); 
    } 
 
    mxSetField(mxData,0,"complexity",mxCreateDoubleScalar(0)); 
 
    { 
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL); 
      double *pr = mxGetPr(mxSize); 
      pr[0] = (double)(1); 
      pr[1] = (double)(1); 
      mxSetField(mxData,1,"size",mxSize); 
    } 
 
    { 
      const char *typeFields[] = { "base", "fixpt" }; 
 
      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields); 
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10)); 
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL)); 
      mxSetField(mxData,1,"type",mxType); 
    } 
 
    mxSetField(mxData,1,"complexity",mxCreateDoubleScalar(0)); 
 
    { 
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL); 
      double *pr = mxGetPr(mxSize); 
      pr[0] = (double)(1); 
      pr[1] = (double)(1); 
      mxSetField(mxData,2,"size",mxSize); 
    } 
 
    { 
      const char *typeFields[] = { "base", "fixpt" }; 
 
      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields); 
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10)); 
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL)); 
      mxSetField(mxData,2,"type",mxType); 
    } 
 
    mxSetField(mxData,2,"complexity",mxCreateDoubleScalar(0)); 
 
    { 
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL); 
      double *pr = mxGetPr(mxSize); 
      pr[0] = (double)(1); 
      pr[1] = (double)(1); 
      mxSetField(mxData,3,"size",mxSize); 
    } 
 
    { 
      const char *typeFields[] = { "base", "fixpt" }; 
 
      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields); 
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10)); 
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL)); 
      mxSetField(mxData,3,"type",mxType); 
    } 
 
    mxSetField(mxData,3,"complexity",mxCreateDoubleScalar(0)); 
 
    { 
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL); 
      double *pr = mxGetPr(mxSize); 
      pr[0] = (double)(1); 
      pr[1] = (double)(1); 
      mxSetField(mxData,4,"size",mxSize); 
    } 
 
    { 
      const char *typeFields[] = { "base", "fixpt" }; 
 
      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields); 
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10)); 
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL)); 
      mxSetField(mxData,4,"type",mxType); 
    } 
 
    mxSetField(mxData,4,"complexity",mxCreateDoubleScalar(0)); 
 
    { 
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL); 
      double *pr = mxGetPr(mxSize); 
      pr[0] = (double)(1); 
      pr[1] = (double)(1); 
      mxSetField(mxData,5,"size",mxSize); 
    } 
 
    { 
      const char *typeFields[] = { "base", "fixpt" }; 
 
      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields); 
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10)); 
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL)); 
      mxSetField(mxData,5,"type",mxType); 
    } 
 
    mxSetField(mxData,5,"complexity",mxCreateDoubleScalar(0)); 
    mxSetField(mxAutoinheritanceInfo,0,"outputs",mxData); 
  } 
 
  { 
    mxSetField(mxAutoinheritanceInfo,0,"locals",mxCreateDoubleMatrix(0,0,mxREAL)); 
  } 
 
  return(mxAutoinheritanceInfo); 
} 
 
mxArray *sf_c5_mpc_svpwm_third_party_uses_info(void) 
{ 
  mxArray * mxcell3p = mxCreateCellMatrix(1,0); 
  return(mxcell3p); 
} 
 
static const mxArray *sf_get_sim_state_info_c5_mpc_svpwm(void) 
{ 
  const char *infoFields[] = { "chartChecksum", "varInfo" }; 
 
  mxArray *mxInfo = mxCreateStructMatrix(1, 1, 2, infoFields); 
  const char *infoEncStr[] = { 
    "100 S1x7'type','srcId','name','auxInfo'{{M[1],M[17],T\"cosu\",},{M[1],M[12],T\"iD\",},{M[1],M[13],T\"iQ\",},{M[1],M[16],T\"sinu\",},{M[1],M[5],T\"uD\",},{M[1],M[6],T\"uQ\",},{M[8],M[0],T\"is_active_c5_mpc_svpwm\",}}" 
  }; 
 
  mxArray *mxVarInfo = sf_mex_decode_encoded_mx_struct_array(infoEncStr, 7, 10); 
  mxArray *mxChecksum = mxCreateDoubleMatrix(1, 4, mxREAL); 
  sf_c5_mpc_svpwm_get_check_sum(&mxChecksum); 
  mxSetField(mxInfo, 0, infoFields[0], mxChecksum); 
  mxSetField(mxInfo, 0, infoFields[1], mxVarInfo); 
  return mxInfo; 
} 
 
static void chart_debug_initialization(SimStruct *S, unsigned int 
  fullDebuggerInitialization) 
{ 
  if (!sim_mode_is_rtw_gen(S)) { 
    SFc5_mpc_svpwmInstanceStruct *chartInstance; 
    chartInstance = (SFc5_mpc_svpwmInstanceStruct *) ((ChartInfoStruct *) 
      (ssGetUserData(S)))->chartInstance; 
    if (ssIsFirstInitCond(S) && fullDebuggerInitialization==1) { 
      /* do this only if simulation is starting */ 
      { 
        unsigned int chartAlreadyPresent; 
        chartAlreadyPresent = sf_debug_initialize_chart 
          (sfGlobalDebugInstanceStruct, 
           _mpc_svpwmMachineNumber_, 
           5, 
           1, 
           1, 
           8, 
           0, 
           0, 
           0, 
           0, 
           0, 
           &(chartInstance->chartNumber), 
           &(chartInstance->instanceNumber), 
           ssGetPath(S), 
           (void *)S); 
        if (chartAlreadyPresent==0) { 
          /* this is the first instance */ 
          init_script_number_translation(_mpc_svpwmMachineNumber_, 
            chartInstance->chartNumber); 
          sf_debug_set_chart_disable_implicit_casting 
            (sfGlobalDebugInstanceStruct,_mpc_svpwmMachineNumber_, 
             chartInstance->chartNumber,1); 
          sf_debug_set_chart_event_thresholds(sfGlobalDebugInstanceStruct, 
            _mpc_svpwmMachineNumber_, 
            chartInstance->chartNumber, 
            0, 
            0, 
            0); 
          _SFD_SET_DATA_PROPS(0,1,1,0,"Uabc"); 
          _SFD_SET_DATA_PROPS(1,2,0,1,"uD"); 
          _SFD_SET_DATA_PROPS(2,2,0,1,"uQ"); 
          _SFD_SET_DATA_PROPS(3,1,1,0,"Iabc"); 
          _SFD_SET_DATA_PROPS(4,2,0,1,"iD"); 
          _SFD_SET_DATA_PROPS(5,2,0,1,"iQ"); 
          _SFD_SET_DATA_PROPS(6,2,0,1,"sinu"); 
          _SFD_SET_DATA_PROPS(7,2,0,1,"cosu"); 
          _SFD_STATE_INFO(0,0,2); 
          _SFD_CH_SUBSTATE_COUNT(0); 
          _SFD_CH_SUBSTATE_DECOMP(0); 
        } 
 
        _SFD_CV_INIT_CHART(0,0,0,0); 
 
        { 
          _SFD_CV_INIT_STATE(0,0,0,0,0,0,NULL,NULL); 
        } 
 
        _SFD_CV_INIT_TRANS(0,0,NULL,NULL,0,NULL); 
 
        /* Initialization of MATLAB Function Model Coverage */ 
        _SFD_CV_INIT_EML(0,1,1,0,0,0,0,0,0,0,0); 
        _SFD_CV_INIT_EML_FCN(0,0,"eML_blk_kernel",0,-1,305); 
        _SFD_TRANS_COV_WTS(0,0,0,1,0); 
        if (chartAlreadyPresent==0) { 
          _SFD_TRANS_COV_MAPS(0, 
                              0,NULL,NULL, 
                              0,NULL,NULL, 
                              1,NULL,NULL, 
                              0,NULL,NULL); 
        } 
 
        { 
          unsigned int dimVector[1]; 
          dimVector[0]= 3; 
          _SFD_SET_DATA_COMPILED_PROPS(0,SF_DOUBLE,1,&(dimVector[0]),0,0,0,0.0, 
            1.0,0,0,(MexFcnForType)c5_b_sf_marshallOut,(MexInFcnForType)NULL); 
        } 
 
        _SFD_SET_DATA_COMPILED_PROPS(1,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, 
          (MexFcnForType)c5_sf_marshallOut,(MexInFcnForType)c5_sf_marshallIn); 
        _SFD_SET_DATA_COMPILED_PROPS(2,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, 
          (MexFcnForType)c5_sf_marshallOut,(MexInFcnForType)c5_sf_marshallIn); 
 
        { 
          unsigned int dimVector[1]; 
          dimVector[0]= 3; 
          _SFD_SET_DATA_COMPILED_PROPS(3,SF_DOUBLE,1,&(dimVector[0]),0,0,0,0.0, 
            1.0,0,0,(MexFcnForType)c5_b_sf_marshallOut,(MexInFcnForType)NULL); 
        } 
 
        _SFD_SET_DATA_COMPILED_PROPS(4,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, 
          (MexFcnForType)c5_sf_marshallOut,(MexInFcnForType)c5_sf_marshallIn); 
        _SFD_SET_DATA_COMPILED_PROPS(5,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, 
          (MexFcnForType)c5_sf_marshallOut,(MexInFcnForType)c5_sf_marshallIn); 
        _SFD_SET_DATA_COMPILED_PROPS(6,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, 
          (MexFcnForType)c5_sf_marshallOut,(MexInFcnForType)c5_sf_marshallIn); 
        _SFD_SET_DATA_COMPILED_PROPS(7,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, 
          (MexFcnForType)c5_sf_marshallOut,(MexInFcnForType)c5_sf_marshallIn); 
 
        { 
          real_T *c5_uD; 
          real_T *c5_uQ; 
          real_T *c5_iD; 
          real_T *c5_iQ; 
          real_T *c5_sinu; 
          real_T *c5_cosu; 
          real_T (*c5_Uabc)[3]; 
          real_T (*c5_Iabc)[3]; 
          c5_cosu = (real_T *)ssGetOutputPortSignal(chartInstance->S, 6); 
          c5_sinu = (real_T *)ssGetOutputPortSignal(chartInstance->S, 5); 
          c5_iQ = (real_T *)ssGetOutputPortSignal(chartInstance->S, 4); 
          c5_iD = (real_T *)ssGetOutputPortSignal(chartInstance->S, 3); 
          c5_Iabc = (real_T (*)[3])ssGetInputPortSignal(chartInstance->S, 1); 
          c5_uQ = (real_T *)ssGetOutputPortSignal(chartInstance->S, 2); 
          c5_uD = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1); 
          c5_Uabc = (real_T (*)[3])ssGetInputPortSignal(chartInstance->S, 0); 
          _SFD_SET_DATA_VALUE_PTR(0U, *c5_Uabc); 
          _SFD_SET_DATA_VALUE_PTR(1U, c5_uD); 
          _SFD_SET_DATA_VALUE_PTR(2U, c5_uQ); 
          _SFD_SET_DATA_VALUE_PTR(3U, *c5_Iabc); 
          _SFD_SET_DATA_VALUE_PTR(4U, c5_iD); 
          _SFD_SET_DATA_VALUE_PTR(5U, c5_iQ); 
          _SFD_SET_DATA_VALUE_PTR(6U, c5_sinu); 
          _SFD_SET_DATA_VALUE_PTR(7U, c5_cosu); 
        } 
      } 
    } else { 
      sf_debug_reset_current_state_configuration(sfGlobalDebugInstanceStruct, 
        _mpc_svpwmMachineNumber_,chartInstance->chartNumber, 
        chartInstance->instanceNumber); 
    } 
  } 
} 
 
static const char* sf_get_instance_specialization(void) 
{ 
  return "frjFAb7wahwD9Gsgh132xB"; 
} 
 
static void sf_opaque_initialize_c5_mpc_svpwm(void *chartInstanceVar) 
{ 
  chart_debug_initialization(((SFc5_mpc_svpwmInstanceStruct*) chartInstanceVar 
    )->S,0); 
  initialize_params_c5_mpc_svpwm((SFc5_mpc_svpwmInstanceStruct*) 
    chartInstanceVar); 
  initialize_c5_mpc_svpwm((SFc5_mpc_svpwmInstanceStruct*) chartInstanceVar); 
} 
 
static void sf_opaque_enable_c5_mpc_svpwm(void *chartInstanceVar) 
{ 
  enable_c5_mpc_svpwm((SFc5_mpc_svpwmInstanceStruct*) chartInstanceVar); 
} 
 
static void sf_opaque_disable_c5_mpc_svpwm(void *chartInstanceVar) 
{ 
  disable_c5_mpc_svpwm((SFc5_mpc_svpwmInstanceStruct*) chartInstanceVar); 
} 
 
static void sf_opaque_gateway_c5_mpc_svpwm(void *chartInstanceVar) 
{ 
  sf_c5_mpc_svpwm((SFc5_mpc_svpwmInstanceStruct*) chartInstanceVar); 
} 
 
extern const mxArray* sf_internal_get_sim_state_c5_mpc_svpwm(SimStruct* S) 
{ 
  ChartInfoStruct *chartInfo = (ChartInfoStruct*) ssGetUserData(S); 
  mxArray *plhs[1] = { NULL }; 
 
  mxArray *prhs[4]; 
  int mxError = 0; 
  prhs[0] = mxCreateString("chart_simctx_raw2high"); 
  prhs[1] = mxCreateDoubleScalar(ssGetSFuncBlockHandle(S)); 
  prhs[2] = (mxArray*) get_sim_state_c5_mpc_svpwm((SFc5_mpc_svpwmInstanceStruct*) 
    chartInfo->chartInstance);         /* raw sim ctx */ 
  prhs[3] = (mxArray*) sf_get_sim_state_info_c5_mpc_svpwm();/* state var info */ 
  mxError = sf_mex_call_matlab(1, plhs, 4, prhs, "sfprivate"); 
  mxDestroyArray(prhs[0]); 
  mxDestroyArray(prhs[1]); 
  mxDestroyArray(prhs[2]); 
  mxDestroyArray(prhs[3]); 
  if (mxError || plhs[0] == NULL) { 
    sf_mex_error_message("Stateflow Internal Error: \nError calling 'chart_simctx_raw2high'.\n"); 
  } 
 
  return plhs[0]; 
} 
 
extern void sf_internal_set_sim_state_c5_mpc_svpwm(SimStruct* S, const mxArray 
  *st) 
{ 
  ChartInfoStruct *chartInfo = (ChartInfoStruct*) ssGetUserData(S); 
  mxArray *plhs[1] = { NULL }; 
 
  mxArray *prhs[4]; 
  int mxError = 0; 
  prhs[0] = mxCreateString("chart_simctx_high2raw"); 
  prhs[1] = mxCreateDoubleScalar(ssGetSFuncBlockHandle(S)); 
  prhs[2] = mxDuplicateArray(st);      /* high level simctx */ 
  prhs[3] = (mxArray*) sf_get_sim_state_info_c5_mpc_svpwm();/* state var info */ 
  mxError = sf_mex_call_matlab(1, plhs, 4, prhs, "sfprivate"); 
  mxDestroyArray(prhs[0]); 
  mxDestroyArray(prhs[1]); 
  mxDestroyArray(prhs[2]); 
  mxDestroyArray(prhs[3]); 
  if (mxError || plhs[0] == NULL) { 
    sf_mex_error_message("Stateflow Internal Error: \nError calling 'chart_simctx_high2raw'.\n"); 
  } 
 
  set_sim_state_c5_mpc_svpwm((SFc5_mpc_svpwmInstanceStruct*) 
    chartInfo->chartInstance, mxDuplicateArray(plhs[0])); 
  mxDestroyArray(plhs[0]); 
} 
 
static const mxArray* sf_opaque_get_sim_state_c5_mpc_svpwm(SimStruct* S) 
{ 
  return sf_internal_get_sim_state_c5_mpc_svpwm(S); 
} 
 
static void sf_opaque_set_sim_state_c5_mpc_svpwm(SimStruct* S, const mxArray *st) 
{ 
  sf_internal_set_sim_state_c5_mpc_svpwm(S, st); 
} 
 
static void sf_opaque_terminate_c5_mpc_svpwm(void *chartInstanceVar) 
{ 
  if (chartInstanceVar!=NULL) { 
    SimStruct *S = ((SFc5_mpc_svpwmInstanceStruct*) chartInstanceVar)->S; 
    if (sim_mode_is_rtw_gen(S) || sim_mode_is_external(S)) { 
      sf_clear_rtw_identifier(S); 
      unload_mpc_svpwm_optimization_info(); 
    } 
 
    finalize_c5_mpc_svpwm((SFc5_mpc_svpwmInstanceStruct*) chartInstanceVar); 
    utFree((void *)chartInstanceVar); 
    ssSetUserData(S,NULL); 
  } 
} 
 
static void sf_opaque_init_subchart_simstructs(void *chartInstanceVar) 
{ 
  initSimStructsc5_mpc_svpwm((SFc5_mpc_svpwmInstanceStruct*) chartInstanceVar); 
} 
 
extern unsigned int sf_machine_global_initializer_called(void); 
static void mdlProcessParameters_c5_mpc_svpwm(SimStruct *S) 
{ 
  int i; 
  for (i=0;i<ssGetNumRunTimeParams(S);i++) { 
    if (ssGetSFcnParamTunable(S,i)) { 
      ssUpdateDlgParamAsRunTimeParam(S,i); 
    } 
  } 
 
  if (sf_machine_global_initializer_called()) { 
    initialize_params_c5_mpc_svpwm((SFc5_mpc_svpwmInstanceStruct*) 
      (((ChartInfoStruct *)ssGetUserData(S))->chartInstance)); 
  } 
} 
 
static void mdlSetWorkWidths_c5_mpc_svpwm(SimStruct *S) 
{ 
  if (sim_mode_is_rtw_gen(S) || sim_mode_is_external(S)) { 
    mxArray *infoStruct = load_mpc_svpwm_optimization_info(); 
    int_T chartIsInlinable = 
      (int_T)sf_is_chart_inlinable(S,sf_get_instance_specialization(),infoStruct, 
      5); 
    ssSetStateflowIsInlinable(S,chartIsInlinable); 
    ssSetRTWCG(S,sf_rtw_info_uint_prop(S,sf_get_instance_specialization(), 
                infoStruct,5,"RTWCG")); 
    ssSetEnableFcnIsTrivial(S,1); 
    ssSetDisableFcnIsTrivial(S,1); 
    ssSetNotMultipleInlinable(S,sf_rtw_info_uint_prop(S, 
      sf_get_instance_specialization(),infoStruct,5, 
      "gatewayCannotBeInlinedMultipleTimes")); 
    sf_update_buildInfo(S,sf_get_instance_specialization(),infoStruct,5); 
    if (chartIsInlinable) { 
      ssSetInputPortOptimOpts(S, 0, SS_REUSABLE_AND_LOCAL); 
      ssSetInputPortOptimOpts(S, 1, SS_REUSABLE_AND_LOCAL); 
      sf_mark_chart_expressionable_inputs(S,sf_get_instance_specialization(), 
        infoStruct,5,2); 
      sf_mark_chart_reusable_outputs(S,sf_get_instance_specialization(), 
        infoStruct,5,6); 
    } 
 
    { 
      unsigned int outPortIdx; 
      for (outPortIdx=1; outPortIdx<=6; ++outPortIdx) { 
        ssSetOutputPortOptimizeInIR(S, outPortIdx, 1U); 
      } 
    } 
 
    { 
      unsigned int inPortIdx; 
      for (inPortIdx=0; inPortIdx < 2; ++inPortIdx) { 
        ssSetInputPortOptimizeInIR(S, inPortIdx, 1U); 
      } 
    } 
 
    sf_set_rtw_dwork_info(S,sf_get_instance_specialization(),infoStruct,5); 
    ssSetHasSubFunctions(S,!(chartIsInlinable)); 
  } else { 
  } 
 
  ssSetOptions(S,ssGetOptions(S)|SS_OPTION_WORKS_WITH_CODE_REUSE); 
  ssSetChecksum0(S,(2293773608U)); 
  ssSetChecksum1(S,(113741943U)); 
  ssSetChecksum2(S,(1651482789U)); 
  ssSetChecksum3(S,(1560443802U)); 
  ssSetmdlDerivatives(S, NULL); 
  ssSetExplicitFCSSCtrl(S,1); 
  ssSupportsMultipleExecInstances(S,1); 
} 
 
static void mdlRTW_c5_mpc_svpwm(SimStruct *S) 
{ 
  if (sim_mode_is_rtw_gen(S)) { 
    ssWriteRTWStrParam(S, "StateflowChartType", "Embedded MATLAB"); 
  } 
} 
 
static void mdlStart_c5_mpc_svpwm(SimStruct *S) 
{ 
  SFc5_mpc_svpwmInstanceStruct *chartInstance; 
  chartInstance = (SFc5_mpc_svpwmInstanceStruct *)utMalloc(sizeof 
    (SFc5_mpc_svpwmInstanceStruct)); 
  memset(chartInstance, 0, sizeof(SFc5_mpc_svpwmInstanceStruct)); 
  if (chartInstance==NULL) { 
    sf_mex_error_message("Could not allocate memory for chart instance."); 
  } 
 
  chartInstance->chartInfo.chartInstance = chartInstance; 
  chartInstance->chartInfo.isEMLChart = 1; 
  chartInstance->chartInfo.chartInitialized = 0; 
  chartInstance->chartInfo.sFunctionGateway = sf_opaque_gateway_c5_mpc_svpwm; 
  chartInstance->chartInfo.initializeChart = sf_opaque_initialize_c5_mpc_svpwm; 
  chartInstance->chartInfo.terminateChart = sf_opaque_terminate_c5_mpc_svpwm; 
  chartInstance->chartInfo.enableChart = sf_opaque_enable_c5_mpc_svpwm; 
  chartInstance->chartInfo.disableChart = sf_opaque_disable_c5_mpc_svpwm; 
  chartInstance->chartInfo.getSimState = sf_opaque_get_sim_state_c5_mpc_svpwm; 
  chartInstance->chartInfo.setSimState = sf_opaque_set_sim_state_c5_mpc_svpwm; 
  chartInstance->chartInfo.getSimStateInfo = sf_get_sim_state_info_c5_mpc_svpwm; 
  chartInstance->chartInfo.zeroCrossings = NULL; 
  chartInstance->chartInfo.outputs = NULL; 
  chartInstance->chartInfo.derivatives = NULL; 
  chartInstance->chartInfo.mdlRTW = mdlRTW_c5_mpc_svpwm; 
  chartInstance->chartInfo.mdlStart = mdlStart_c5_mpc_svpwm; 
  chartInstance->chartInfo.mdlSetWorkWidths = mdlSetWorkWidths_c5_mpc_svpwm; 
  chartInstance->chartInfo.extModeExec = NULL; 
  chartInstance->chartInfo.restoreLastMajorStepConfiguration = NULL; 
  chartInstance->chartInfo.restoreBeforeLastMajorStepConfiguration = NULL; 
  chartInstance->chartInfo.storeCurrentConfiguration = NULL; 
  chartInstance->S = S; 
  ssSetUserData(S,(void *)(&(chartInstance->chartInfo)));/* register the chart instance with simstruct */ 
  init_dsm_address_info(chartInstance); 
  if (!sim_mode_is_rtw_gen(S)) { 
  } 
 
  sf_opaque_init_subchart_simstructs(chartInstance->chartInfo.chartInstance); 
  chart_debug_initialization(S,1); 
} 
 
void c5_mpc_svpwm_method_dispatcher(SimStruct *S, int_T method, void *data) 
{ 
  switch (method) { 
   case SS_CALL_MDL_START: 
    mdlStart_c5_mpc_svpwm(S); 
    break; 
 
   case SS_CALL_MDL_SET_WORK_WIDTHS: 
    mdlSetWorkWidths_c5_mpc_svpwm(S); 
    break; 
 
   case SS_CALL_MDL_PROCESS_PARAMETERS: 
    mdlProcessParameters_c5_mpc_svpwm(S); 
    break; 
 
   default: 
    /* Unhandled method */ 
    sf_mex_error_message("Stateflow Internal Error:\n" 
                         "Error calling c5_mpc_svpwm_method_dispatcher.\n" 
                         "Can't handle method %d.\n", method); 
    break; 
  } 
}