13.07.2015 Views

An Integrated, Modular Simulation System for Education ... - Cal Poly

An Integrated, Modular Simulation System for Education ... - Cal Poly

An Integrated, Modular Simulation System for Education ... - Cal Poly

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

* with in an enabled subsystem which is configured to reset states,* this routine will be called during the reset of the states.*/static void mdlInitializeConditions(SimStruct *S){}#endif /* MDL_INITIALIZE_CONDITIONS *//* Function: mdlOutputs =======================================================* Abstract:* simply passes states y[n] = x[n]**/static void mdlOutputs(SimStruct *S, int_T tid){InputRealPtrsType uPtrs = ssGetInputPortRealSignalPtrs(S,0);real_T *y = ssGetOutputPortRealSignal(S,0);float newVal;newVal = doConversion(&pitchPos,&aToD12);newVal = 0.4*newVal + 0.6*oldVals[0];oldVals[0] = newVal;y[0] = (int)newVal;newVal = doConversion(&pitchForce,&aToD12);newVal = 0.4*newVal + 0.6*oldVals[1];oldVals[1] = newVal;y[1] = (int)newVal;newVal = doConversion(&pitchTrimDef,&aToD12);newVal = 0.4*newVal + 0.6*oldVals[2];oldVals[2] = newVal;y[2] = (int)newVal;newVal = doConversion(&pitchTrimPos,&aToD12);newVal = 0.4*newVal + 0.6*oldVals[3];oldVals[3] = newVal;y[3] = (int)newVal;newVal = doConversion(&pitchVelocity,&aToD12);newVal = 0.4*newVal + 0.6*oldVals[4];oldVals[4] = newVal;y[4] = (int)newVal;newVal = doConversion(&rollPos,&aToD12);newVal = 0.4*newVal + 0.6*oldVals[5];oldVals[5] = newVal;y[5] = (int)(-newVal);newVal = doConversion(&rollForce,&aToD12);newVal = 0.4*newVal + 0.6*oldVals[6];oldVals[6] = newVal;y[6] = (int)newVal;newVal = doConversion(&rollTrimDef,&aToD12);newVal = 0.4*newVal + 0.6*oldVals[7];oldVals[7] = newVal;120

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!