File: bh_f14.h1 /* 2 * File: bh_f14.h 3 * 4 * Code generated for Simulink model 'bh_f14'. 5 * 6 * Model version : 1.18 7 * Simulink Coder version : 8.10 (R2016a) 10-Feb-2016 8 * C/C++ source code generated on : Wed Jun 22 07:56:08 2016 9 * 10 * Target selection: ert.tlc 11 * Embedded hardware selection: 32-bit Generic 12 * Code generation objectives: Unspecified 13 * Validation result: Not run 14 */ 15 16 #ifndef RTW_HEADER_bh_f14_h_ 17 #define RTW_HEADER_bh_f14_h_ 18 #include <math.h> 19 #include <string.h> 20 #ifndef bh_f14_COMMON_INCLUDES_ 21 # define bh_f14_COMMON_INCLUDES_ 22 #include "rtwtypes.h" 23 #include "rtw_continuous.h" 24 #include "rtw_solver.h" 25 #endif /* bh_f14_COMMON_INCLUDES_ */ 26 27 #include "bh_f14_types.h" 28 #include "rtGetInf.h" 29 #include "rt_nonfinite.h" 30 #include "rt_defines.h" 31 32 /* Macros for accessing real-time model data structure */ 33 #ifndef rtmGetErrorStatus 34 # define rtmGetErrorStatus(rtm) ((rtm)->errorStatus) 35 #endif 36 37 #ifndef rtmSetErrorStatus 38 # define rtmSetErrorStatus(rtm, val) ((rtm)->errorStatus = (val)) 39 #endif 40 41 #ifndef rtmGetStopRequested 42 # define rtmGetStopRequested(rtm) ((rtm)->Timing.stopRequestedFlag) 43 #endif 44 45 #ifndef rtmSetStopRequested 46 # define rtmSetStopRequested(rtm, val) ((rtm)->Timing.stopRequestedFlag = (val)) 47 #endif 48 49 #ifndef rtmGetStopRequestedPtr 50 # define rtmGetStopRequestedPtr(rtm) (&((rtm)->Timing.stopRequestedFlag)) 51 #endif 52 53 #ifndef rtmGetT 54 # define rtmGetT(rtm) (rtmGetTPtr((rtm))[0]) 55 #endif 56 57 /* Block signals (auto storage) */ 58 typedef struct { 59 real_T TransferFcn2; /* '<S3>/Transfer Fcn.2' */ 60 real_T Gain5; /* '<Root>/Gain5' */ 61 real_T TransferFcn1; /* '<S3>/Transfer Fcn.1' */ 62 real_T Gain2; /* '<S2>/Gain2' */ 63 real_T Sum1; /* '<Root>/Sum1' */ 64 real_T Sum2; /* '<S1>/Sum2' */ 65 real_T Sum; /* '<S1>/Sum' */ 66 real_T Wgustmodel; /* '<S4>/W-gust model' */ 67 real_T Sum1_o; /* '<S3>/Sum1' */ 68 real_T Sum2_h; /* '<S3>/Sum2' */ 69 real_T Output; /* '<S5>/Output' */ 70 } B_bh_f14_T; 71 72 /* Block states (auto storage) for system '<Root>' */ 73 typedef struct { 74 real_T TimeStampA; /* '<S2>/Derivative' */ 75 real_T LastUAtTimeA; /* '<S2>/Derivative' */ 76 real_T TimeStampB; /* '<S2>/Derivative' */ 77 real_T LastUAtTimeB; /* '<S2>/Derivative' */ 78 real_T TimeStampA_o; /* '<S2>/Derivative1' */ 79 real_T LastUAtTimeA_i; /* '<S2>/Derivative1' */ 80 real_T TimeStampB_h; /* '<S2>/Derivative1' */ 81 real_T LastUAtTimeB_j; /* '<S2>/Derivative1' */ 82 real_T NextOutput; /* '<S5>/White Noise' */ 83 struct { 84 void *LoggedData; 85 } AngleofAttack_PWORK; /* '<Root>/Angle of Attack' */ 86 87 struct { 88 void *LoggedData; 89 } PilotGforceScope_PWORK; /* '<Root>/Pilot G force Scope' */ 90 91 struct { 92 void *LoggedData; 93 } StickInput_PWORK; /* '<Root>/Stick Input' */ 94 95 uint32_T RandSeed; /* '<S5>/White Noise' */ 96 } DW_bh_f14_T; 97 98 /* Continuous states (auto storage) */ 99 typedef struct { 100 real_T TransferFcn2_CSTATE; /* '<S3>/Transfer Fcn.2' */ 101 real_T TransferFcn1_CSTATE; /* '<S3>/Transfer Fcn.1' */ 102 real_T Actuator_CSTATE; /* '<Root>/Actuator' */ 103 real_T AlphasensorLowpassFilter_CSTATE;/* '<S1>/Alpha-sensor Low-pass Filter' */ 104 real_T StickPrefilter_CSTATE; /* '<S1>/Stick Prefilter' */ 105 real_T PitchRateLeadFilter_CSTATE; /* '<S1>/Pitch Rate Lead Filter' */ 106 real_T Proportionalplusintegralcompens;/* '<S1>/Proportional plus integral compensator' */ 107 real_T Wgustmodel_CSTATE[2]; /* '<S4>/W-gust model' */ 108 real_T Qgustmodel_CSTATE; /* '<S4>/Q-gust model' */ 109 } X_bh_f14_T; 110 111 /* State derivatives (auto storage) */ 112 typedef struct { 113 real_T TransferFcn2_CSTATE; /* '<S3>/Transfer Fcn.2' */ 114 real_T TransferFcn1_CSTATE; /* '<S3>/Transfer Fcn.1' */ 115 real_T Actuator_CSTATE; /* '<Root>/Actuator' */ 116 real_T AlphasensorLowpassFilter_CSTATE;/* '<S1>/Alpha-sensor Low-pass Filter' */ 117 real_T StickPrefilter_CSTATE; /* '<S1>/Stick Prefilter' */ 118 real_T PitchRateLeadFilter_CSTATE; /* '<S1>/Pitch Rate Lead Filter' */ 119 real_T Proportionalplusintegralcompens;/* '<S1>/Proportional plus integral compensator' */ 120 real_T Wgustmodel_CSTATE[2]; /* '<S4>/W-gust model' */ 121 real_T Qgustmodel_CSTATE; /* '<S4>/Q-gust model' */ 122 } XDot_bh_f14_T; 123 124 /* State disabled */ 125 typedef struct { 126 boolean_T TransferFcn2_CSTATE; /* '<S3>/Transfer Fcn.2' */ 127 boolean_T TransferFcn1_CSTATE; /* '<S3>/Transfer Fcn.1' */ 128 boolean_T Actuator_CSTATE; /* '<Root>/Actuator' */ 129 boolean_T AlphasensorLowpassFilter_CSTATE;/* '<S1>/Alpha-sensor Low-pass Filter' */ 130 boolean_T StickPrefilter_CSTATE; /* '<S1>/Stick Prefilter' */ 131 boolean_T PitchRateLeadFilter_CSTATE;/* '<S1>/Pitch Rate Lead Filter' */ 132 boolean_T Proportionalplusintegralcompens;/* '<S1>/Proportional plus integral compensator' */ 133 boolean_T Wgustmodel_CSTATE[2]; /* '<S4>/W-gust model' */ 134 boolean_T Qgustmodel_CSTATE; /* '<S4>/Q-gust model' */ 135 } XDis_bh_f14_T; 136 137 #ifndef ODE4_INTG 138 #define ODE4_INTG 139 140 /* ODE4 Integration Data */ 141 typedef struct { 142 real_T *y; /* output */ 143 real_T *f[4]; /* derivatives */ 144 } ODE4_IntgData; 145 146 #endif 147 148 /* Real-time Model Data Structure */ 149 struct tag_RTM_bh_f14_T { 150 const char_T *errorStatus; 151 RTWSolverInfo solverInfo; 152 153 /* 154 * ModelData: 155 * The following substructure contains information regarding 156 * the data used in the model. 157 */ 158 struct { 159 B_bh_f14_T *blockIO; 160 X_bh_f14_T *contStates; 161 int_T *periodicContStateIndices; 162 real_T *periodicContStateRanges; 163 real_T *derivs; 164 boolean_T *contStateDisabled; 165 boolean_T zCCacheNeedsReset; 166 boolean_T derivCacheNeedsReset; 167 boolean_T blkStateChange; 168 real_T odeY[10]; 169 real_T odeF[4][10]; 170 ODE4_IntgData intgData; 171 DW_bh_f14_T *dwork; 172 } ModelData; 173 174 /* 175 * Sizes: 176 * The following substructure contains sizes information 177 * for many of the model attributes such as inputs, outputs, 178 * dwork, sample times, etc. 179 */ 180 struct { 181 int_T numContStates; 182 int_T numPeriodicContStates; 183 int_T numSampTimes; 184 } Sizes; 185 186 /* 187 * Timing: 188 * The following substructure contains information regarding 189 * the timing information for the model. 190 */ 191 struct { 192 uint32_T clockTick0; 193 time_T stepSize0; 194 uint32_T clockTick1; 195 struct { 196 uint8_T TID[3]; 197 } TaskCounters; 198 199 SimTimeStep simTimeStep; 200 boolean_T stopRequestedFlag; 201 time_T *t; 202 time_T tArray[3]; 203 } Timing; 204 }; 205 206 /* Model entry point functions */ 207 extern void bh_f14_initialize(RT_MODEL_bh_f14_T *const bh_f14_M, real_T 208 *bh_f14_U_u, real_T *bh_f14_Y_alpharad, real_T *bh_f14_Y_NzPilotg); 209 extern void bh_f14_step(RT_MODEL_bh_f14_T *const bh_f14_M, real_T bh_f14_U_u, 210 real_T *bh_f14_Y_alpharad, real_T *bh_f14_Y_NzPilotg); 211 extern void bh_f14_terminate(RT_MODEL_bh_f14_T *const bh_f14_M); 212 213 /*- 214 * The generated code includes comments that allow you to trace directly 215 * back to the appropriate location in the model. The basic format 216 * is <system>/block_name, where system is the system number (uniquely 217 * assigned by Simulink) and block_name is the name of the block. 218 * 219 * Use the MATLAB hilite_system command to trace the generated code back 220 * to the model. For example, 221 * 222 * hilite_system('<S3>') - opens system 3 223 * hilite_system('<S3>/Kp') - opens and selects block Kp which resides in S3 224 * 225 * Here is the system hierarchy for this model 226 * 227 * '<Root>' : 'bh_f14' 228 * '<S1>' : 'bh_f14/Controller' 229 * '<S2>' : 'bh_f14/Nz pilot calculation' 230 * '<S3>' : 'bh_f14/Plant' 231 * '<S4>' : 'bh_f14/Wind' 232 * '<S5>' : 'bh_f14/Wind/Band-Limited White Noise' 233 */ 234 #endif /* RTW_HEADER_bh_f14_h_ */ 235 236 /* 237 * File trailer for generated code. 238 * 239 * [EOF] 240 */ 241 |