diff --git a/NetworkExplorer.pdb/EC2B7B4E33124335BC167982A69380BE2/NetworkExplorer.pd_ b/NetworkExplorer.pdb/EC2B7B4E33124335BC167982A69380BE2/NetworkExplorer.pd_ new file mode 100644 index 0000000..e69de29 diff --git a/code/AirWaterCoolerPTF.mexw64 b/code/AirWaterCoolerPTF.mexw64 index 22b0df9..458747b 100644 Binary files a/code/AirWaterCoolerPTF.mexw64 and b/code/AirWaterCoolerPTF.mexw64 differ diff --git a/code/CombWiebe.mexw64 b/code/CombWiebe.mexw64 index 0fedfea..ac5c6c7 100644 Binary files a/code/CombWiebe.mexw64 and b/code/CombWiebe.mexw64 differ diff --git a/code/EngCylHeatTransfer.mexw64 b/code/EngCylHeatTransfer.mexw64 index fa4226b..78eae25 100644 Binary files a/code/EngCylHeatTransfer.mexw64 and b/code/EngCylHeatTransfer.mexw64 differ diff --git a/code/EngCylHeatTransferSSTune.mexw64 b/code/EngCylHeatTransferSSTune.mexw64 index 9312ddb..a674171 100644 Binary files a/code/EngCylHeatTransferSSTune.mexw64 and b/code/EngCylHeatTransferSSTune.mexw64 differ diff --git a/code/EngineControlSystem.mexw64 b/code/EngineControlSystem.mexw64 index 54cb09e..4c970bc 100644 Binary files a/code/EngineControlSystem.mexw64 and b/code/EngineControlSystem.mexw64 differ diff --git a/code/GetExhVVArea.mexw64 b/code/GetExhVVArea.mexw64 index 5814d9a..c50743c 100644 Binary files a/code/GetExhVVArea.mexw64 and b/code/GetExhVVArea.mexw64 differ diff --git a/code/GetExhVVLift.mexw64 b/code/GetExhVVLift.mexw64 index 57efd48..c889f9a 100644 Binary files a/code/GetExhVVLift.mexw64 and b/code/GetExhVVLift.mexw64 differ diff --git a/code/GetInportArea.mexw64 b/code/GetInportArea.mexw64 index e4a3cc2..fcb98b7 100644 Binary files a/code/GetInportArea.mexw64 and b/code/GetInportArea.mexw64 differ diff --git a/code/GetIntakeVVArea.mexw64 b/code/GetIntakeVVArea.mexw64 index 910a59a..f6dad2a 100644 Binary files a/code/GetIntakeVVArea.mexw64 and b/code/GetIntakeVVArea.mexw64 differ diff --git a/code/GetThdynCombGasZachSFunc.mexw64 b/code/GetThdynCombGasZachSFunc.mexw64 index 87e6d85..47b1681 100644 Binary files a/code/GetThdynCombGasZachSFunc.mexw64 and b/code/GetThdynCombGasZachSFunc.mexw64 differ diff --git a/code/GetVVLift.mexw64 b/code/GetVVLift.mexw64 index 3f7e8f5..da658c9 100644 Binary files a/code/GetVVLift.mexw64 and b/code/GetVVLift.mexw64 differ diff --git a/code/IdealNozzlePTF.mexw64 b/code/IdealNozzlePTF.mexw64 index a1bd1cc..042b446 100644 Binary files a/code/IdealNozzlePTF.mexw64 and b/code/IdealNozzlePTF.mexw64 differ diff --git a/code/InCylinderMV.mexw64 b/code/InCylinderMV.mexw64 index ba3109a..ff5ef93 100644 Binary files a/code/InCylinderMV.mexw64 and b/code/InCylinderMV.mexw64 differ diff --git a/code/SpeedController.mexw64 b/code/SpeedController.mexw64 index 8532c7c..0b53449 100644 Binary files a/code/SpeedController.mexw64 and b/code/SpeedController.mexw64 differ diff --git a/code/ThdynCV.mexw64 b/code/ThdynCV.mexw64 index 2e0c86a..f245088 100644 Binary files a/code/ThdynCV.mexw64 and b/code/ThdynCV.mexw64 differ diff --git a/code/ThdynCV2ZoneConv.mexw64 b/code/ThdynCV2ZoneConv.mexw64 index e3fe64b..177b7b0 100644 Binary files a/code/ThdynCV2ZoneConv.mexw64 and b/code/ThdynCV2ZoneConv.mexw64 differ diff --git a/code/ThdynCV2ZoneConv.mexw64.pdb b/code/ThdynCV2ZoneConv.mexw64.pdb new file mode 100644 index 0000000..d74bac6 Binary files /dev/null and b/code/ThdynCV2ZoneConv.mexw64.pdb differ diff --git a/code/ThdynCVConv.mexw64 b/code/ThdynCVConv.mexw64 index 899cb36..a925635 100644 Binary files a/code/ThdynCVConv.mexw64 and b/code/ThdynCVConv.mexw64 differ diff --git a/code/ThdynCVConvDX.mexw64 b/code/ThdynCVConvDX.mexw64 new file mode 100644 index 0000000..613b4d3 Binary files /dev/null and b/code/ThdynCVConvDX.mexw64 differ diff --git a/code/ThdynCVConvDX.mexw64.pdb b/code/ThdynCVConvDX.mexw64.pdb new file mode 100644 index 0000000..4e1cf82 Binary files /dev/null and b/code/ThdynCVConvDX.mexw64.pdb differ diff --git a/code/ThdynCVNV.mexw64 b/code/ThdynCVNV.mexw64 index fc493cd..3fe9654 100644 Binary files a/code/ThdynCVNV.mexw64 and b/code/ThdynCVNV.mexw64 differ diff --git a/code/blower.mexw64 b/code/blower.mexw64 index 3fb1d9f..41bd645 100644 Binary files a/code/blower.mexw64 and b/code/blower.mexw64 differ diff --git a/code/c_code/SFB__ThdynCVConvDX__SFB.mat b/code/c_code/SFB__ThdynCVConvDX__SFB.mat new file mode 100644 index 0000000..6f4afc8 Binary files /dev/null and b/code/c_code/SFB__ThdynCVConvDX__SFB.mat differ diff --git a/code/c_code/ThdynCVConv1.c b/code/c_code/ThdynCVConv1.c new file mode 100644 index 0000000..7fa8670 --- /dev/null +++ b/code/c_code/ThdynCVConv1.c @@ -0,0 +1,597 @@ +/* + * File: ThdynCVConv.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: Mon Sep 8 13:42:35 2014 + * + * + */ + +#define S_FUNCTION_LEVEL 2 +#define S_FUNCTION_NAME ThdynCVConv1 +/*<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/ +/* %%%-SFUNWIZ_defines_Changes_BEGIN --- EDIT HERE TO _END */ +#define NUM_INPUTS 4 +/* Input Port 0 */ +#define IN_PORT_0_NAME dm +#define INPUT_0_WIDTH 1 +#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 dE +#define INPUT_1_WIDTH 1 +#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 dmf +#define INPUT_2_WIDTH 1 +#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 dV +#define INPUT_3_WIDTH 1 +#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 7 +/* Output Port 0 */ +#define OUT_PORT_0_NAME p +#define OUTPUT_0_WIDTH 1 +#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 +/* Output Port 1 */ +#define OUT_PORT_1_NAME T +#define OUTPUT_1_WIDTH 1 +#define OUTPUT_DIMS_1_COL 1 +#define OUTPUT_1_DTYPE real_T +#define OUTPUT_1_COMPLEX COMPLEX_NO +#define OUT_1_FRAME_BASED FRAME_NO +#define OUT_1_BUS_BASED 0 +#define OUT_1_BUS_NAME +#define OUT_1_DIMS 1-D +#define OUT_1_ISSIGNED 1 +#define OUT_1_WORDLENGTH 8 +#define OUT_1_FIXPOINTSCALING 1 +#define OUT_1_FRACTIONLENGTH 3 +#define OUT_1_BIAS 0 +#define OUT_1_SLOPE 0.125 +/* Output Port 2 */ +#define OUT_PORT_2_NAME F +#define OUTPUT_2_WIDTH 1 +#define OUTPUT_DIMS_2_COL 1 +#define OUTPUT_2_DTYPE real_T +#define OUTPUT_2_COMPLEX COMPLEX_NO +#define OUT_2_FRAME_BASED FRAME_NO +#define OUT_2_BUS_BASED 0 +#define OUT_2_BUS_NAME +#define OUT_2_DIMS 1-D +#define OUT_2_ISSIGNED 1 +#define OUT_2_WORDLENGTH 8 +#define OUT_2_FIXPOINTSCALING 1 +#define OUT_2_FRACTIONLENGTH 3 +#define OUT_2_BIAS 0 +#define OUT_2_SLOPE 0.125 +/* Output Port 3 */ +#define OUT_PORT_3_NAME V +#define OUTPUT_3_WIDTH 1 +#define OUTPUT_DIMS_3_COL 1 +#define OUTPUT_3_DTYPE real_T +#define OUTPUT_3_COMPLEX COMPLEX_NO +#define OUT_3_FRAME_BASED FRAME_NO +#define OUT_3_BUS_BASED 0 +#define OUT_3_BUS_NAME +#define OUT_3_DIMS 1-D +#define OUT_3_ISSIGNED 1 +#define OUT_3_WORDLENGTH 8 +#define OUT_3_FIXPOINTSCALING 1 +#define OUT_3_FRACTIONLENGTH 3 +#define OUT_3_BIAS 0 +#define OUT_3_SLOPE 0.125 +/* Output Port 4 */ +#define OUT_PORT_4_NAME dp +#define OUTPUT_4_WIDTH 1 +#define OUTPUT_DIMS_4_COL 1 +#define OUTPUT_4_DTYPE real_T +#define OUTPUT_4_COMPLEX COMPLEX_NO +#define OUT_4_FRAME_BASED FRAME_NO +#define OUT_4_BUS_BASED 0 +#define OUT_4_BUS_NAME +#define OUT_4_DIMS 1-D +#define OUT_4_ISSIGNED 1 +#define OUT_4_WORDLENGTH 8 +#define OUT_4_FIXPOINTSCALING 1 +#define OUT_4_FRACTIONLENGTH 3 +#define OUT_4_BIAS 0 +#define OUT_4_SLOPE 0.125 +/* Output Port 5 */ +#define OUT_PORT_5_NAME dT +#define OUTPUT_5_WIDTH 1 +#define OUTPUT_DIMS_5_COL 1 +#define OUTPUT_5_DTYPE real_T +#define OUTPUT_5_COMPLEX COMPLEX_NO +#define OUT_5_FRAME_BASED FRAME_NO +#define OUT_5_BUS_BASED 0 +#define OUT_5_BUS_NAME +#define OUT_5_DIMS 1-D +#define OUT_5_ISSIGNED 1 +#define OUT_5_WORDLENGTH 8 +#define OUT_5_FIXPOINTSCALING 1 +#define OUT_5_FRACTIONLENGTH 3 +#define OUT_5_BIAS 0 +#define OUT_5_SLOPE 0.125 +/* Output Port 6 */ +#define OUT_PORT_6_NAME dF +#define OUTPUT_6_WIDTH 1 +#define OUTPUT_DIMS_6_COL 1 +#define OUTPUT_6_DTYPE real_T +#define OUTPUT_6_COMPLEX COMPLEX_NO +#define OUT_6_FRAME_BASED FRAME_NO +#define OUT_6_BUS_BASED 0 +#define OUT_6_BUS_NAME +#define OUT_6_DIMS 1-D +#define OUT_6_ISSIGNED 1 +#define OUT_6_WORDLENGTH 8 +#define OUT_6_FIXPOINTSCALING 1 +#define OUT_6_FRACTIONLENGTH 3 +#define OUT_6_BIAS 0 +#define OUT_6_SLOPE 0.125 + + +#define NPARAMS 5 +/* Parameter 1 */ +#define PARAMETER_0_NAME fs +#define PARAMETER_0_DTYPE real_T +#define PARAMETER_0_COMPLEX COMPLEX_NO +/* Parameter 2 */ +#define PARAMETER_1_NAME p0 +#define PARAMETER_1_DTYPE real_T +#define PARAMETER_1_COMPLEX COMPLEX_NO +/* Parameter 3 */ +#define PARAMETER_2_NAME T0 +#define PARAMETER_2_DTYPE real_T +#define PARAMETER_2_COMPLEX COMPLEX_NO +/* Parameter 4 */ +#define PARAMETER_3_NAME F0 +#define PARAMETER_3_DTYPE real_T +#define PARAMETER_3_COMPLEX COMPLEX_NO +/* Parameter 5 */ +#define PARAMETER_4_NAME V0 +#define PARAMETER_4_DTYPE real_T +#define PARAMETER_4_COMPLEX COMPLEX_NO + +#define SAMPLE_TIME_0 INHERITED_SAMPLE_TIME +#define NUM_DISC_STATES 0 +#define DISC_STATES_IC [0] +#define NUM_CONT_STATES 4 +#define CONT_STATES_IC [p0,T0,F0,V0] + +#define SFUNWIZ_GENERATE_TLC 1 +#define SOURCEFILES "__SFB__GetThdynCombGasZach.c" +#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" +#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 IS_PARAM_DOUBLE(pVal) (mxIsNumeric(pVal) && !mxIsLogical(pVal) &&\ +!mxIsEmpty(pVal) && !mxIsSparse(pVal) && !mxIsComplex(pVal) && mxIsDouble(pVal)) + +extern void ThdynCVConv_Outputs_wrapper(real_T *p, + real_T *T, + real_T *F, + real_T *V , + const real_T *xC, + const real_T *fs); +extern void ThdynCVConv_Derivatives_wrapper(const real_T *dm, + const real_T *dE, + const real_T *dmf, + const real_T *dV, + const real_T *p, + const real_T *T, + const real_T *F, + const real_T *V, + real_T *dx , + real_T *xC, + const real_T *fs, const int_T p_width0, + const real_T *p0, const int_T p_width1, + const real_T *T0, const int_T p_width2, + const real_T *F0, const int_T p_width3, + const real_T *V0, const int_T p_width4); + +/*====================* + * 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; + } + } + + 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; + /* Output Port 0 */ + ssSetOutputPortWidth(S, 0, OUTPUT_0_WIDTH); + ssSetOutputPortDataType(S, 0, SS_DOUBLE); + ssSetOutputPortComplexSignal(S, 0, OUTPUT_0_COMPLEX); + /* Output Port 1 */ + ssSetOutputPortWidth(S, 1, OUTPUT_1_WIDTH); + ssSetOutputPortDataType(S, 1, SS_DOUBLE); + ssSetOutputPortComplexSignal(S, 1, OUTPUT_1_COMPLEX); + /* Output Port 2 */ + ssSetOutputPortWidth(S, 2, OUTPUT_2_WIDTH); + ssSetOutputPortDataType(S, 2, SS_DOUBLE); + ssSetOutputPortComplexSignal(S, 2, OUTPUT_2_COMPLEX); + /* Output Port 3 */ + ssSetOutputPortWidth(S, 3, OUTPUT_3_WIDTH); + ssSetOutputPortDataType(S, 3, SS_DOUBLE); + ssSetOutputPortComplexSignal(S, 3, OUTPUT_3_COMPLEX); + /* Output Port 4 */ + ssSetOutputPortWidth(S, 4, OUTPUT_4_WIDTH); + ssSetOutputPortDataType(S, 4, SS_DOUBLE); + ssSetOutputPortComplexSignal(S, 4, OUTPUT_4_COMPLEX); + /* Output Port 5 */ + ssSetOutputPortWidth(S, 5, OUTPUT_5_WIDTH); + ssSetOutputPortDataType(S, 5, SS_DOUBLE); + ssSetOutputPortComplexSignal(S, 5, OUTPUT_5_COMPLEX); + /* Output Port 6 */ + ssSetOutputPortWidth(S, 6, OUTPUT_6_WIDTH); + ssSetOutputPortDataType(S, 6, SS_DOUBLE); + ssSetOutputPortComplexSignal(S, 6, OUTPUT_6_COMPLEX); + + + ssSetNumSampleTimes(S, 1); + ssSetNumRWork(S, 0); + ssSetNumIWork(S, 0); + ssSetNumPWork(S, 0); + ssSetNumModes(S, 0); + ssSetNumNonsampledZCs(S, 0); + + /* 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)); +} + +# 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); + ssSetOffsetTime(S, 0, 0.0); +} +#define MDL_INITIALIZE_CONDITIONS + /* Function: mdlInitializeConditions ======================================== + * Abstract: + * Initialize the states + */ + static void mdlInitializeConditions(SimStruct *S) + { + + real_T *xC = ssGetContStates(S); + real_T fs, F0; + real_T R, h, s, u, RF, RP, RT, uF, uP, uT, sF, sP, sT, Cp, Cv, K; + + fs = (*mxGetPr(ssGetSFcnParam(S, 0))); + xC[0] = (*mxGetPr(ssGetSFcnParam(S, 1))); + xC[1] = (*mxGetPr(ssGetSFcnParam(S, 2))); + xC[2] = (*mxGetPr(ssGetSFcnParam(S, 3))); + xC[3] = (*mxGetPr(ssGetSFcnParam(S, 4))); + } +#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); +} +/* Function: mdlOutputs ======================================================= + * +*/ +static void mdlOutputs(SimStruct *S, int_T tid) +{ + real_T *p = (real_T *)ssGetOutputPortRealSignal(S,0); + real_T *T = (real_T *)ssGetOutputPortRealSignal(S,1); + real_T *F = (real_T *)ssGetOutputPortRealSignal(S,2); + real_T *V = (real_T *)ssGetOutputPortRealSignal(S,3); + real_T *dP = (real_T *)ssGetOutputPortRealSignal(S,4); + real_T *dT = (real_T *)ssGetOutputPortRealSignal(S,5); + real_T *dF = (real_T *)ssGetOutputPortRealSignal(S,6); + const real_T *dm = (const real_T*)ssGetInputPortSignal(S, 0); + const real_T *dE = (const real_T*)ssGetInputPortSignal(S, 1); + const real_T *dmf = (const real_T*)ssGetInputPortSignal(S, 2); + const real_T *dV = (const real_T*)ssGetInputPortSignal(S, 3); + const real_T *xC = ssGetContStates(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 real_T *fs = (const real_T *)mxGetData(PARAM_DEF0(S)); + const real_T *p0 = (const real_T *)mxGetData(PARAM_DEF1(S)); + const real_T *T0 = (const real_T *)mxGetData(PARAM_DEF2(S)); + const real_T *F0 = (const real_T *)mxGetData(PARAM_DEF3(S)); + const real_T *V0 = (const real_T *)mxGetData(PARAM_DEF4(S)); + real_T dX[3]; + ThdynCVConv_Derivatives_wrapper(dm, dE, dmf, dV, p, T, F, V, dX, xC, fs, p_width0, p0, p_width1, T0, p_width2, F0, p_width3, V0, p_width4); + ThdynCVConv_Outputs_wrapper(p, T, F, V, xC, fs); + *dP = dX[0]; + *dT = dX[1]; + *dF = dX[2]; +} + +#define MDL_DERIVATIVES /* Change to #undef to remove function */ +/* Function: mdlDerivatives ================================================= + * Abstract: + * In this function, you compute the S-function block's derivatives. + * The derivatives are placed in the derivative vector, ssGetdX(S). + */ + static void mdlDerivatives(SimStruct *S) + { + const real_T *dm = (const real_T*) ssGetInputPortSignal(S,0); + const real_T *dE = (const real_T*) ssGetInputPortSignal(S,1); + const real_T *dmf = (const real_T*) ssGetInputPortSignal(S,2); + const real_T *dV = (const real_T*) ssGetInputPortSignal(S,3); + real_T *dx = ssGetdX(S); + real_T *xC = ssGetContStates(S); + real_T *p = (real_T *) ssGetOutputPortRealSignal(S,0); + real_T *T = (real_T *) ssGetOutputPortRealSignal(S,1); + real_T *F = (real_T *) ssGetOutputPortRealSignal(S,2); + real_T *V = (real_T *) ssGetOutputPortRealSignal(S,3); + 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 real_T *fs = (const real_T *)mxGetData(PARAM_DEF0(S)); + const real_T *p0 = (const real_T *)mxGetData(PARAM_DEF1(S)); + const real_T *T0 = (const real_T *)mxGetData(PARAM_DEF2(S)); + const real_T *F0 = (const real_T *)mxGetData(PARAM_DEF3(S)); + const real_T *V0 = (const real_T *)mxGetData(PARAM_DEF4(S)); + + ThdynCVConv_Derivatives_wrapper(dm, dE, dmf, dV, p, T, F, V,dx, xC, fs, p_width0, p0, p_width1, T0, p_width2, F0, p_width3, V0, p_width4); +} + +/* 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 + + diff --git a/code/c_code/ThdynCVConvDX.c b/code/c_code/ThdynCVConvDX.c new file mode 100644 index 0000000..1bdb3c1 --- /dev/null +++ b/code/c_code/ThdynCVConvDX.c @@ -0,0 +1,531 @@ +/* + * File: ThdynCVConvDX.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: Tue Mar 3 13:12:31 2015 +*/ +#define S_FUNCTION_LEVEL 2 +#define S_FUNCTION_NAME ThdynCVConvDX +/*<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/ +/* %%%-SFUNWIZ_defines_Changes_BEGIN --- EDIT HERE TO _END */ +#define NUM_INPUTS 4 +/* Input Port 0 */ +#define IN_PORT_0_NAME dm +#define INPUT_0_WIDTH 1 +#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 dE +#define INPUT_1_WIDTH 1 +#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 dmf +#define INPUT_2_WIDTH 1 +#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 dV +#define INPUT_3_WIDTH 1 +#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 3 +/* Output Port 0 */ +#define OUT_PORT_0_NAME dp +#define OUTPUT_0_WIDTH 1 +#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 +/* Output Port 1 */ +#define OUT_PORT_1_NAME dT +#define OUTPUT_1_WIDTH 1 +#define OUTPUT_DIMS_1_COL 1 +#define OUTPUT_1_DTYPE real_T +#define OUTPUT_1_COMPLEX COMPLEX_NO +#define OUT_1_FRAME_BASED FRAME_NO +#define OUT_1_BUS_BASED 0 +#define OUT_1_BUS_NAME +#define OUT_1_DIMS 1-D +#define OUT_1_ISSIGNED 1 +#define OUT_1_WORDLENGTH 8 +#define OUT_1_FIXPOINTSCALING 1 +#define OUT_1_FRACTIONLENGTH 3 +#define OUT_1_BIAS 0 +#define OUT_1_SLOPE 0.125 +/* Output Port 2 */ +#define OUT_PORT_2_NAME dF +#define OUTPUT_2_WIDTH 1 +#define OUTPUT_DIMS_2_COL 1 +#define OUTPUT_2_DTYPE real_T +#define OUTPUT_2_COMPLEX COMPLEX_NO +#define OUT_2_FRAME_BASED FRAME_NO +#define OUT_2_BUS_BASED 0 +#define OUT_2_BUS_NAME +#define OUT_2_DIMS 1-D +#define OUT_2_ISSIGNED 1 +#define OUT_2_WORDLENGTH 8 +#define OUT_2_FIXPOINTSCALING 1 +#define OUT_2_FRACTIONLENGTH 3 +#define OUT_2_BIAS 0 +#define OUT_2_SLOPE 0.125 + +#define NPARAMS 5 +/* Parameter 1 */ +#define PARAMETER_0_NAME fs +#define PARAMETER_0_DTYPE real_T +#define PARAMETER_0_COMPLEX COMPLEX_NO +/* Parameter 2 */ +#define PARAMETER_1_NAME p0 +#define PARAMETER_1_DTYPE real_T +#define PARAMETER_1_COMPLEX COMPLEX_NO +/* Parameter 3 */ +#define PARAMETER_2_NAME T0 +#define PARAMETER_2_DTYPE real_T +#define PARAMETER_2_COMPLEX COMPLEX_NO +/* Parameter 4 */ +#define PARAMETER_3_NAME F0 +#define PARAMETER_3_DTYPE real_T +#define PARAMETER_3_COMPLEX COMPLEX_NO +/* Parameter 5 */ +#define PARAMETER_4_NAME V0 +#define PARAMETER_4_DTYPE real_T +#define PARAMETER_4_COMPLEX COMPLEX_NO + +#define SAMPLE_TIME_0 INHERITED_SAMPLE_TIME +#define NUM_DISC_STATES 0 +#define DISC_STATES_IC [0] +#define NUM_CONT_STATES 4 +#define CONT_STATES_IC [0,0,0,0] + +#define SFUNWIZ_GENERATE_TLC 1 +#define SOURCEFILES "__SFB__GetThdynCombGasZachV1.c" +#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" +#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 IS_PARAM_DOUBLE(pVal) (mxIsNumeric(pVal) && !mxIsLogical(pVal) &&\ +!mxIsEmpty(pVal) && !mxIsSparse(pVal) && !mxIsComplex(pVal) && mxIsDouble(pVal)) + +extern void ThdynCVConvDX_Outputs_wrapper(const real_T *dm, + const real_T *dE, + const real_T *dmf, + const real_T *dV, + real_T *dp, + real_T *dT, + real_T *dF, + const real_T *xC, + const real_T *fs, const int_T p_width0, + const real_T *p0, const int_T p_width1, + const real_T *T0, const int_T p_width2, + const real_T *F0, const int_T p_width3, + const real_T *V0, const int_T p_width4); +extern void ThdynCVConvDX_Derivatives_wrapper(const real_T *dm, + const real_T *dE, + const real_T *dmf, + const real_T *dV, + const real_T *dp, + const real_T *dT, + const real_T *dF, + real_T *dx, + real_T *xC, + const real_T *fs, const int_T p_width0, + const real_T *p0, const int_T p_width1, + const real_T *T0, const int_T p_width2, + const real_T *F0, const int_T p_width3, + const real_T *V0, const int_T p_width4); + +/*====================* + * 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; + } + } + + 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; + /* Output Port 0 */ + ssSetOutputPortWidth(S, 0, OUTPUT_0_WIDTH); + ssSetOutputPortDataType(S, 0, SS_DOUBLE); + ssSetOutputPortComplexSignal(S, 0, OUTPUT_0_COMPLEX); + /* Output Port 1 */ + ssSetOutputPortWidth(S, 1, OUTPUT_1_WIDTH); + ssSetOutputPortDataType(S, 1, SS_DOUBLE); + ssSetOutputPortComplexSignal(S, 1, OUTPUT_1_COMPLEX); + /* Output Port 2 */ + ssSetOutputPortWidth(S, 2, OUTPUT_2_WIDTH); + ssSetOutputPortDataType(S, 2, SS_DOUBLE); + ssSetOutputPortComplexSignal(S, 2, OUTPUT_2_COMPLEX); + + ssSetNumSampleTimes(S, 1); + ssSetNumRWork(S, 0); + ssSetNumIWork(S, 0); + ssSetNumPWork(S, 0); + ssSetNumModes(S, 0); + ssSetNumNonsampledZCs(S, 0); + + ssSetSimulinkVersionGeneratedIn(S, "8.4"); + + /* 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)); +} + +# 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); + ssSetOffsetTime(S, 0, 0.0); +} +#define MDL_INITIALIZE_CONDITIONS + /* Function: mdlInitializeConditions ======================================== + * Abstract: + * Initialize the states + */ + static void mdlInitializeConditions(SimStruct *S) + { + + real_T *xC = ssGetContStates(S); + const real_T *p0 = (const real_T *)mxGetData(PARAM_DEF1(S)); + const real_T *T0 = (const real_T *)mxGetData(PARAM_DEF2(S)); + const real_T *F0 = (const real_T *)mxGetData(PARAM_DEF3(S)); + const real_T *V0 = (const real_T *)mxGetData(PARAM_DEF4(S)); + + + xC[0] = p0[0]; + xC[1] = T0[0]; + xC[2] = F0[0]; + xC[3] = V0[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"}; + ssRegAllTunableParamsAsRunTimeParams(S, rtParamNames); +} + +#endif +/* Function: mdlOutputs ======================================================= + * +*/ +static void mdlOutputs(SimStruct *S, int_T tid) +{ + const real_T *dm = (const real_T*) ssGetInputPortSignal(S,0); + const real_T *dE = (const real_T*) ssGetInputPortSignal(S,1); + const real_T *dmf = (const real_T*) ssGetInputPortSignal(S,2); + const real_T *dV = (const real_T*) ssGetInputPortSignal(S,3); + real_T *dp = (real_T *)ssGetOutputPortRealSignal(S,0); + real_T *dT = (real_T *)ssGetOutputPortRealSignal(S,1); + real_T *dF = (real_T *)ssGetOutputPortRealSignal(S,2); + const real_T *xC = ssGetContStates(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 real_T *fs = (const real_T *)mxGetData(PARAM_DEF0(S)); + const real_T *p0 = (const real_T *)mxGetData(PARAM_DEF1(S)); + const real_T *T0 = (const real_T *)mxGetData(PARAM_DEF2(S)); + const real_T *F0 = (const real_T *)mxGetData(PARAM_DEF3(S)); + const real_T *V0 = (const real_T *)mxGetData(PARAM_DEF4(S)); + + + ThdynCVConvDX_Outputs_wrapper(dm, dE, dmf, dV, dp, dT, dF, xC, fs, p_width0, p0, p_width1, T0, p_width2, F0, p_width3, V0, p_width4); + + +} + +#define MDL_DERIVATIVES /* Change to #undef to remove function */ +/* Function: mdlDerivatives ================================================= + * Abstract: + * In this function, you compute the S-function block's derivatives. + * The derivatives are placed in the derivative vector, ssGetdX(S). + */ + static void mdlDerivatives(SimStruct *S) + { + const real_T *dm = (const real_T*) ssGetInputPortSignal(S,0); + const real_T *dE = (const real_T*) ssGetInputPortSignal(S,1); + const real_T *dmf = (const real_T*) ssGetInputPortSignal(S,2); + const real_T *dV = (const real_T*) ssGetInputPortSignal(S,3); + real_T *dx = ssGetdX(S); + real_T *xC = ssGetContStates(S); + real_T *dp = (real_T *) ssGetOutputPortRealSignal(S,0); + real_T *dT = (real_T *) ssGetOutputPortRealSignal(S,1); + real_T *dF = (real_T *) ssGetOutputPortRealSignal(S,2); + 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 real_T *fs = (const real_T *)mxGetData(PARAM_DEF0(S)); + const real_T *p0 = (const real_T *)mxGetData(PARAM_DEF1(S)); + const real_T *T0 = (const real_T *)mxGetData(PARAM_DEF2(S)); + const real_T *F0 = (const real_T *)mxGetData(PARAM_DEF3(S)); + const real_T *V0 = (const real_T *)mxGetData(PARAM_DEF4(S)); + + ThdynCVConvDX_Derivatives_wrapper(dm, dE, dmf, dV, dp, dT, dF,dx, xC, fs, p_width0, p0, p_width1, T0, p_width2, F0, p_width3, V0, p_width4); +} + +/* 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 + + diff --git a/code/c_code/ThdynCVConvDX.tlc b/code/c_code/ThdynCVConvDX.tlc new file mode 100644 index 0000000..2ce9028 --- /dev/null +++ b/code/c_code/ThdynCVConvDX.tlc @@ -0,0 +1,200 @@ +%% File : ThdynCVConvDX.tlc +%% Created: Tue Mar 3 13:12:31 2015 +%% +%% Description: +%% Simulink Coder wrapper functions interface generated for +%% S-function "ThdynCVConvDX.c". +%% +%% File generated by S-function Builder Block +%% +%% For more information on using the Target Language with the +%% Simulink Coder, see the Target Language Compiler manual +%% (under Simulink Coder) in the "Inlining S-Functions" +%% chapter under the section and subsection: +%% "Writing Block Target Files to Inline S-Functions", +%% "Function-Based or Wrappered Code". +%% +%implements ThdynCVConvDX "C" +%% Function: BlockTypeSetup =================================================== +%% +%% Purpose: +%% Set up external references for wrapper functions in the +%% generated code. +%% +%function BlockTypeSetup(block, system) Output + %openfile externs + + extern void ThdynCVConvDX_Outputs_wrapper(const real_T *dm, + const real_T *dE, + const real_T *dmf, + const real_T *dV, + real_T *dp, + real_T *dT, + real_T *dF, + const real_T *xC, + const real_T *fs, const int_T p_width0, + const real_T *p0, const int_T p_width1, + const real_T *T0, const int_T p_width2, + const real_T *F0, const int_T p_width3, + const real_T *V0, const int_T p_width4); + extern void ThdynCVConvDX_Derivatives_wrapper(const real_T *dm, + const real_T *dE, + const real_T *dmf, + const real_T *dV, + const real_T *dp, + const real_T *dT, + const real_T *dF, + real_T *dx, + real_T *xC, + const real_T *fs, const int_T p_width0, + const real_T *p0, const int_T p_width1, + const real_T *T0, const int_T p_width2, + const real_T *F0, const int_T p_width3, + const real_T *V0, const int_T p_width4); + %closefile externs + % + %% +%endfunction + +%% InitializeConditions ========================================================= + %% + %function InitializeConditions(block, system) Output + /* % Block: % */ + + { + real_T *xC = &%; + + + xC[0] = 0; + xC[1] = 0; + xC[2] = 0; + xC[3] = 0; + } + %endfunction +%% Function: Outputs ========================================================== +%% +%% Purpose: +%% Code generation rules for mdlOutputs function. +%% +%function Outputs(block, system) Output + %% + %assign pu0 = LibBlockInputSignalAddr(0, "", "", 0) + %assign pu1 = LibBlockInputSignalAddr(1, "", "", 0) + %assign pu2 = LibBlockInputSignalAddr(2, "", "", 0) + %assign pu3 = LibBlockInputSignalAddr(3, "", "", 0) + %assign py0 = LibBlockOutputSignalAddr(0, "", "", 0) + %assign py1 = LibBlockOutputSignalAddr(1, "", "", 0) + %assign py2 = LibBlockOutputSignalAddr(2, "", "", 0) + %assign nelements1 = LibBlockParameterSize(P1) + %assign param_width1 = nelements1[0] * nelements1[1] + %if (param_width1) > 1 + %assign pp1 = LibBlockMatrixParameterBaseAddr(P1) + %else + %assign pp1 = LibBlockParameterAddr(P1, "", "", 0) + %endif + %assign nelements2 = LibBlockParameterSize(P2) + %assign param_width2 = nelements2[0] * nelements2[1] + %if (param_width2) > 1 + %assign pp2 = LibBlockMatrixParameterBaseAddr(P2) + %else + %assign pp2 = LibBlockParameterAddr(P2, "", "", 0) + %endif + %assign nelements3 = LibBlockParameterSize(P3) + %assign param_width3 = nelements3[0] * nelements3[1] + %if (param_width3) > 1 + %assign pp3 = LibBlockMatrixParameterBaseAddr(P3) + %else + %assign pp3 = LibBlockParameterAddr(P3, "", "", 0) + %endif + %assign nelements4 = LibBlockParameterSize(P4) + %assign param_width4 = nelements4[0] * nelements4[1] + %if (param_width4) > 1 + %assign pp4 = LibBlockMatrixParameterBaseAddr(P4) + %else + %assign pp4 = LibBlockParameterAddr(P4, "", "", 0) + %endif + %assign nelements5 = LibBlockParameterSize(P5) + %assign param_width5 = nelements5[0] * nelements5[1] + %if (param_width5) > 1 + %assign pp5 = LibBlockMatrixParameterBaseAddr(P5) + %else + %assign pp5 = LibBlockParameterAddr(P5, "", "", 0) + %endif + %assign py_width = LibBlockOutputSignalWidth(0) + %assign pu_width = LibBlockInputSignalWidth(0) + { + real_T *pxc = &%; + ThdynCVConvDX_Outputs_wrapper(%, %, %, %, %, %, %, pxc, %, %, %, %, %, %, %, %, %, %); + + } %% +%endfunction + + +%% Function: Derivatives ====================================================== +%% Abstract: +%% Derivatives +%% +%function Derivatives(block, system) Output + /* S-Function "ThdynCVConvDX_wrapper" Block: % */ + + + %assign pu0 = LibBlockInputSignalAddr(0, "", "", 0) + %assign pu1 = LibBlockInputSignalAddr(1, "", "", 0) + %assign pu2 = LibBlockInputSignalAddr(2, "", "", 0) + %assign pu3 = LibBlockInputSignalAddr(3, "", "", 0) + + %assign py0 = LibBlockOutputSignalAddr(0, "", "", 0) + %assign py1 = LibBlockOutputSignalAddr(1, "", "", 0) + %assign py2 = LibBlockOutputSignalAddr(2, "", "", 0) + + %assign nelements1 = LibBlockParameterSize(P1) + %assign param_width1 = nelements1[0] * nelements1[1] + %if (param_width1) > 1 + %assign pp1 = LibBlockMatrixParameterBaseAddr(P1) + %else + %assign pp1 = LibBlockParameterAddr(P1, "", "", 0) + %endif + %assign nelements2 = LibBlockParameterSize(P2) + %assign param_width2 = nelements2[0] * nelements2[1] + %if (param_width2) > 1 + %assign pp2 = LibBlockMatrixParameterBaseAddr(P2) + %else + %assign pp2 = LibBlockParameterAddr(P2, "", "", 0) + %endif + %assign nelements3 = LibBlockParameterSize(P3) + %assign param_width3 = nelements3[0] * nelements3[1] + %if (param_width3) > 1 + %assign pp3 = LibBlockMatrixParameterBaseAddr(P3) + %else + %assign pp3 = LibBlockParameterAddr(P3, "", "", 0) + %endif + %assign nelements4 = LibBlockParameterSize(P4) + %assign param_width4 = nelements4[0] * nelements4[1] + %if (param_width4) > 1 + %assign pp4 = LibBlockMatrixParameterBaseAddr(P4) + %else + %assign pp4 = LibBlockParameterAddr(P4, "", "", 0) + %endif + %assign nelements5 = LibBlockParameterSize(P5) + %assign param_width5 = nelements5[0] * nelements5[1] + %if (param_width5) > 1 + %assign pp5 = LibBlockMatrixParameterBaseAddr(P5) + %else + %assign pp5 = LibBlockParameterAddr(P5, "", "", 0) + %endif + + + + { + real_T *pxc = &%; + real_T *dx = &%; + ThdynCVConvDX_Derivatives_wrapper(%, %, %, %, %, %, %, dx, pxc, %, %, %, %, %, %, %, %, %, %); + } + %% +%endfunction +%% [EOF] ThdynCVConvDX.tlc + + + + + diff --git a/code/c_code/ThdynCVConvDX_wrapper.c b/code/c_code/ThdynCVConvDX_wrapper.c new file mode 100644 index 0000000..06d68f4 --- /dev/null +++ b/code/c_code/ThdynCVConvDX_wrapper.c @@ -0,0 +1,142 @@ + + +/* + * Include Files + * + */ +#if defined(MATLAB_MEX_FILE) +#include "tmwtypes.h" +#include "simstruc_types.h" +#else +#include "rtwtypes.h" +#endif + +/* %%%-SFUNWIZ_wrapper_includes_Changes_BEGIN --- EDIT HERE TO _END */ +#include +/* %%%-SFUNWIZ_wrapper_includes_Changes_END --- EDIT HERE TO _BEGIN */ +#define u_width 1 +#define y_width 1 +/* + * Create external references here. + * + */ +/* %%%-SFUNWIZ_wrapper_externs_Changes_BEGIN --- EDIT HERE TO _END */ +/* extern double func(double a); */ +/* %%%-SFUNWIZ_wrapper_externs_Changes_END --- EDIT HERE TO _BEGIN */ + +/* + * Output functions + * + */ +void ThdynCVConvDX_Outputs_wrapper(const real_T *dm, + const real_T *dE, + const real_T *dmf, + const real_T *dV, + real_T *dp, + real_T *dT, + real_T *dF, + const real_T *xC, + const real_T *fs, const int_T p_width0, + const real_T *p0, const int_T p_width1, + const real_T *T0, const int_T p_width2, + const real_T *F0, const int_T p_width3, + const real_T *V0, const int_T p_width4) +{ +/* %%%-SFUNWIZ_wrapper_Outputs_Changes_BEGIN --- EDIT HERE TO _END */ +real_T pTemp, TTemp, FTemp, m, mf, ma, VTemp; +real_T D; +real_T R1, h1, s1, uu1, RF1, RP1, RT1, uF1, uP1, uT1, sF1, sP1, sT1, Cp1, Cv1, K1; +real_T rho, rhoP, rhoT, rhoF, RtimesT, RtimesTSq; +real_T u1, u2, u3, u4; +real_T a11, a12, a13, a21, a22, a23, a33, a44; + +pTemp = xC[0]; +TTemp = xC[1]; +FTemp = xC[2]; +VTemp = xC[3]; +GetThdynCombGasZachV1(pTemp, TTemp, FTemp, fs[0], &R1, &h1, &s1, &uu1, &RF1, &RP1, &RT1, + &uF1, &uP1, &uT1, &sF1, &sP1, &sT1,&Cp1, &Cv1, &K1); +RtimesT = R1*TTemp; +RtimesTSq = RtimesT*RtimesT; +rho = pTemp / RtimesT; +rhoP = (RtimesT - pTemp*RP1*TTemp)/RtimesTSq; +rhoT = (-pTemp*(RT1*TTemp + R1))/RtimesTSq; +rhoF = (-pTemp*(RF1*TTemp))/RtimesTSq; + +m = pTemp*VTemp/(R1*TTemp); +mf = (FTemp*fs[0])/(1+FTemp*fs[0])*m; +ma = m - mf; +dF[0] = (dmf[0]*m - dm[0]*mf)/(fs[0]*pow(ma,2)); + +u1 = dm[0]/m - dV[0]/VTemp; +u2 = (dE[0] - uu1*dm[0])/m; +u3 = dF[0]; +u4 = dV[0]; + +D = -(rhoT*uP1 - rhoP*uT1)/rho; +a11 = uT1/D; a12 = -rhoT/(rho*D); a13 = (rhoT*uF1 - rhoF*uT1)/(rho*D); +a21 = -uP1/D; a22 = rhoP/(rho*D); a23 = -(rhoP*uF1 - rhoF*uP1)/(rho*D); +dp[0] = a11*u1 + a12*u2 + a13*u3; +dT[0] = a21*u1 + a22*u2 + a23*u3; +dF[0] = u3; +/* %%%-SFUNWIZ_wrapper_Outputs_Changes_END --- EDIT HERE TO _BEGIN */ +} + +/* + * Derivatives function + * + */ +void ThdynCVConvDX_Derivatives_wrapper(const real_T *dm, + const real_T *dE, + const real_T *dmf, + const real_T *dV, + const real_T *dp, + const real_T *dT, + const real_T *dF, + real_T *dx, + real_T *xC, + const real_T *fs, const int_T p_width0, + const real_T *p0, const int_T p_width1, + const real_T *T0, const int_T p_width2, + const real_T *F0, const int_T p_width3, + const real_T *V0, const int_T p_width4) +{ +/* %%%-SFUNWIZ_wrapper_Derivatives_Changes_BEGIN --- EDIT HERE TO _END */ +real_T pTemp, TTemp, FTemp, m, mf, ma, VTemp; +real_T D; +real_T R1, h1, s1, uu1, RF1, RP1, RT1, uF1, uP1, uT1, sF1, sP1, sT1, Cp1, Cv1, K1; +real_T rho, rhoP, rhoT, rhoF, RtimesT, RtimesTSq; +real_T u1, u2, u3, u4; +real_T a11, a12, a13, a21, a22, a23, a33, a44; + +pTemp = xC[0]; +TTemp = xC[1]; +FTemp = xC[2]; +VTemp = xC[3]; +GetThdynCombGasZachV1(pTemp, TTemp, FTemp, fs[0], &R1, &h1, &s1, &uu1, &RF1, &RP1, &RT1, + &uF1, &uP1, &uT1, &sF1, &sP1, &sT1,&Cp1, &Cv1, &K1); +RtimesT = R1*TTemp; +RtimesTSq = RtimesT*RtimesT; +rho = pTemp / RtimesT; +rhoP = (RtimesT - pTemp*RP1*TTemp)/RtimesTSq; +rhoT = (-pTemp*(RT1*TTemp + R1))/RtimesTSq; +rhoF = (-pTemp*(RF1*TTemp))/RtimesTSq; + +m = pTemp*VTemp/(R1*TTemp); +mf = (FTemp*fs[0])/(1+FTemp*fs[0])*m; +ma = m - mf; +u3 = (dmf[0]*m - dm[0]*mf)/(fs[0]*pow(ma,2)); + +u1 = dm[0]/m - dV[0]/VTemp; +u2 = (dE[0] - uu1*dm[0])/m; +u4 = dV[0]; + +D = -(rhoT*uP1 - rhoP*uT1)/rho; +a11 = uT1/D; a12 = -rhoT/(rho*D); a13 = (rhoT*uF1 - rhoF*uT1)/(rho*D); +a21 = -uP1/D; a22 = rhoP/(rho*D); a23 = -(rhoP*uF1 - rhoF*uP1)/(rho*D); +dx[0] = a11*u1 + a12*u2 + a13*u3; +dx[1] = a21*u1 + a22*u2 + a23*u3; +dx[2] = u3; +dx[3] = u4; +/* %%%-SFUNWIZ_wrapper_Derivatives_Changes_END --- EDIT HERE TO _BEGIN */ +} diff --git a/code/c_code/ThdynCVNV2Zone.mexw64 b/code/c_code/ThdynCVNV2Zone.mexw64 index f7ae2a1..87a2356 100644 Binary files a/code/c_code/ThdynCVNV2Zone.mexw64 and b/code/c_code/ThdynCVNV2Zone.mexw64 differ diff --git a/code/c_code/ThdynCVNV2Zone.mexw64.pdb b/code/c_code/ThdynCVNV2Zone.mexw64.pdb deleted file mode 100644 index c05e17b..0000000 Binary files a/code/c_code/ThdynCVNV2Zone.mexw64.pdb and /dev/null differ diff --git a/code/combState.mexw64 b/code/combState.mexw64 index 97dd4f9..b404850 100644 Binary files a/code/combState.mexw64 and b/code/combState.mexw64 differ diff --git a/code/compressor_calc_PTF.mexw64 b/code/compressor_calc_PTF.mexw64 index 038192b..5b820af 100644 Binary files a/code/compressor_calc_PTF.mexw64 and b/code/compressor_calc_PTF.mexw64 differ diff --git a/code/crankMechKinematic.mexw64 b/code/crankMechKinematic.mexw64 index 198e74b..7eda0f7 100644 Binary files a/code/crankMechKinematic.mexw64 and b/code/crankMechKinematic.mexw64 differ diff --git a/code/crankMechKinematic1.mexw64 b/code/crankMechKinematic1.mexw64 index 01e2d98..2c454ed 100644 Binary files a/code/crankMechKinematic1.mexw64 and b/code/crankMechKinematic1.mexw64 differ diff --git a/code/hysterisis.mexw64 b/code/hysterisis.mexw64 index 7e0ace5..51d5236 100644 Binary files a/code/hysterisis.mexw64 and b/code/hysterisis.mexw64 differ diff --git a/code/interpolateDescend.mexw64 b/code/interpolateDescend.mexw64 index 1ce1d52..53ad935 100644 Binary files a/code/interpolateDescend.mexw64 and b/code/interpolateDescend.mexw64 differ diff --git a/code/lowPassFilterBW4.mexw64 b/code/lowPassFilterBW4.mexw64 index 4e01ac7..5ae2448 100644 Binary files a/code/lowPassFilterBW4.mexw64 and b/code/lowPassFilterBW4.mexw64 differ diff --git a/code/pCompCalc.mexw64 b/code/pCompCalc.mexw64 index 16be70e..844f3d2 100644 Binary files a/code/pCompCalc.mexw64 and b/code/pCompCalc.mexw64 differ diff --git a/code/pMaxFinder.mexw64 b/code/pMaxFinder.mexw64 index 1aa3352..07c4155 100644 Binary files a/code/pMaxFinder.mexw64 and b/code/pMaxFinder.mexw64 differ diff --git a/code/turbine_calc_MV_PTF.mexw64 b/code/turbine_calc_MV_PTF.mexw64 index 8fbd257..1188f43 100644 Binary files a/code/turbine_calc_MV_PTF.mexw64 and b/code/turbine_calc_MV_PTF.mexw64 differ diff --git a/code/turbine_calc_PTF.mexw64 b/code/turbine_calc_PTF.mexw64 index dada29c..359f28e 100644 Binary files a/code/turbine_calc_PTF.mexw64 and b/code/turbine_calc_PTF.mexw64 differ diff --git a/make.m b/make.m index 592edd0..2822c1b 100644 --- a/make.m +++ b/make.m @@ -28,7 +28,8 @@ mex ThdynCV.c ThdynCV_wrapper.c GetPTF.c GetThdynCombGasZachV1.c -outdir .. mex ThdynCVNV.c GetPTF.c GetThdynCombGasZachV1.c -outdir .. mex ThdynCVConv.c ThdynCVConv_wrapper.c GetThdynCombGasZachV1.c -outdir .. -mex ThdynCV2ZoneConv.c ThdynCV2ZoneConv_wrapper.c GetThdynCombGasZachV1.c -outdir .. +mex -g ThdynCVConvDX.c ThdynCVConvDX_wrapper.c GetThdynCombGasZachV1.c -outdir .. +mex -g ThdynCV2ZoneConv.c ThdynCV2ZoneConv_wrapper.c GetThdynCombGasZachV1.c -outdir .. mex ThdynCVNV2Zone.c ThdynCVNV2Zone_wrapper.c GetPTF.c GetThdynCombGasZachV1.c Get2ZonePTFIter.c mex turbine_calc_PTF.c turbine_calc_PTF_wrapper.c GetThdynCombGasZachV1.c -outdir .. mex turbine_calc_MV_PTF.c turbine_calc_MV_PTF_wrapper.c GetThdynCombGasZachV1.c -outdir ..