/*
* File: Z.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 Real-Time Workshop, the
* "wrapper" S-function technique is used. This is discussed
* in the Real-Time Workshop User's Manual in the Chapter titled,
* "Wrapper S-functions".
*
* -------------------------------------------------------------------------
* | See matlabroot/simulink/src/sfuntmpl_doc.c for a more detailed template |
* -------------------------------------------------------------------------
* Created: Thu May 8 22:41:52 2008
*
*
*/
#define S_FUNCTION_NAME Z
#define S_FUNCTION_LEVEL 2
/*<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/
/* %%%-SFUNWIZ_defines_Changes_BEGIN --- EDIT HERE TO _END */
#define NUM_INPUTS 8
/* Input Port 0 */
#define IN_PORT_0_NAME Qd_ddot
#define INPUT_0_WIDTH 2
#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_DIMS 2-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 Qd_dot
#define INPUT_1_WIDTH 2
#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_DIMS 2-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 Qd
#define INPUT_2_WIDTH 2
#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_DIMS 2-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 Q_dot
#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_DIMS 2-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
/* Input Port 4 */
#define IN_PORT_4_NAME Q
#define INPUT_4_WIDTH 2
#define INPUT_DIMS_4_COL 1
#define INPUT_4_DTYPE real_T
#define INPUT_4_COMPLEX COMPLEX_NO
#define IN_4_FRAME_BASED FRAME_NO
#define IN_4_DIMS 2-D
#define INPUT_4_FEEDTHROUGH 1
#define IN_4_ISSIGNED 0
#define IN_4_WORDLENGTH 8
#define IN_4_FIXPOINTSCALING 1
#define IN_4_FRACTIONLENGTH 9
#define IN_4_BIAS 0
#define IN_4_SLOPE 0.125
/* Input Port 5 */
#define IN_PORT_5_NAME alfa
#define INPUT_5_WIDTH 2
#define INPUT_DIMS_5_COL 1
#define INPUT_5_DTYPE real_T
#define INPUT_5_COMPLEX COMPLEX_NO
#define IN_5_FRAME_BASED FRAME_NO
#define IN_5_DIMS 2-D
#define INPUT_5_FEEDTHROUGH 1
#define IN_5_ISSIGNED 0
#define IN_5_WORDLENGTH 8
#define IN_5_FIXPOINTSCALING 1
#define IN_5_FRACTIONLENGTH 9
#define IN_5_BIAS 0
#define IN_5_SLOPE 0.125
/* Input Port 6 */
#define IN_PORT_6_NAME gamma
#define INPUT_6_WIDTH 2
#define INPUT_DIMS_6_COL 1
#define INPUT_6_DTYPE real_T
#define INPUT_6_COMPLEX COMPLEX_NO
#define IN_6_FRAME_BASED FRAME_NO
#define IN_6_DIMS 2-D
#define INPUT_6_FEEDTHROUGH 1
#define IN_6_ISSIGNED 0
#define IN_6_WORDLENGTH 8
#define IN_6_FIXPOINTSCALING 1
#define IN_6_FRACTIONLENGTH 9
#define IN_6_BIAS 0
#define IN_6_SLOPE 0.125
/* Input Port 7 */
#define IN_PORT_7_NAME integ_e
#define INPUT_7_WIDTH 2
#define INPUT_DIMS_7_COL 1
#define INPUT_7_DTYPE real_T
#define INPUT_7_COMPLEX COMPLEX_NO
#define IN_7_FRAME_BASED FRAME_NO
#define IN_7_DIMS 2-D
#define INPUT_7_FEEDTHROUGH 1
#define IN_7_ISSIGNED 0
#define IN_7_WORDLENGTH 8
#define IN_7_FIXPOINTSCALING 1
#define IN_7_FRACTIONLENGTH 9
#define IN_7_BIAS 0
#define IN_7_SLOPE 0.125
#define NUM_OUTPUTS 1
/* Output Port 0 */
#define OUT_PORT_0_NAME Z
#define OUTPUT_0_WIDTH 2
#define OUTPUT_DIMS_0_COL 5
#define OUTPUT_0_DTYPE real_T
#define OUTPUT_0_COMPLEX COMPLEX_NO
#define OUT_0_FRAME_BASED FRAME_NO
#define OUT_0_DIMS 2-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 0
#define SAMPLE_TIME_0 INHERITED_SAMPLE_TIME
#define NUM_DISC_STATES 0
#define DISC_STATES_IC [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 0
#define SAVE_CODE_ONLY 0
#define SFUNWIZ_REVISION 3.0
/* %%%-SFUNWIZ_defines_Changes_END --- EDIT HERE TO _BEGIN */
/*<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/
#include "simstruc.h"
extern void Z_Outputs_wrapper(const real_T *Qd_ddot,
const real_T *Qd_dot,
const real_T *Qd,
const real_T *Q_dot,
const real_T *Q,
const real_T *alfa,
const real_T *gamma,
const real_T *integ_e,
real_T *Z);
/*====================*
* S-function methods *
*====================*/
/* 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);
if (ssGetNumSFcnParams(S) != ssGetSFcnParamsCount(S)) {
return; /* Parameter mismatch will be reported by Simulink */
}
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*/
/*