www.pudn.com > pi_svpwm.zip > svpi_acc.c, change:2014-03-26,size:29374b


#include "__cf_svpi.h" 
#include <math.h> 
#include "svpi_acc.h" 
#include "svpi_acc_private.h" 
#include <stdio.h> 
#include "simstruc.h" 
#include "fixedpoint.h" 
#define CodeFormat S-Function 
#define AccDefine1 Accelerator_S-Function 
static void mdlOutputs ( SimStruct * S , int_T tid ) { real_T B_2_5_0 ; 
boolean_T B_2_39_0 ; real_T B_2_137_0 ; real_T B_2_127_0 ; real_T B_2_129_0 ; 
real_T B_2_148_0 ; real_T B_2_128_0 ; real_T B_1_1_0 ; real_T B_1_7_0 ; 
real_T B_1_11_0 [ 18 ] ; real_T B_2_97_0 ; real_T tmp [ 18 ] ; int32_T i ; 
real_T u ; B_svpi_T * _rtB ; P_svpi_T * _rtP ; DW_svpi_T * _rtDW ; _rtDW = ( 
( DW_svpi_T * ) ssGetRootDWork ( S ) ) ; _rtP = ( ( P_svpi_T * ) 
ssGetDefaultParam ( S ) ) ; _rtB = ( ( B_svpi_T * ) _ssGetBlockIO ( S ) ) ; 
if ( ssIsSampleHit ( S , 2 , 0 ) ) { memcpy ( & _rtB -> B_2_0_0 [ 0 ] , & 
_rtDW -> UnitDelay_DSTATE [ 0 ] , 18U * sizeof ( real_T ) ) ; } B_2_5_0 = 
ssGetT ( S ) ; ( ( B_svpi_T * ) _ssGetBlockIO ( S ) ) -> B_2_2_0 = 
ssGetTStart ( S ) ; B_2_5_0 -= _rtB -> B_2_2_0 ; if ( ssIsSampleHit ( S , 1 , 
0 ) ) { _rtB -> B_2_4_0 = _rtP -> P_16 ; } B_2_5_0 = muDoubleScalarRem ( 
B_2_5_0 , _rtB -> B_2_4_0 ) ; _rtB -> B_2_6_0 = rt_Lookup ( _rtP -> P_17 , 3 
, B_2_5_0 , _rtP -> P_18 ) ; if ( ssIsSampleHit ( S , 4 , 0 ) ) { _rtB -> 
B_2_7_0 = _rtDW -> UnitDelay12_DSTATE ; _rtB -> B_2_8_0 = _rtDW -> 
UnitDelay5_DSTATE ; _rtB -> B_2_9_0 = _rtDW -> UnitDelay6_DSTATE ; } if ( 
ssIsSampleHit ( S , 1 , 0 ) ) { _rtB -> B_2_10_0 = _rtP -> P_22 ; } if ( 
ssIsSampleHit ( S , 4 , 0 ) ) { _rtB -> B_2_11_0 [ 0 ] = _rtDW -> 
UnitDelay9_DSTATE [ 0 ] ; _rtB -> B_2_11_0 [ 1 ] = _rtDW -> UnitDelay9_DSTATE 
[ 1 ] ; _rtB -> B_2_11_0 [ 2 ] = _rtDW -> UnitDelay9_DSTATE [ 2 ] ; _rtB -> 
B_2_12_0 = _rtDW -> UnitDelay13_DSTATE ; _rtB -> B_2_13_0 = _rtDW -> 
UnitDelay14_DSTATE ; } if ( ssIsSampleHit ( S , 1 , 0 ) ) { _rtB -> B_2_14_0 
= _rtP -> P_26 ; ssCallAccelRunBlock ( S , 0 , 0 , SS_CALL_MDL_OUTPUTS ) ; if 
( ssIsMajorTimeStep ( S ) ) { _rtDW -> CMP1_Mode = ( _rtB -> B_2_6_0 >= _rtB 
-> B_0_0_1 ) ; } B_2_39_0 = _rtDW -> CMP1_Mode ; _rtB -> B_2_17_0 = _rtDW -> 
CMP1_Mode ; if ( ssIsMajorTimeStep ( S ) ) { _rtDW -> CMP2_Mode = ( _rtB -> 
B_2_6_0 >= _rtB -> B_0_0_2 ) ; } _rtB -> B_2_19_0 = _rtDW -> CMP2_Mode ; 
B_2_39_0 = ! B_2_39_0 ; _rtB -> B_2_21_0 = B_2_39_0 ; _rtB -> B_2_23_0 = ! 
_rtDW -> CMP2_Mode ; _rtB -> B_2_24_0 = _rtP -> P_27 ; if ( ssIsMajorTimeStep 
( S ) ) { _rtDW -> CMP3_Mode = ( _rtB -> B_2_6_0 >= _rtB -> B_0_0_3 ) ; } 
B_2_39_0 = _rtDW -> CMP3_Mode ; _rtB -> B_2_26_0 = _rtDW -> CMP3_Mode ; if ( 
ssIsMajorTimeStep ( S ) ) { _rtDW -> CMP4_Mode = ( _rtB -> B_2_6_0 >= _rtB -> 
B_0_0_4 ) ; } _rtB -> B_2_28_0 = _rtDW -> CMP4_Mode ; B_2_39_0 = ! B_2_39_0 ; 
_rtB -> B_2_30_0 = B_2_39_0 ; _rtB -> B_2_32_0 = ! _rtDW -> CMP4_Mode ; if ( 
ssIsMajorTimeStep ( S ) ) { _rtDW -> CMP5_Mode = ( _rtB -> B_2_6_0 >= _rtB -> 
B_0_0_5 ) ; } B_2_39_0 = _rtDW -> CMP5_Mode ; _rtB -> B_2_34_0 = _rtDW -> 
CMP5_Mode ; if ( ssIsMajorTimeStep ( S ) ) { _rtDW -> CMP6_Mode = ( _rtB -> 
B_2_6_0 >= _rtB -> B_0_0_6 ) ; } _rtB -> B_2_36_0 = _rtDW -> CMP6_Mode ; 
B_2_39_0 = ! B_2_39_0 ; _rtB -> B_2_38_0 = B_2_39_0 ; _rtB -> B_2_40_0 = ! 
_rtDW -> CMP6_Mode ; _rtB -> B_2_41_0 = _rtP -> P_114 ; if ( 
ssIsMajorTimeStep ( S ) ) { if ( _rtB -> B_2_41_0 ) { if ( ! _rtDW -> 
Tail_MODE ) { if ( ssGetTaskTime ( S , 1 ) != ssGetTStart ( S ) ) { 
ssSetSolverNeedsReset ( S ) ; } for ( i = 0 ; i < 18 ; i ++ ) { _rtDW -> 
DiscreteTimeIntegrator_DSTATE_p [ i ] = _rtP -> P_4 ; _rtDW -> 
DiscreteTimeIntegrator_PrevResetState [ i ] = 2 ; _rtDW -> UnitDelay_DSTATE_o 
[ i ] = _rtP -> P_13 ; } _rtDW -> Tail_MODE = TRUE ; } } else { if ( _rtDW -> 
Tail_MODE ) { ssSetSolverNeedsReset ( S ) ; _rtDW -> Tail_MODE = FALSE ; } } 
} } if ( _rtDW -> Tail_MODE ) { if ( ssIsSampleHit ( S , 2 , 0 ) ) { _rtB -> 
B_1_0_0 = _rtP -> P_1 ; } if ( ssIsSampleHit ( S , 1 , 0 ) ) { B_1_1_0 = _rtP 
-> P_2 ; } if ( ssIsSampleHit ( S , 2 , 0 ) ) { tmp [ 0 ] = _rtB -> B_2_17_0 
; tmp [ 1 ] = _rtB -> B_2_19_0 ; tmp [ 2 ] = _rtB -> B_2_21_0 ; tmp [ 3 ] = 
_rtB -> B_2_23_0 ; tmp [ 4 ] = _rtB -> B_2_24_0 ; tmp [ 5 ] = _rtB -> 
B_2_24_0 ; tmp [ 6 ] = _rtB -> B_2_26_0 ; tmp [ 7 ] = _rtB -> B_2_28_0 ; tmp 
[ 8 ] = _rtB -> B_2_30_0 ; tmp [ 9 ] = _rtB -> B_2_32_0 ; tmp [ 10 ] = _rtB 
-> B_2_24_0 ; tmp [ 11 ] = _rtB -> B_2_24_0 ; tmp [ 12 ] = _rtB -> B_2_34_0 ; 
tmp [ 13 ] = _rtB -> B_2_36_0 ; tmp [ 14 ] = _rtB -> B_2_38_0 ; tmp [ 15 ] = 
_rtB -> B_2_40_0 ; tmp [ 16 ] = _rtB -> B_2_24_0 ; tmp [ 17 ] = _rtB -> 
B_2_24_0 ; for ( i = 0 ; i < 18 ; i ++ ) { if ( ( tmp [ i ] <= 0.0 ) && ( 
_rtDW -> DiscreteTimeIntegrator_PrevResetState [ i ] == 1 ) ) { _rtDW -> 
DiscreteTimeIntegrator_DSTATE_p [ i ] = _rtP -> P_4 ; } _rtB -> B_1_2_0 [ i ] 
= _rtDW -> DiscreteTimeIntegrator_DSTATE_p [ i ] ; } } if ( ssIsSampleHit ( S 
, 1 , 0 ) ) { B_1_7_0 = _rtP -> P_5 ; } if ( ssIsSampleHit ( S , 2 , 0 ) ) { 
for ( i = 0 ; i < 18 ; i ++ ) { _rtB -> B_1_4_0 [ i ] = _rtP -> P_6 * _rtB -> 
B_1_2_0 [ i ] ; } } if ( ssIsSampleHit ( S , 1 , 0 ) ) { for ( i = 0 ; i < 18 
; i ++ ) { u = B_1_7_0 + _rtB -> B_1_4_0 [ i ] ; B_2_129_0 = ( _rtP -> P_9 - 
_rtB -> B_1_2_0 [ i ] ) * _rtP -> P_10 ; if ( u >= _rtP -> P_7 ) { u = _rtP 
-> P_7 ; } else { if ( u <= _rtP -> P_8 ) { u = _rtP -> P_8 ; } } if ( 
B_2_129_0 >= _rtP -> P_11 ) { B_2_129_0 = _rtP -> P_11 ; } else { if ( 
B_2_129_0 <= _rtP -> P_12 ) { B_2_129_0 = _rtP -> P_12 ; } } B_1_11_0 [ i ] = 
u + B_2_129_0 ; } } if ( ssIsSampleHit ( S , 2 , 0 ) ) { memcpy ( & _rtB -> 
B_1_12_0 [ 0 ] , & _rtDW -> UnitDelay_DSTATE_o [ 0 ] , 18U * sizeof ( real_T 
) ) ; } if ( ssIsSampleHit ( S , 1 , 0 ) ) { if ( _rtB -> B_2_17_0 >= _rtP -> 
P_14 ) { _rtB -> B_1_13_0 [ 0 ] = _rtB -> B_2_0_0 [ 0 ] ; } else { _rtB -> 
B_1_13_0 [ 0 ] = _rtB -> B_1_12_0 [ 0 ] ; } if ( _rtB -> B_2_19_0 >= _rtP -> 
P_14 ) { _rtB -> B_1_13_0 [ 1 ] = _rtB -> B_2_0_0 [ 1 ] ; } else { _rtB -> 
B_1_13_0 [ 1 ] = _rtB -> B_1_12_0 [ 1 ] ; } if ( _rtB -> B_2_21_0 >= _rtP -> 
P_14 ) { _rtB -> B_1_13_0 [ 2 ] = _rtB -> B_2_0_0 [ 2 ] ; } else { _rtB -> 
B_1_13_0 [ 2 ] = _rtB -> B_1_12_0 [ 2 ] ; } if ( _rtB -> B_2_23_0 >= _rtP -> 
P_14 ) { _rtB -> B_1_13_0 [ 3 ] = _rtB -> B_2_0_0 [ 3 ] ; } else { _rtB -> 
B_1_13_0 [ 3 ] = _rtB -> B_1_12_0 [ 3 ] ; } if ( _rtB -> B_2_24_0 >= _rtP -> 
P_14 ) { _rtB -> B_1_13_0 [ 4 ] = _rtB -> B_2_0_0 [ 4 ] ; } else { _rtB -> 
B_1_13_0 [ 4 ] = _rtB -> B_1_12_0 [ 4 ] ; } if ( _rtB -> B_2_24_0 >= _rtP -> 
P_14 ) { _rtB -> B_1_13_0 [ 5 ] = _rtB -> B_2_0_0 [ 5 ] ; } else { _rtB -> 
B_1_13_0 [ 5 ] = _rtB -> B_1_12_0 [ 5 ] ; } if ( _rtB -> B_2_26_0 >= _rtP -> 
P_14 ) { _rtB -> B_1_13_0 [ 6 ] = _rtB -> B_2_0_0 [ 6 ] ; } else { _rtB -> 
B_1_13_0 [ 6 ] = _rtB -> B_1_12_0 [ 6 ] ; } if ( _rtB -> B_2_28_0 >= _rtP -> 
P_14 ) { _rtB -> B_1_13_0 [ 7 ] = _rtB -> B_2_0_0 [ 7 ] ; } else { _rtB -> 
B_1_13_0 [ 7 ] = _rtB -> B_1_12_0 [ 7 ] ; } if ( _rtB -> B_2_30_0 >= _rtP -> 
P_14 ) { _rtB -> B_1_13_0 [ 8 ] = _rtB -> B_2_0_0 [ 8 ] ; } else { _rtB -> 
B_1_13_0 [ 8 ] = _rtB -> B_1_12_0 [ 8 ] ; } if ( _rtB -> B_2_32_0 >= _rtP -> 
P_14 ) { _rtB -> B_1_13_0 [ 9 ] = _rtB -> B_2_0_0 [ 9 ] ; } else { _rtB -> 
B_1_13_0 [ 9 ] = _rtB -> B_1_12_0 [ 9 ] ; } if ( _rtB -> B_2_24_0 >= _rtP -> 
P_14 ) { _rtB -> B_1_13_0 [ 10 ] = _rtB -> B_2_0_0 [ 10 ] ; } else { _rtB -> 
B_1_13_0 [ 10 ] = _rtB -> B_1_12_0 [ 10 ] ; } if ( _rtB -> B_2_24_0 >= _rtP 
-> P_14 ) { _rtB -> B_1_13_0 [ 11 ] = _rtB -> B_2_0_0 [ 11 ] ; } else { _rtB 
-> B_1_13_0 [ 11 ] = _rtB -> B_1_12_0 [ 11 ] ; } if ( _rtB -> B_2_34_0 >= 
_rtP -> P_14 ) { _rtB -> B_1_13_0 [ 12 ] = _rtB -> B_2_0_0 [ 12 ] ; } else { 
_rtB -> B_1_13_0 [ 12 ] = _rtB -> B_1_12_0 [ 12 ] ; } if ( _rtB -> B_2_36_0 
>= _rtP -> P_14 ) { _rtB -> B_1_13_0 [ 13 ] = _rtB -> B_2_0_0 [ 13 ] ; } else 
{ _rtB -> B_1_13_0 [ 13 ] = _rtB -> B_1_12_0 [ 13 ] ; } if ( _rtB -> B_2_38_0 
>= _rtP -> P_14 ) { _rtB -> B_1_13_0 [ 14 ] = _rtB -> B_2_0_0 [ 14 ] ; } else 
{ _rtB -> B_1_13_0 [ 14 ] = _rtB -> B_1_12_0 [ 14 ] ; } if ( _rtB -> B_2_40_0 
>= _rtP -> P_14 ) { _rtB -> B_1_13_0 [ 15 ] = _rtB -> B_2_0_0 [ 15 ] ; } else 
{ _rtB -> B_1_13_0 [ 15 ] = _rtB -> B_1_12_0 [ 15 ] ; } if ( _rtB -> B_2_24_0 
>= _rtP -> P_14 ) { _rtB -> B_1_13_0 [ 16 ] = _rtB -> B_2_0_0 [ 16 ] ; } else 
{ _rtB -> B_1_13_0 [ 16 ] = _rtB -> B_1_12_0 [ 16 ] ; } if ( _rtB -> B_2_24_0 
>= _rtP -> P_14 ) { _rtB -> B_1_13_0 [ 17 ] = _rtB -> B_2_0_0 [ 17 ] ; } else 
{ _rtB -> B_1_13_0 [ 17 ] = _rtB -> B_1_12_0 [ 17 ] ; } for ( i = 0 ; i < 18 
; i ++ ) { _rtB -> B_1_14_0 [ i ] = B_1_11_0 [ i ] * _rtB -> B_1_13_0 [ i ] * 
B_1_1_0 ; } } if ( ssIsMajorTimeStep ( S ) ) { srUpdateBC ( _rtDW -> 
Tail_SubsysRanBC ) ; } } if ( ssIsSampleHit ( S , 4 , 0 ) ) { if ( _rtDW -> 
systemEnable != 0 ) { _rtDW -> lastSin = muDoubleScalarSin ( _rtP -> P_30 * 
ssGetTaskTime ( S , 4 ) ) ; _rtDW -> lastCos = muDoubleScalarCos ( _rtP -> 
P_30 * ssGetTaskTime ( S , 4 ) ) ; _rtDW -> systemEnable = 0 ; } _rtB -> 
B_2_43_0 = ( ( _rtDW -> lastSin * _rtP -> P_34 + _rtDW -> lastCos * _rtP -> 
P_33 ) * _rtP -> P_32 + ( _rtDW -> lastCos * _rtP -> P_34 - _rtDW -> lastSin 
* _rtP -> P_33 ) * _rtP -> P_31 ) * _rtP -> P_28 + _rtP -> P_29 ; if ( _rtDW 
-> systemEnable_g != 0 ) { _rtDW -> lastSin_b = muDoubleScalarSin ( _rtP -> 
P_37 * ssGetTaskTime ( S , 4 ) ) ; _rtDW -> lastCos_o = muDoubleScalarCos ( 
_rtP -> P_37 * ssGetTaskTime ( S , 4 ) ) ; _rtDW -> systemEnable_g = 0 ; } 
_rtB -> B_2_44_0 = ( ( _rtDW -> lastSin_b * _rtP -> P_41 + _rtDW -> lastCos_o 
* _rtP -> P_40 ) * _rtP -> P_39 + ( _rtDW -> lastCos_o * _rtP -> P_41 - _rtDW 
-> lastSin_b * _rtP -> P_40 ) * _rtP -> P_38 ) * _rtP -> P_35 + _rtP -> P_36 
; if ( _rtDW -> systemEnable_m != 0 ) { _rtDW -> lastSin_f = 
muDoubleScalarSin ( _rtP -> P_44 * ssGetTaskTime ( S , 4 ) ) ; _rtDW -> 
lastCos_j = muDoubleScalarCos ( _rtP -> P_44 * ssGetTaskTime ( S , 4 ) ) ; 
_rtDW -> systemEnable_m = 0 ; } _rtB -> B_2_45_0 = ( ( _rtDW -> lastSin_f * 
_rtP -> P_48 + _rtDW -> lastCos_j * _rtP -> P_47 ) * _rtP -> P_46 + ( _rtDW 
-> lastCos_j * _rtP -> P_48 - _rtDW -> lastSin_f * _rtP -> P_47 ) * _rtP -> 
P_45 ) * _rtP -> P_42 + _rtP -> P_43 ; } if ( ssIsSampleHit ( S , 2 , 0 ) ) { 
for ( i = 0 ; i < 18 ; i ++ ) { if ( _rtB -> B_2_0_0 [ i ] != 0.0 ) { _rtB -> 
B_2_48_0 [ i ] = _rtP -> P_49 [ i ] ; } else { _rtB -> B_2_48_0 [ i ] = _rtP 
-> P_50 [ i ] ; } } ssCallAccelRunBlock ( S , 2 , 49 , SS_CALL_MDL_OUTPUTS ) 
; _rtB -> B_2_50_0 = _rtP -> P_51 * _rtB -> B_2_49_0 [ 23 ] ; _rtB -> 
B_2_51_0 = _rtP -> P_52 * _rtB -> B_2_49_0 [ 18 ] ; _rtB -> B_2_52_0 = _rtB 
-> B_2_50_0 - _rtB -> B_2_51_0 ; } if ( ssIsSampleHit ( S , 3 , 0 ) ) { 
ssCallAccelRunBlock ( S , 2 , 53 , SS_CALL_MDL_OUTPUTS ) ; } if ( 
ssIsSampleHit ( S , 2 , 0 ) ) { _rtB -> B_2_54_0 = _rtP -> P_53 * _rtB -> 
B_2_49_0 [ 20 ] ; _rtB -> B_2_55_0 = _rtP -> P_54 * _rtB -> B_2_49_0 [ 24 ] ; 
_rtB -> B_2_56_0 = _rtP -> P_55 * _rtB -> B_2_55_0 ; ssCallAccelRunBlock ( S 
, 2 , 57 , SS_CALL_MDL_OUTPUTS ) ; _rtB -> B_2_58_0 = _rtP -> P_56 * _rtB -> 
B_2_49_0 [ 25 ] ; _rtB -> B_2_60_0 = _rtP -> P_58 * _rtB -> B_2_49_0 [ 26 ] ; 
B_1_1_0 = ( ( _rtB -> B_2_55_0 - _rtP -> P_57 * _rtB -> B_2_58_0 ) - _rtP -> 
P_59 * _rtB -> B_2_60_0 ) * _rtP -> P_60 ; B_1_7_0 = _rtP -> P_61 * _rtB -> 
B_2_49_0 [ 21 ] ; B_2_137_0 = _rtP -> P_63 * _rtB -> B_2_49_0 [ 22 ] ; 
B_2_127_0 = ( ( _rtB -> B_2_54_0 - _rtP -> P_62 * B_1_7_0 ) - _rtP -> P_64 * 
B_2_137_0 ) * _rtP -> P_65 ; B_2_137_0 = ( _rtP -> P_66 * B_1_7_0 - _rtP -> 
P_67 * B_2_137_0 ) * _rtP -> P_68 ; B_1_7_0 = B_2_127_0 * B_2_127_0 + 
B_2_137_0 * B_2_137_0 ; if ( B_1_7_0 < 0.0 ) { B_1_7_0 = - muDoubleScalarSqrt 
( muDoubleScalarAbs ( B_1_7_0 ) ) ; } else { B_1_7_0 = muDoubleScalarSqrt ( 
B_1_7_0 ) ; } B_1_7_0 = 1.0 / B_1_7_0 ; B_2_129_0 = B_1_7_0 * B_2_127_0 ; 
B_2_148_0 = ( _rtP -> P_69 * _rtB -> B_2_58_0 - _rtP -> P_70 * _rtB -> 
B_2_60_0 ) * _rtP -> P_71 ; B_1_7_0 *= B_2_137_0 ; _rtB -> B_2_87_0 = B_1_1_0 
* B_2_129_0 + B_2_148_0 * B_1_7_0 ; _rtB -> B_2_91_0 = _rtP -> P_72 * B_1_7_0 
* B_1_1_0 + B_2_148_0 * B_2_129_0 ; ssCallAccelRunBlock ( S , 2 , 92 , 
SS_CALL_MDL_OUTPUTS ) ; } if ( ssIsSampleHit ( S , 3 , 0 ) ) { 
ssCallAccelRunBlock ( S , 2 , 93 , SS_CALL_MDL_OUTPUTS ) ; } if ( 
ssIsSampleHit ( S , 1 , 0 ) ) { if ( ssIsMajorTimeStep ( S ) ) { _rtDW -> 
Step_MODE = ( ssGetTaskTime ( S , 1 ) >= _rtP -> P_74 ) ; _rtDW -> Step1_MODE 
= ( ssGetTaskTime ( S , 1 ) >= _rtP -> P_77 ) ; } if ( _rtDW -> Step_MODE == 
1 ) { B_2_129_0 = _rtP -> P_76 ; } else { B_2_129_0 = _rtP -> P_75 ; } if ( 
_rtDW -> Step1_MODE == 1 ) { u = _rtP -> P_79 ; } else { u = _rtP -> P_78 ; } 
B_2_97_0 = ( _rtP -> P_73 + B_2_129_0 ) - u ; } if ( ssIsSampleHit ( S , 2 , 
0 ) ) { _rtB -> B_2_98_0 = _rtP -> P_80 * _rtB -> B_2_49_0 [ 19 ] ; } if ( 
ssIsSampleHit ( S , 1 , 0 ) ) { _rtB -> B_2_99_0 = B_2_97_0 - _rtB -> 
B_2_98_0 ; } if ( ssIsSampleHit ( S , 4 , 0 ) ) { u = _rtP -> P_81 * _rtB -> 
B_2_99_0 + _rtDW -> DiscreteTimeIntegrator_DSTATE ; if ( u >= _rtP -> P_86 ) 
{ _rtB -> B_2_103_0 = _rtP -> P_86 ; } else if ( u <= _rtP -> P_87 ) { _rtB 
-> B_2_103_0 = _rtP -> P_87 ; } else { _rtB -> B_2_103_0 = u ; } } if ( 
ssIsSampleHit ( S , 2 , 0 ) ) { _rtB -> B_2_104_0 = _rtB -> B_2_103_0 - _rtB 
-> B_2_87_0 ; } if ( ssIsSampleHit ( S , 4 , 0 ) ) { u = _rtP -> P_88 * _rtB 
-> B_2_104_0 + _rtDW -> DiscreteTimeIntegrator_DSTATE_h ; if ( u >= _rtP -> 
P_93 ) { _rtB -> B_2_108_0 = _rtP -> P_93 ; } else if ( u <= _rtP -> P_94 ) { 
_rtB -> B_2_108_0 = _rtP -> P_94 ; } else { _rtB -> B_2_108_0 = u ; } } if ( 
ssIsSampleHit ( S , 2 , 0 ) ) { B_2_148_0 = B_2_127_0 * B_2_127_0 + B_2_137_0 
* B_2_137_0 ; if ( B_2_148_0 < 0.0 ) { B_2_148_0 = - muDoubleScalarSqrt ( 
muDoubleScalarAbs ( B_2_148_0 ) ) ; } else { B_2_148_0 = muDoubleScalarSqrt ( 
B_2_148_0 ) ; } B_2_148_0 = 1.0 / B_2_148_0 ; _rtB -> B_2_121_0 = ( ( 
B_2_148_0 * B_2_127_0 * B_2_127_0 + B_2_137_0 * B_2_148_0 * B_2_137_0 ) + 
_rtP -> P_95 * _rtB -> B_2_91_0 ) - _rtB -> B_2_108_0 ; B_2_148_0 = B_2_127_0 
* B_2_127_0 + B_2_137_0 * B_2_137_0 ; if ( B_2_148_0 < 0.0 ) { B_2_148_0 = - 
muDoubleScalarSqrt ( muDoubleScalarAbs ( B_2_148_0 ) ) ; } else { B_2_148_0 = 
muDoubleScalarSqrt ( B_2_148_0 ) ; } B_2_148_0 = 1.0 / B_2_148_0 ; B_2_127_0 
*= B_2_148_0 ; B_2_128_0 = _rtB -> B_2_121_0 * B_2_127_0 ; _rtB -> B_2_130_0 
= _rtP -> P_96 - _rtB -> B_2_91_0 ; } if ( ssIsSampleHit ( S , 4 , 0 ) ) { u 
= _rtP -> P_97 * _rtB -> B_2_130_0 + _rtDW -> DiscreteTimeIntegrator_DSTATE_n 
; if ( u >= _rtP -> P_102 ) { _rtB -> B_2_134_0 = _rtP -> P_102 ; } else if ( 
u <= _rtP -> P_103 ) { _rtB -> B_2_134_0 = _rtP -> P_103 ; } else { _rtB -> 
B_2_134_0 = u ; } } if ( ssIsSampleHit ( S , 2 , 0 ) ) { _rtB -> B_2_136_0 = 
( 0.0 - _rtB -> B_2_134_0 ) - _rtP -> P_104 * _rtB -> B_2_87_0 ; B_2_137_0 *= 
B_2_148_0 ; _rtB -> B_2_140_0 = _rtP -> P_105 * B_2_137_0 * _rtB -> B_2_136_0 
+ B_2_128_0 ; _rtB -> B_2_143_0 = _rtB -> B_2_121_0 * B_2_137_0 + _rtB -> 
B_2_136_0 * B_2_127_0 ; ssCallAccelRunBlock ( S , 2 , 144 , 
SS_CALL_MDL_OUTPUTS ) ; } if ( ssIsSampleHit ( S , 1 , 0 ) ) { 
ssCallAccelRunBlock ( S , 2 , 145 , SS_CALL_MDL_OUTPUTS ) ; } if ( 
ssIsSampleHit ( S , 2 , 0 ) ) { ssCallAccelRunBlock ( S , 2 , 146 , 
SS_CALL_MDL_OUTPUTS ) ; } if ( ssIsSampleHit ( S , 4 , 0 ) ) { 
ssCallAccelRunBlock ( S , 2 , 147 , SS_CALL_MDL_OUTPUTS ) ; } if ( 
ssIsSampleHit ( S , 2 , 0 ) ) { for ( i = 0 ; i < 18 ; i ++ ) { if ( _rtB -> 
B_2_49_1 [ i ] >= _rtP -> P_108 ) { u = _rtP -> P_107 * _rtB -> B_2_49_0 [ i 
] ; } else { u = _rtP -> P_106 ; } if ( u >= _rtP -> P_109 ) { _rtB -> 
B_2_151_0 [ i ] = _rtP -> P_109 ; } else if ( u <= _rtP -> P_110 ) { _rtB -> 
B_2_151_0 [ i ] = _rtP -> P_110 ; } else { _rtB -> B_2_151_0 [ i ] = u ; } } 
} if ( ssIsSampleHit ( S , 4 , 0 ) ) { ssCallAccelRunBlock ( S , 2 , 159 , 
SS_CALL_MDL_OUTPUTS ) ; ssCallAccelRunBlock ( S , 2 , 160 , 
SS_CALL_MDL_OUTPUTS ) ; ssCallAccelRunBlock ( S , 2 , 161 , 
SS_CALL_MDL_OUTPUTS ) ; ssCallAccelRunBlock ( S , 2 , 162 , 
SS_CALL_MDL_OUTPUTS ) ; ssCallAccelRunBlock ( S , 2 , 163 , 
SS_CALL_MDL_OUTPUTS ) ; } if ( ssIsSampleHit ( S , 3 , 0 ) ) { 
ssCallAccelRunBlock ( S , 2 , 164 , SS_CALL_MDL_OUTPUTS ) ; } if ( 
ssIsSampleHit ( S , 4 , 0 ) ) { _rtB -> B_2_174_0 = _rtP -> P_111 * _rtB -> 
B_2_99_0 ; _rtB -> B_2_175_0 = _rtP -> P_112 * _rtB -> B_2_104_0 ; _rtB -> 
B_2_176_0 = _rtP -> P_113 * _rtB -> B_2_130_0 ; ssCallAccelRunBlock ( S , 2 , 
177 , SS_CALL_MDL_OUTPUTS ) ; } if ( ssIsSampleHit ( S , 1 , 0 ) ) { _rtB -> 
B_2_178_0 = _rtB -> B_0_0_2 + _rtB -> B_0_0_1 ; ssCallAccelRunBlock ( S , 2 , 
179 , SS_CALL_MDL_OUTPUTS ) ; ssCallAccelRunBlock ( S , 2 , 180 , 
SS_CALL_MDL_OUTPUTS ) ; } ssCallAccelRunBlock ( S , 2 , 181 , 
SS_CALL_MDL_OUTPUTS ) ; ( ( B_svpi_T * ) _ssGetBlockIO ( S ) ) -> B_2_200_0 = 
ssGetT ( S ) ; if ( ssIsSampleHit ( S , 4 , 0 ) ) { ssCallAccelRunBlock ( S , 
2 , 201 , SS_CALL_MDL_OUTPUTS ) ; } UNUSED_PARAMETER ( tid ) ; } 
#define MDL_UPDATE 
static void mdlUpdate ( SimStruct * S , int_T tid ) { real_T HoldSine ; 
int32_T i ; B_svpi_T * _rtB ; P_svpi_T * _rtP ; DW_svpi_T * _rtDW ; _rtDW = ( 
( DW_svpi_T * ) ssGetRootDWork ( S ) ) ; _rtP = ( ( P_svpi_T * ) 
ssGetDefaultParam ( S ) ) ; _rtB = ( ( B_svpi_T * ) _ssGetBlockIO ( S ) ) ; 
if ( ssIsSampleHit ( S , 2 , 0 ) ) { memcpy ( & _rtDW -> UnitDelay_DSTATE [ 0 
] , & _rtB -> B_2_151_0 [ 0 ] , 18U * sizeof ( real_T ) ) ; } if ( 
ssIsSampleHit ( S , 4 , 0 ) ) { _rtDW -> UnitDelay12_DSTATE = _rtB -> 
B_2_140_0 ; _rtDW -> UnitDelay5_DSTATE = _rtB -> B_2_143_0 ; _rtDW -> 
UnitDelay6_DSTATE = _rtB -> B_2_98_0 ; _rtDW -> UnitDelay9_DSTATE [ 0 ] = 
_rtB -> B_2_55_0 ; _rtDW -> UnitDelay9_DSTATE [ 1 ] = _rtB -> B_2_58_0 ; 
_rtDW -> UnitDelay9_DSTATE [ 2 ] = _rtB -> B_2_60_0 ; _rtDW -> 
UnitDelay13_DSTATE = _rtB -> B_2_50_0 ; _rtDW -> UnitDelay14_DSTATE = _rtB -> 
B_2_51_0 ; } if ( _rtDW -> Tail_MODE && ssIsSampleHit ( S , 2 , 0 ) ) { 
HoldSine = _rtP -> P_3 * _rtB -> B_1_0_0 ; for ( i = 0 ; i < 18 ; i ++ ) { 
_rtDW -> DiscreteTimeIntegrator_DSTATE_p [ i ] += HoldSine ; } if ( _rtB -> 
B_2_17_0 > 0.0 ) { _rtDW -> DiscreteTimeIntegrator_PrevResetState [ 0 ] = 1 ; 
} else if ( _rtB -> B_2_17_0 < 0.0 ) { _rtDW -> 
DiscreteTimeIntegrator_PrevResetState [ 0 ] = - 1 ; } else if ( _rtB -> 
B_2_17_0 == 0.0 ) { _rtDW -> DiscreteTimeIntegrator_PrevResetState [ 0 ] = 0 
; } else { _rtDW -> DiscreteTimeIntegrator_PrevResetState [ 0 ] = 2 ; } if ( 
_rtB -> B_2_19_0 > 0.0 ) { _rtDW -> DiscreteTimeIntegrator_PrevResetState [ 1 
] = 1 ; } else if ( _rtB -> B_2_19_0 < 0.0 ) { _rtDW -> 
DiscreteTimeIntegrator_PrevResetState [ 1 ] = - 1 ; } else if ( _rtB -> 
B_2_19_0 == 0.0 ) { _rtDW -> DiscreteTimeIntegrator_PrevResetState [ 1 ] = 0 
; } else { _rtDW -> DiscreteTimeIntegrator_PrevResetState [ 1 ] = 2 ; } if ( 
_rtB -> B_2_21_0 > 0.0 ) { _rtDW -> DiscreteTimeIntegrator_PrevResetState [ 2 
] = 1 ; } else if ( _rtB -> B_2_21_0 < 0.0 ) { _rtDW -> 
DiscreteTimeIntegrator_PrevResetState [ 2 ] = - 1 ; } else if ( _rtB -> 
B_2_21_0 == 0.0 ) { _rtDW -> DiscreteTimeIntegrator_PrevResetState [ 2 ] = 0 
; } else { _rtDW -> DiscreteTimeIntegrator_PrevResetState [ 2 ] = 2 ; } if ( 
_rtB -> B_2_23_0 > 0.0 ) { _rtDW -> DiscreteTimeIntegrator_PrevResetState [ 3 
] = 1 ; } else if ( _rtB -> B_2_23_0 < 0.0 ) { _rtDW -> 
DiscreteTimeIntegrator_PrevResetState [ 3 ] = - 1 ; } else if ( _rtB -> 
B_2_23_0 == 0.0 ) { _rtDW -> DiscreteTimeIntegrator_PrevResetState [ 3 ] = 0 
; } else { _rtDW -> DiscreteTimeIntegrator_PrevResetState [ 3 ] = 2 ; } if ( 
_rtB -> B_2_24_0 > 0.0 ) { _rtDW -> DiscreteTimeIntegrator_PrevResetState [ 4 
] = 1 ; } else if ( _rtB -> B_2_24_0 < 0.0 ) { _rtDW -> 
DiscreteTimeIntegrator_PrevResetState [ 4 ] = - 1 ; } else if ( _rtB -> 
B_2_24_0 == 0.0 ) { _rtDW -> DiscreteTimeIntegrator_PrevResetState [ 4 ] = 0 
; } else { _rtDW -> DiscreteTimeIntegrator_PrevResetState [ 4 ] = 2 ; } if ( 
_rtB -> B_2_24_0 > 0.0 ) { _rtDW -> DiscreteTimeIntegrator_PrevResetState [ 5 
] = 1 ; } else if ( _rtB -> B_2_24_0 < 0.0 ) { _rtDW -> 
DiscreteTimeIntegrator_PrevResetState [ 5 ] = - 1 ; } else if ( _rtB -> 
B_2_24_0 == 0.0 ) { _rtDW -> DiscreteTimeIntegrator_PrevResetState [ 5 ] = 0 
; } else { _rtDW -> DiscreteTimeIntegrator_PrevResetState [ 5 ] = 2 ; } if ( 
_rtB -> B_2_26_0 > 0.0 ) { _rtDW -> DiscreteTimeIntegrator_PrevResetState [ 6 
] = 1 ; } else if ( _rtB -> B_2_26_0 < 0.0 ) { _rtDW -> 
DiscreteTimeIntegrator_PrevResetState [ 6 ] = - 1 ; } else if ( _rtB -> 
B_2_26_0 == 0.0 ) { _rtDW -> DiscreteTimeIntegrator_PrevResetState [ 6 ] = 0 
; } else { _rtDW -> DiscreteTimeIntegrator_PrevResetState [ 6 ] = 2 ; } if ( 
_rtB -> B_2_28_0 > 0.0 ) { _rtDW -> DiscreteTimeIntegrator_PrevResetState [ 7 
] = 1 ; } else if ( _rtB -> B_2_28_0 < 0.0 ) { _rtDW -> 
DiscreteTimeIntegrator_PrevResetState [ 7 ] = - 1 ; } else if ( _rtB -> 
B_2_28_0 == 0.0 ) { _rtDW -> DiscreteTimeIntegrator_PrevResetState [ 7 ] = 0 
; } else { _rtDW -> DiscreteTimeIntegrator_PrevResetState [ 7 ] = 2 ; } if ( 
_rtB -> B_2_30_0 > 0.0 ) { _rtDW -> DiscreteTimeIntegrator_PrevResetState [ 8 
] = 1 ; } else if ( _rtB -> B_2_30_0 < 0.0 ) { _rtDW -> 
DiscreteTimeIntegrator_PrevResetState [ 8 ] = - 1 ; } else if ( _rtB -> 
B_2_30_0 == 0.0 ) { _rtDW -> DiscreteTimeIntegrator_PrevResetState [ 8 ] = 0 
; } else { _rtDW -> DiscreteTimeIntegrator_PrevResetState [ 8 ] = 2 ; } if ( 
_rtB -> B_2_32_0 > 0.0 ) { _rtDW -> DiscreteTimeIntegrator_PrevResetState [ 9 
] = 1 ; } else if ( _rtB -> B_2_32_0 < 0.0 ) { _rtDW -> 
DiscreteTimeIntegrator_PrevResetState [ 9 ] = - 1 ; } else if ( _rtB -> 
B_2_32_0 == 0.0 ) { _rtDW -> DiscreteTimeIntegrator_PrevResetState [ 9 ] = 0 
; } else { _rtDW -> DiscreteTimeIntegrator_PrevResetState [ 9 ] = 2 ; } if ( 
_rtB -> B_2_24_0 > 0.0 ) { _rtDW -> DiscreteTimeIntegrator_PrevResetState [ 
10 ] = 1 ; } else if ( _rtB -> B_2_24_0 < 0.0 ) { _rtDW -> 
DiscreteTimeIntegrator_PrevResetState [ 10 ] = - 1 ; } else if ( _rtB -> 
B_2_24_0 == 0.0 ) { _rtDW -> DiscreteTimeIntegrator_PrevResetState [ 10 ] = 0 
; } else { _rtDW -> DiscreteTimeIntegrator_PrevResetState [ 10 ] = 2 ; } if ( 
_rtB -> B_2_24_0 > 0.0 ) { _rtDW -> DiscreteTimeIntegrator_PrevResetState [ 
11 ] = 1 ; } else if ( _rtB -> B_2_24_0 < 0.0 ) { _rtDW -> 
DiscreteTimeIntegrator_PrevResetState [ 11 ] = - 1 ; } else if ( _rtB -> 
B_2_24_0 == 0.0 ) { _rtDW -> DiscreteTimeIntegrator_PrevResetState [ 11 ] = 0 
; } else { _rtDW -> DiscreteTimeIntegrator_PrevResetState [ 11 ] = 2 ; } if ( 
_rtB -> B_2_34_0 > 0.0 ) { _rtDW -> DiscreteTimeIntegrator_PrevResetState [ 
12 ] = 1 ; } else if ( _rtB -> B_2_34_0 < 0.0 ) { _rtDW -> 
DiscreteTimeIntegrator_PrevResetState [ 12 ] = - 1 ; } else if ( _rtB -> 
B_2_34_0 == 0.0 ) { _rtDW -> DiscreteTimeIntegrator_PrevResetState [ 12 ] = 0 
; } else { _rtDW -> DiscreteTimeIntegrator_PrevResetState [ 12 ] = 2 ; } if ( 
_rtB -> B_2_36_0 > 0.0 ) { _rtDW -> DiscreteTimeIntegrator_PrevResetState [ 
13 ] = 1 ; } else if ( _rtB -> B_2_36_0 < 0.0 ) { _rtDW -> 
DiscreteTimeIntegrator_PrevResetState [ 13 ] = - 1 ; } else if ( _rtB -> 
B_2_36_0 == 0.0 ) { _rtDW -> DiscreteTimeIntegrator_PrevResetState [ 13 ] = 0 
; } else { _rtDW -> DiscreteTimeIntegrator_PrevResetState [ 13 ] = 2 ; } if ( 
_rtB -> B_2_38_0 > 0.0 ) { _rtDW -> DiscreteTimeIntegrator_PrevResetState [ 
14 ] = 1 ; } else if ( _rtB -> B_2_38_0 < 0.0 ) { _rtDW -> 
DiscreteTimeIntegrator_PrevResetState [ 14 ] = - 1 ; } else if ( _rtB -> 
B_2_38_0 == 0.0 ) { _rtDW -> DiscreteTimeIntegrator_PrevResetState [ 14 ] = 0 
; } else { _rtDW -> DiscreteTimeIntegrator_PrevResetState [ 14 ] = 2 ; } if ( 
_rtB -> B_2_40_0 > 0.0 ) { _rtDW -> DiscreteTimeIntegrator_PrevResetState [ 
15 ] = 1 ; } else if ( _rtB -> B_2_40_0 < 0.0 ) { _rtDW -> 
DiscreteTimeIntegrator_PrevResetState [ 15 ] = - 1 ; } else if ( _rtB -> 
B_2_40_0 == 0.0 ) { _rtDW -> DiscreteTimeIntegrator_PrevResetState [ 15 ] = 0 
; } else { _rtDW -> DiscreteTimeIntegrator_PrevResetState [ 15 ] = 2 ; } if ( 
_rtB -> B_2_24_0 > 0.0 ) { _rtDW -> DiscreteTimeIntegrator_PrevResetState [ 
16 ] = 1 ; } else if ( _rtB -> B_2_24_0 < 0.0 ) { _rtDW -> 
DiscreteTimeIntegrator_PrevResetState [ 16 ] = - 1 ; } else if ( _rtB -> 
B_2_24_0 == 0.0 ) { _rtDW -> DiscreteTimeIntegrator_PrevResetState [ 16 ] = 0 
; } else { _rtDW -> DiscreteTimeIntegrator_PrevResetState [ 16 ] = 2 ; } if ( 
_rtB -> B_2_24_0 > 0.0 ) { _rtDW -> DiscreteTimeIntegrator_PrevResetState [ 
17 ] = 1 ; } else if ( _rtB -> B_2_24_0 < 0.0 ) { _rtDW -> 
DiscreteTimeIntegrator_PrevResetState [ 17 ] = - 1 ; } else if ( _rtB -> 
B_2_24_0 == 0.0 ) { _rtDW -> DiscreteTimeIntegrator_PrevResetState [ 17 ] = 0 
; } else { _rtDW -> DiscreteTimeIntegrator_PrevResetState [ 17 ] = 2 ; } 
memcpy ( & _rtDW -> UnitDelay_DSTATE_o [ 0 ] , & _rtB -> B_1_13_0 [ 0 ] , 18U 
* sizeof ( real_T ) ) ; } if ( ssIsSampleHit ( S , 4 , 0 ) ) { HoldSine = 
_rtDW -> lastSin ; _rtDW -> lastSin = _rtDW -> lastSin * _rtP -> P_32 + _rtDW 
-> lastCos * _rtP -> P_31 ; _rtDW -> lastCos = _rtDW -> lastCos * _rtP -> 
P_32 - HoldSine * _rtP -> P_31 ; HoldSine = _rtDW -> lastSin_b ; _rtDW -> 
lastSin_b = _rtDW -> lastSin_b * _rtP -> P_39 + _rtDW -> lastCos_o * _rtP -> 
P_38 ; _rtDW -> lastCos_o = _rtDW -> lastCos_o * _rtP -> P_39 - HoldSine * 
_rtP -> P_38 ; HoldSine = _rtDW -> lastSin_f ; _rtDW -> lastSin_f = _rtDW -> 
lastSin_f * _rtP -> P_46 + _rtDW -> lastCos_j * _rtP -> P_45 ; _rtDW -> 
lastCos_j = _rtDW -> lastCos_j * _rtP -> P_46 - HoldSine * _rtP -> P_45 ; } 
if ( ssIsSampleHit ( S , 2 , 0 ) ) { ssCallAccelRunBlock ( S , 2 , 49 , 
SS_CALL_MDL_UPDATE ) ; } if ( ssIsSampleHit ( S , 4 , 0 ) ) { _rtDW -> 
DiscreteTimeIntegrator_DSTATE += _rtP -> P_82 * _rtB -> B_2_174_0 ; if ( 
_rtDW -> DiscreteTimeIntegrator_DSTATE >= _rtP -> P_84 ) { _rtDW -> 
DiscreteTimeIntegrator_DSTATE = _rtP -> P_84 ; } else { if ( _rtDW -> 
DiscreteTimeIntegrator_DSTATE <= _rtP -> P_85 ) { _rtDW -> 
DiscreteTimeIntegrator_DSTATE = _rtP -> P_85 ; } } } if ( ssIsSampleHit ( S , 
4 , 0 ) ) { _rtDW -> DiscreteTimeIntegrator_DSTATE_h += _rtP -> P_89 * _rtB 
-> B_2_175_0 ; if ( _rtDW -> DiscreteTimeIntegrator_DSTATE_h >= _rtP -> P_91 
) { _rtDW -> DiscreteTimeIntegrator_DSTATE_h = _rtP -> P_91 ; } else { if ( 
_rtDW -> DiscreteTimeIntegrator_DSTATE_h <= _rtP -> P_92 ) { _rtDW -> 
DiscreteTimeIntegrator_DSTATE_h = _rtP -> P_92 ; } } } if ( ssIsSampleHit ( S 
, 4 , 0 ) ) { _rtDW -> DiscreteTimeIntegrator_DSTATE_n += _rtP -> P_98 * _rtB 
-> B_2_176_0 ; if ( _rtDW -> DiscreteTimeIntegrator_DSTATE_n >= _rtP -> P_100 
) { _rtDW -> DiscreteTimeIntegrator_DSTATE_n = _rtP -> P_100 ; } else { if ( 
_rtDW -> DiscreteTimeIntegrator_DSTATE_n <= _rtP -> P_101 ) { _rtDW -> 
DiscreteTimeIntegrator_DSTATE_n = _rtP -> P_101 ; } } } UNUSED_PARAMETER ( 
tid ) ; } 
#define MDL_ZERO_CROSSINGS 
static void mdlZeroCrossings ( SimStruct * S ) { B_svpi_T * _rtB ; P_svpi_T * 
_rtP ; ZCV_svpi_T * _rtZCSV ; _rtZCSV = ( ( ZCV_svpi_T * ) 
ssGetSolverZcSignalVector ( S ) ) ; _rtP = ( ( P_svpi_T * ) ssGetDefaultParam 
( S ) ) ; _rtB = ( ( B_svpi_T * ) _ssGetBlockIO ( S ) ) ; _rtZCSV -> 
CMP1_RelopInput_ZC = _rtB -> B_2_6_0 - _rtB -> B_0_0_1 ; _rtZCSV -> 
CMP2_RelopInput_ZC = _rtB -> B_2_6_0 - _rtB -> B_0_0_2 ; _rtZCSV -> 
CMP3_RelopInput_ZC = _rtB -> B_2_6_0 - _rtB -> B_0_0_3 ; _rtZCSV -> 
CMP4_RelopInput_ZC = _rtB -> B_2_6_0 - _rtB -> B_0_0_4 ; _rtZCSV -> 
CMP5_RelopInput_ZC = _rtB -> B_2_6_0 - _rtB -> B_0_0_5 ; _rtZCSV -> 
CMP6_RelopInput_ZC = _rtB -> B_2_6_0 - _rtB -> B_0_0_6 ; _rtZCSV -> 
Step_StepTime_ZC = ssGetT ( S ) - _rtP -> P_74 ; _rtZCSV -> Step1_StepTime_ZC 
= ssGetT ( S ) - _rtP -> P_77 ; } static void mdlInitializeSizes ( SimStruct 
* S ) { ssSetChecksumVal ( S , 0 , 3381183980U ) ; ssSetChecksumVal ( S , 1 , 
3451840261U ) ; ssSetChecksumVal ( S , 2 , 1475367255U ) ; ssSetChecksumVal ( 
S , 3 , 3965966450U ) ; { mxArray * slVerStructMat = NULL ; mxArray * 
slStrMat = mxCreateString ( "simulink" ) ; char slVerChar [ 10 ] ; int status 
= mexCallMATLAB ( 1 , & slVerStructMat , 1 , & slStrMat , "ver" ) ; if ( 
status == 0 ) { mxArray * slVerMat = mxGetField ( slVerStructMat , 0 , 
"Version" ) ; if ( slVerMat == NULL ) { status = 1 ; } else { status = 
mxGetString ( slVerMat , slVerChar , 10 ) ; } } mxDestroyArray ( slStrMat ) ; 
mxDestroyArray ( slVerStructMat ) ; if ( ( status == 1 ) || ( strcmp ( 
slVerChar , "8.1" ) != 0 ) ) { return ; } } ssSetOptions ( S , 
SS_OPTION_EXCEPTION_FREE_CODE ) ; if ( ssGetSizeofDWork ( S ) != sizeof ( 
DW_svpi_T ) ) { ssSetErrorStatus ( S , 
"Unexpected error: Internal DWork sizes do " 
"not match for accelerator mex file." ) ; } if ( ssGetSizeofGlobalBlockIO ( S 
) != sizeof ( B_svpi_T ) ) { ssSetErrorStatus ( S , 
"Unexpected error: Internal BlockIO sizes do " 
"not match for accelerator mex file." ) ; } { int ssSizeofParams ; 
ssGetSizeofParams ( S , & ssSizeofParams ) ; if ( ssSizeofParams != sizeof ( 
P_svpi_T ) ) { static char msg [ 256 ] ; sprintf ( msg , 
"Unexpected error: Internal Parameters sizes do " 
"not match for accelerator mex file." ) ; } } _ssSetDefaultParam ( S , ( 
real_T * ) & svpi_rtDefaultP ) ; rt_InitInfAndNaN ( sizeof ( real_T ) ) ; ( ( 
P_svpi_T * ) ssGetDefaultParam ( S ) ) -> P_109 = rtInf ; } static void 
mdlInitializeSampleTimes ( SimStruct * S ) { { SimStruct * childS ; 
SysOutputFcn * callSysFcns ; childS = ssGetSFunction ( S , 0 ) ; callSysFcns 
= ssGetCallSystemOutputFcnList ( childS ) ; callSysFcns [ 3 + 0 ] = ( 
SysOutputFcn ) ( NULL ) ; } } static void mdlTerminate ( SimStruct * S ) { } 
#include "simulink.c"