-
Notifications
You must be signed in to change notification settings - Fork 3
/
windForceTower.c
533 lines (489 loc) · 18.5 KB
/
windForceTower.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
/*
* File: windForceTower.c
*
*
* --- THIS FILE GENERATED BY S-FUNCTION BUILDER: 3.0 ---
*
* This file is an S-function produced by the S-Function
* Builder which only recognizes certain fields. Changes made
* outside these fields will be lost the next time the block is
* used to load, edit, and resave this file. This file will be overwritten
* by the S-function Builder block. If you want to edit this file by hand,
* you must change it only in the area defined as:
*
* %%%-SFUNWIZ_defines_Changes_BEGIN
* #define NAME 'replacement text'
* %%% SFUNWIZ_defines_Changes_END
*
* DO NOT change NAME--Change the 'replacement text' only.
*
* For better compatibility with the Simulink Coder, the
* "wrapper" S-function technique is used. This is discussed
* in the Simulink Coder's Manual in the Chapter titled,
* "Wrapper S-functions".
*
* -------------------------------------------------------------------------
* | See matlabroot/simulink/src/sfuntmpl_doc.c for a more detailed template |
* -------------------------------------------------------------------------
* Created: Wed Nov 3 20:15:58 2021
*/
#define S_FUNCTION_LEVEL 2
#define S_FUNCTION_NAME windForceTower
/*<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/
/* %%%-SFUNWIZ_defines_Changes_BEGIN --- EDIT HERE TO _END */
#define NUM_INPUTS 4
/* Input Port 0 */
#define IN_PORT_0_NAME dxcm
#define INPUT_0_WIDTH 3
#define INPUT_DIMS_0_COL 1
#define INPUT_0_DTYPE real_T
#define INPUT_0_COMPLEX COMPLEX_NO
#define IN_0_FRAME_BASED FRAME_NO
#define IN_0_BUS_BASED 0
#define IN_0_BUS_NAME
#define IN_0_DIMS 1-D
#define INPUT_0_FEEDTHROUGH 1
#define IN_0_ISSIGNED 0
#define IN_0_WORDLENGTH 8
#define IN_0_FIXPOINTSCALING 1
#define IN_0_FRACTIONLENGTH 9
#define IN_0_BIAS 0
#define IN_0_SLOPE 0.125
/* Input Port 1 */
#define IN_PORT_1_NAME theta
#define INPUT_1_WIDTH 3
#define INPUT_DIMS_1_COL 1
#define INPUT_1_DTYPE real_T
#define INPUT_1_COMPLEX COMPLEX_NO
#define IN_1_FRAME_BASED FRAME_NO
#define IN_1_BUS_BASED 0
#define IN_1_BUS_NAME
#define IN_1_DIMS 1-D
#define INPUT_1_FEEDTHROUGH 1
#define IN_1_ISSIGNED 0
#define IN_1_WORDLENGTH 8
#define IN_1_FIXPOINTSCALING 1
#define IN_1_FRACTIONLENGTH 9
#define IN_1_BIAS 0
#define IN_1_SLOPE 0.125
/* Input Port 2 */
#define IN_PORT_2_NAME omega
#define INPUT_2_WIDTH 3
#define INPUT_DIMS_2_COL 1
#define INPUT_2_DTYPE real_T
#define INPUT_2_COMPLEX COMPLEX_NO
#define IN_2_FRAME_BASED FRAME_NO
#define IN_2_BUS_BASED 0
#define IN_2_BUS_NAME
#define IN_2_DIMS 1-D
#define INPUT_2_FEEDTHROUGH 1
#define IN_2_ISSIGNED 0
#define IN_2_WORDLENGTH 8
#define IN_2_FIXPOINTSCALING 1
#define IN_2_FRACTIONLENGTH 9
#define IN_2_BIAS 0
#define IN_2_SLOPE 0.125
/* Input Port 3 */
#define IN_PORT_3_NAME windSpeed
#define INPUT_3_WIDTH 2
#define INPUT_DIMS_3_COL 1
#define INPUT_3_DTYPE real_T
#define INPUT_3_COMPLEX COMPLEX_NO
#define IN_3_FRAME_BASED FRAME_NO
#define IN_3_BUS_BASED 0
#define IN_3_BUS_NAME
#define IN_3_DIMS 1-D
#define INPUT_3_FEEDTHROUGH 1
#define IN_3_ISSIGNED 0
#define IN_3_WORDLENGTH 8
#define IN_3_FIXPOINTSCALING 1
#define IN_3_FRACTIONLENGTH 9
#define IN_3_BIAS 0
#define IN_3_SLOPE 0.125
#define NUM_OUTPUTS 1
/* Output Port 0 */
#define OUT_PORT_0_NAME y0
#define OUTPUT_0_WIDTH 6
#define OUTPUT_DIMS_0_COL 1
#define OUTPUT_0_DTYPE real_T
#define OUTPUT_0_COMPLEX COMPLEX_NO
#define OUT_0_FRAME_BASED FRAME_NO
#define OUT_0_BUS_BASED 0
#define OUT_0_BUS_NAME
#define OUT_0_DIMS 1-D
#define OUT_0_ISSIGNED 1
#define OUT_0_WORDLENGTH 8
#define OUT_0_FIXPOINTSCALING 1
#define OUT_0_FRACTIONLENGTH 3
#define OUT_0_BIAS 0
#define OUT_0_SLOPE 0.125
#define NPARAMS 6
/* Parameter 1 */
#define PARAMETER_0_NAME towerR
#define PARAMETER_0_DTYPE real_T
#define PARAMETER_0_COMPLEX COMPLEX_NO
/* Parameter 2 */
#define PARAMETER_1_NAME towerL
#define PARAMETER_1_DTYPE real_T
#define PARAMETER_1_COMPLEX COMPLEX_NO
/* Parameter 3 */
#define PARAMETER_2_NAME windAlpha
#define PARAMETER_2_DTYPE real_T
#define PARAMETER_2_COMPLEX COMPLEX_NO
/* Parameter 4 */
#define PARAMETER_3_NAME rho
#define PARAMETER_3_DTYPE real_T
#define PARAMETER_3_COMPLEX COMPLEX_NO
/* Parameter 5 */
#define PARAMETER_4_NAME Cd
#define PARAMETER_4_DTYPE real_T
#define PARAMETER_4_COMPLEX COMPLEX_NO
/* Parameter 6 */
#define PARAMETER_5_NAME CoA
#define PARAMETER_5_DTYPE real_T
#define PARAMETER_5_COMPLEX COMPLEX_NO
#define SAMPLE_TIME_0 0.2
#define NUM_DISC_STATES 24
#define DISC_STATES_IC [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
#define NUM_CONT_STATES 0
#define CONT_STATES_IC [0]
#define SFUNWIZ_GENERATE_TLC 1
#define SOURCEFILES "__SFB__"
#define PANELINDEX 6
#define USE_SIMSTRUCT 0
#define SHOW_COMPILE_STEPS 0
#define CREATE_DEBUG_MEXFILE 1
#define SAVE_CODE_ONLY 0
#define SFUNWIZ_REVISION 3.0
/* %%%-SFUNWIZ_defines_Changes_END --- EDIT HERE TO _BEGIN */
/*<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/
#include "simstruc.h"
#define PARAM_DEF0(S) ssGetSFcnParam(S, 0)
#define PARAM_DEF1(S) ssGetSFcnParam(S, 1)
#define PARAM_DEF2(S) ssGetSFcnParam(S, 2)
#define PARAM_DEF3(S) ssGetSFcnParam(S, 3)
#define PARAM_DEF4(S) ssGetSFcnParam(S, 4)
#define PARAM_DEF5(S) ssGetSFcnParam(S, 5)
#define IS_PARAM_DOUBLE(pVal) (mxIsNumeric(pVal) && !mxIsLogical(pVal) &&\
!mxIsEmpty(pVal) && !mxIsSparse(pVal) && !mxIsComplex(pVal) && mxIsDouble(pVal))
extern void windForceTower_Outputs_wrapper(const real_T *dxcm,
const real_T *theta,
const real_T *omega,
const real_T *windSpeed,
real_T *y0,
const real_T *xD,
const real_T *towerR, const int_T p_width0,
const real_T *towerL, const int_T p_width1,
const real_T *windAlpha, const int_T p_width2,
const real_T *rho, const int_T p_width3,
const real_T *Cd, const int_T p_width4,
const real_T *CoA, const int_T p_width5);
extern void windForceTower_Update_wrapper(const real_T *dxcm,
const real_T *theta,
const real_T *omega,
const real_T *windSpeed,
const real_T *y0,
real_T *xD,
const real_T *towerR, const int_T p_width0,
const real_T *towerL, const int_T p_width1,
const real_T *windAlpha, const int_T p_width2,
const real_T *rho, const int_T p_width3,
const real_T *Cd, const int_T p_width4,
const real_T *CoA, const int_T p_width5);
/*====================*
* S-function methods *
*====================*/
#define MDL_CHECK_PARAMETERS
#if defined(MDL_CHECK_PARAMETERS) && defined(MATLAB_MEX_FILE)
/* Function: mdlCheckParameters =============================================
* Abstract:
* Validate our parameters to verify they are okay.
*/
static void mdlCheckParameters(SimStruct *S)
{
int paramIndex = 0;
bool validParam = false;
/* All parameters must match the S-function Builder Dialog */
{
const mxArray *pVal0 = ssGetSFcnParam(S,0);
if (!IS_PARAM_DOUBLE(pVal0)) {
validParam = true;
paramIndex = 0;
goto EXIT_POINT;
}
}
{
const mxArray *pVal1 = ssGetSFcnParam(S,1);
if (!IS_PARAM_DOUBLE(pVal1)) {
validParam = true;
paramIndex = 1;
goto EXIT_POINT;
}
}
{
const mxArray *pVal2 = ssGetSFcnParam(S,2);
if (!IS_PARAM_DOUBLE(pVal2)) {
validParam = true;
paramIndex = 2;
goto EXIT_POINT;
}
}
{
const mxArray *pVal3 = ssGetSFcnParam(S,3);
if (!IS_PARAM_DOUBLE(pVal3)) {
validParam = true;
paramIndex = 3;
goto EXIT_POINT;
}
}
{
const mxArray *pVal4 = ssGetSFcnParam(S,4);
if (!IS_PARAM_DOUBLE(pVal4)) {
validParam = true;
paramIndex = 4;
goto EXIT_POINT;
}
}
{
const mxArray *pVal5 = ssGetSFcnParam(S,5);
if (!IS_PARAM_DOUBLE(pVal5)) {
validParam = true;
paramIndex = 5;
goto EXIT_POINT;
}
}
EXIT_POINT:
if (validParam) {
char parameterErrorMsg[1024];
sprintf(parameterErrorMsg, "The data type and or complexity of parameter %d does not match the "
"information specified in the S-function Builder dialog. "
"For non-double parameters you will need to cast them using int8, int16, "
"int32, uint8, uint16, uint32 or boolean.", paramIndex + 1);
ssSetErrorStatus(S,parameterErrorMsg);
}
return;
}
#endif /* MDL_CHECK_PARAMETERS */
/* Function: mdlInitializeSizes ===============================================
* Abstract:
* Setup sizes of the various vectors.
*/
static void mdlInitializeSizes(SimStruct *S)
{
DECL_AND_INIT_DIMSINFO(inputDimsInfo);
DECL_AND_INIT_DIMSINFO(outputDimsInfo);
ssSetNumSFcnParams(S, NPARAMS); /* Number of expected parameters */
#if defined(MATLAB_MEX_FILE)
if (ssGetNumSFcnParams(S) == ssGetSFcnParamsCount(S)) {
mdlCheckParameters(S);
if (ssGetErrorStatus(S) != NULL) {
return;
}
} else {
return; /* Parameter mismatch will be reported by Simulink */
}
#endif
ssSetNumContStates(S, NUM_CONT_STATES);
ssSetNumDiscStates(S, NUM_DISC_STATES);
if (!ssSetNumInputPorts(S, NUM_INPUTS)) return;
/*Input Port 0 */
ssSetInputPortWidth(S, 0, INPUT_0_WIDTH);
ssSetInputPortDataType(S, 0, SS_DOUBLE);
ssSetInputPortComplexSignal(S, 0, INPUT_0_COMPLEX);
ssSetInputPortDirectFeedThrough(S, 0, INPUT_0_FEEDTHROUGH);
ssSetInputPortRequiredContiguous(S, 0, 1); /*direct input signal access*/
/*Input Port 1 */
ssSetInputPortWidth(S, 1, INPUT_1_WIDTH);
ssSetInputPortDataType(S, 1, SS_DOUBLE);
ssSetInputPortComplexSignal(S, 1, INPUT_1_COMPLEX);
ssSetInputPortDirectFeedThrough(S, 1, INPUT_1_FEEDTHROUGH);
ssSetInputPortRequiredContiguous(S, 1, 1); /*direct input signal access*/
/*Input Port 2 */
ssSetInputPortWidth(S, 2, INPUT_2_WIDTH);
ssSetInputPortDataType(S, 2, SS_DOUBLE);
ssSetInputPortComplexSignal(S, 2, INPUT_2_COMPLEX);
ssSetInputPortDirectFeedThrough(S, 2, INPUT_2_FEEDTHROUGH);
ssSetInputPortRequiredContiguous(S, 2, 1); /*direct input signal access*/
/*Input Port 3 */
ssSetInputPortWidth(S, 3, INPUT_3_WIDTH);
ssSetInputPortDataType(S, 3, SS_DOUBLE);
ssSetInputPortComplexSignal(S, 3, INPUT_3_COMPLEX);
ssSetInputPortDirectFeedThrough(S, 3, INPUT_3_FEEDTHROUGH);
ssSetInputPortRequiredContiguous(S, 3, 1); /*direct input signal access*/
if (!ssSetNumOutputPorts(S, NUM_OUTPUTS)) return;
ssSetOutputPortWidth(S, 0, OUTPUT_0_WIDTH);
ssSetOutputPortDataType(S, 0, SS_DOUBLE);
ssSetOutputPortComplexSignal(S, 0, OUTPUT_0_COMPLEX);
ssSetNumSampleTimes(S, 1);
ssSetNumRWork(S, 0);
ssSetNumIWork(S, 0);
ssSetNumPWork(S, 0);
ssSetNumModes(S, 0);
ssSetNumNonsampledZCs(S, 0);
ssSetSimulinkVersionGeneratedIn(S, "8.6");
/* Take care when specifying exception free code - see sfuntmpl_doc.c */
ssSetOptions(S, (SS_OPTION_EXCEPTION_FREE_CODE |
SS_OPTION_USE_TLC_WITH_ACCELERATOR |
SS_OPTION_WORKS_WITH_CODE_REUSE));
}
#if defined(MATLAB_MEX_FILE)
#define MDL_SET_INPUT_PORT_DIMENSION_INFO
static void mdlSetInputPortDimensionInfo(SimStruct *S,
int_T port,
const DimsInfo_T *dimsInfo)
{
if(!ssSetInputPortDimensionInfo(S, port, dimsInfo)) return;
}
#endif
#define MDL_SET_OUTPUT_PORT_DIMENSION_INFO
#if defined(MDL_SET_OUTPUT_PORT_DIMENSION_INFO)
static void mdlSetOutputPortDimensionInfo(SimStruct *S,
int_T port,
const DimsInfo_T *dimsInfo)
{
if (!ssSetOutputPortDimensionInfo(S, port, dimsInfo)) return;
}
#endif
# define MDL_SET_INPUT_PORT_FRAME_DATA
static void mdlSetInputPortFrameData(SimStruct *S,
int_T port,
Frame_T frameData)
{
ssSetInputPortFrameData(S, port, frameData);
}
/* Function: mdlInitializeSampleTimes =========================================
* Abstract:
* Specifiy the sample time.
*/
static void mdlInitializeSampleTimes(SimStruct *S)
{
ssSetSampleTime(S, 0, SAMPLE_TIME_0);
ssSetModelReferenceSampleTimeDefaultInheritance(S);
ssSetOffsetTime(S, 0, 0.0);
}
#define MDL_INITIALIZE_CONDITIONS
/* Function: mdlInitializeConditions ========================================
* Abstract:
* Initialize the states
*/
static void mdlInitializeConditions(SimStruct *S)
{
real_T *xD = ssGetRealDiscStates(S);
xD[0] = 0;
xD[1] = 0;
xD[2] = 0;
xD[3] = 0;
xD[4] = 0;
xD[5] = 0;
xD[6] = 0;
xD[7] = 0;
xD[8] = 0;
xD[9] = 0;
xD[10] = 0;
xD[11] = 0;
xD[12] = 0;
xD[13] = 0;
xD[14] = 0;
xD[15] = 0;
xD[16] = 0;
xD[17] = 0;
xD[18] = 0;
xD[19] = 0;
xD[20] = 0;
xD[21] = 0;
xD[22] = 0;
xD[23] = 0;
}
#define MDL_SET_INPUT_PORT_DATA_TYPE
static void mdlSetInputPortDataType(SimStruct *S, int port, DTypeId dType)
{
ssSetInputPortDataType( S, 0, dType);
}
#define MDL_SET_OUTPUT_PORT_DATA_TYPE
static void mdlSetOutputPortDataType(SimStruct *S, int port, DTypeId dType)
{
ssSetOutputPortDataType(S, 0, dType);
}
#define MDL_SET_DEFAULT_PORT_DATA_TYPES
static void mdlSetDefaultPortDataTypes(SimStruct *S)
{
ssSetInputPortDataType( S, 0, SS_DOUBLE);
ssSetOutputPortDataType(S, 0, SS_DOUBLE);
}
#define MDL_SET_WORK_WIDTHS
#if defined(MDL_SET_WORK_WIDTHS) && defined(MATLAB_MEX_FILE)
static void mdlSetWorkWidths(SimStruct *S)
{
const char_T *rtParamNames[] = {"P1","P2","P3","P4","P5","P6"};
ssRegAllTunableParamsAsRunTimeParams(S, rtParamNames);
}
#endif
/* Function: mdlOutputs =======================================================
*
*/
static void mdlOutputs(SimStruct *S, int_T tid)
{
const real_T *dxcm = (const real_T*) ssGetInputPortSignal(S,0);
const real_T *theta = (const real_T*) ssGetInputPortSignal(S,1);
const real_T *omega = (const real_T*) ssGetInputPortSignal(S,2);
const real_T *windSpeed = (const real_T*) ssGetInputPortSignal(S,3);
real_T *y0 = (real_T *)ssGetOutputPortRealSignal(S,0);
const real_T *xD = ssGetDiscStates(S);
const int_T p_width0 = mxGetNumberOfElements(PARAM_DEF0(S));
const int_T p_width1 = mxGetNumberOfElements(PARAM_DEF1(S));
const int_T p_width2 = mxGetNumberOfElements(PARAM_DEF2(S));
const int_T p_width3 = mxGetNumberOfElements(PARAM_DEF3(S));
const int_T p_width4 = mxGetNumberOfElements(PARAM_DEF4(S));
const int_T p_width5 = mxGetNumberOfElements(PARAM_DEF5(S));
const real_T *towerR = (const real_T *)mxGetData(PARAM_DEF0(S));
const real_T *towerL = (const real_T *)mxGetData(PARAM_DEF1(S));
const real_T *windAlpha = (const real_T *)mxGetData(PARAM_DEF2(S));
const real_T *rho = (const real_T *)mxGetData(PARAM_DEF3(S));
const real_T *Cd = (const real_T *)mxGetData(PARAM_DEF4(S));
const real_T *CoA = (const real_T *)mxGetData(PARAM_DEF5(S));
windForceTower_Outputs_wrapper(dxcm, theta, omega, windSpeed, y0, xD, towerR, p_width0, towerL, p_width1, windAlpha, p_width2, rho, p_width3, Cd, p_width4, CoA, p_width5);
}
#define MDL_UPDATE /* Change to #undef to remove function */
/* Function: mdlUpdate ======================================================
* Abstract:
* This function is called once for every major integration time step.
* Discrete states are typically updated here, but this function is useful
* for performing any tasks that should only take place once per
* integration step.
*/
static void mdlUpdate(SimStruct *S, int_T tid)
{
real_T *xD = ssGetDiscStates(S);
const real_T *dxcm = (const real_T*) ssGetInputPortSignal(S,0);
const real_T *theta = (const real_T*) ssGetInputPortSignal(S,1);
const real_T *omega = (const real_T*) ssGetInputPortSignal(S,2);
const real_T *windSpeed = (const real_T*) ssGetInputPortSignal(S,3);
real_T *y0 = (real_T *)ssGetOutputPortRealSignal(S,0);
const int_T p_width0 = mxGetNumberOfElements(PARAM_DEF0(S));
const int_T p_width1 = mxGetNumberOfElements(PARAM_DEF1(S));
const int_T p_width2 = mxGetNumberOfElements(PARAM_DEF2(S));
const int_T p_width3 = mxGetNumberOfElements(PARAM_DEF3(S));
const int_T p_width4 = mxGetNumberOfElements(PARAM_DEF4(S));
const int_T p_width5 = mxGetNumberOfElements(PARAM_DEF5(S));
const real_T *towerR = (const real_T *)mxGetData(PARAM_DEF0(S));
const real_T *towerL = (const real_T *)mxGetData(PARAM_DEF1(S));
const real_T *windAlpha = (const real_T *)mxGetData(PARAM_DEF2(S));
const real_T *rho = (const real_T *)mxGetData(PARAM_DEF3(S));
const real_T *Cd = (const real_T *)mxGetData(PARAM_DEF4(S));
const real_T *CoA = (const real_T *)mxGetData(PARAM_DEF5(S));
windForceTower_Update_wrapper(dxcm, theta, omega, windSpeed, y0, xD, towerR, p_width0, towerL, p_width1, windAlpha, p_width2, rho, p_width3, Cd, p_width4, CoA, p_width5);
}
/* Function: mdlTerminate =====================================================
* Abstract:
* In this function, you should perform any actions that are necessary
* at the termination of a simulation. For example, if memory was
* allocated in mdlStart, this is the place to free it.
*/
static void mdlTerminate(SimStruct *S)
{
}
#ifdef MATLAB_MEX_FILE /* Is this file being compiled as a MEX-file? */
#include "simulink.c" /* MEX-file interface mechanism */
#else
#include "cg_sfun.h" /* Code generation registration function */
#endif