#include "ne_ds.h"
#include "MotorController_FOC_466a9c02_1_ds_zc.h"
#include "MotorController_FOC_466a9c02_1_ds_sys_struct.h"
#include "MotorController_FOC_466a9c02_1_ds_externals.h"
#include "MotorController_FOC_466a9c02_1_ds_external_struct.h"
#include "ssc_ml_fun.h"
int32_T MotorController_FOC_466a9c02_1_ds_zc ( const NeDynamicSystem * sys ,
const NeDynamicSystemInput * t8 , NeDsMethodOutput * t9 ) { PmRealVector out
; real_T U_idx_0 ; real_T U_idx_1 ; real_T U_idx_2 ; real_T U_idx_3 ; real_T
U_idx_4 ; real_T U_idx_5 ; real_T X_idx_10 ; real_T X_idx_3 ; real_T X_idx_7
; real_T X_idx_8 ; real_T X_idx_9 ; real_T
plant_pmsm_inverter_MOSFET_Ideal_Switching4_diode_v ; real_T
plant_pmsm_inverter_MOSFET_Ideal_Switching_diode_v ; real_T t0 ; real_T t1 ;
real_T t2 ; real_T t3 ; real_T t4 ; real_T t5 ; real_T t6_idx_13 ; int32_T
M_idx_0 ; int32_T M_idx_12 ; int32_T M_idx_15 ; int32_T M_idx_18 ; int32_T
M_idx_3 ; int32_T M_idx_6 ; int32_T M_idx_9 ; M_idx_0 = t8 -> mM . mX [ 0 ] ;
M_idx_3 = t8 -> mM . mX [ 3 ] ; M_idx_6 = t8 -> mM . mX [ 6 ] ; M_idx_9 = t8
-> mM . mX [ 9 ] ; M_idx_12 = t8 -> mM . mX [ 12 ] ; M_idx_15 = t8 -> mM . mX
[ 15 ] ; M_idx_18 = t8 -> mM . mX [ 18 ] ; U_idx_0 = t8 -> mU . mX [ 0 ] ;
U_idx_1 = t8 -> mU . mX [ 1 ] ; U_idx_2 = t8 -> mU . mX [ 2 ] ; U_idx_3 = t8
-> mU . mX [ 3 ] ; U_idx_4 = t8 -> mU . mX [ 4 ] ; U_idx_5 = t8 -> mU . mX [
5 ] ; X_idx_3 = t8 -> mX . mX [ 3 ] ; X_idx_7 = t8 -> mX . mX [ 7 ] ; X_idx_8
= t8 -> mX . mX [ 8 ] ; X_idx_9 = t8 -> mX . mX [ 9 ] ; X_idx_10 = t8 -> mX .
mX [ 10 ] ; out = t9 -> mZC ;
plant_pmsm_inverter_MOSFET_Ideal_Switching4_diode_v = ( X_idx_10 * - 0.001 +
X_idx_9 ) + - 48.0 ; plant_pmsm_inverter_MOSFET_Ideal_Switching_diode_v = (
X_idx_10 * - 0.001 + X_idx_7 ) + - 48.0 ; X_idx_10 = ( X_idx_10 * - 0.001 +
X_idx_8 ) + - 48.0 ; if ( M_idx_12 == 0 ) { t0 = - pmf_get_inf ( ) -
plant_pmsm_inverter_MOSFET_Ideal_Switching_diode_v ; } else { t0 = 0.0 ; } if
( M_idx_15 == 0 ) { t1 = - pmf_get_inf ( ) - ( - X_idx_7 ) ; } else { t1 =
0.0 ; } if ( M_idx_18 == 0 ) { t2 = - pmf_get_inf ( ) - X_idx_10 ; } else {
t2 = 0.0 ; } if ( M_idx_3 == 0 ) { t3 = - pmf_get_inf ( ) - ( - X_idx_8 ) ; }
else { t3 = 0.0 ; } if ( M_idx_6 == 0 ) { t4 = - pmf_get_inf ( ) -
plant_pmsm_inverter_MOSFET_Ideal_Switching4_diode_v ; } else { t4 = 0.0 ; }
if ( M_idx_9 == 0 ) { t5 = - pmf_get_inf ( ) - ( - X_idx_9 ) ; } else { t5 =
0.0 ; } t6_idx_13 = fabs ( X_idx_3 / 6.2831853071795862 ) - 2.147483647E+9 ;
out . mX [ 0 ] = plant_pmsm_inverter_MOSFET_Ideal_Switching_diode_v - 0.8 ;
out . mX [ 1 ] = t0 ; out . mX [ 2 ] = - X_idx_7 - 0.8 ; out . mX [ 3 ] = t1
; out . mX [ 4 ] = X_idx_10 - 0.8 ; out . mX [ 5 ] = t2 ; out . mX [ 6 ] = -
X_idx_8 - 0.8 ; out . mX [ 7 ] = t3 ; out . mX [ 8 ] =
plant_pmsm_inverter_MOSFET_Ideal_Switching4_diode_v - 0.8 ; out . mX [ 9 ] =
t4 ; out . mX [ 10 ] = - X_idx_9 - 0.8 ; out . mX [ 11 ] = t5 ; out . mX [ 12
] = X_idx_3 / 6.2831853071795862 - ( ( real_T ) M_idx_0 + 1.0 ) ; out . mX [
13 ] = t6_idx_13 ; out . mX [ 14 ] = ( real_T ) M_idx_0 - X_idx_3 /
6.2831853071795862 ; out . mX [ 15 ] = U_idx_4 - 0.5 ; out . mX [ 16 ] =
U_idx_5 - 0.5 ; out . mX [ 17 ] = U_idx_0 - 0.5 ; out . mX [ 18 ] = U_idx_1 -
0.5 ; out . mX [ 19 ] = U_idx_2 - 0.5 ; out . mX [ 20 ] = U_idx_3 - 0.5 ; (
void ) sys ; ( void ) t9 ; return 0 ; }
