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.

* y[15]= qDot* y[16]= rDot* y[17]= uDot* y[18]= vDot* y[19]= wDot**/InputRealPtrsType uPtrs = ssGetInputPortRealSignalPtrs(S,0);real_T *y = ssGetOutputPortRealSignal(S,0);time_T stepSize;stepSize = ssGetStepSize(S);dt=stepSize;Deflect_Elevator = *uPtrs[0];/* take in values from uPtrs */Deflect_Aileron = *uPtrs[1];Deflect_Rudder = *uPtrs[2];Rho = *uPtrs[3];Fx = *uPtrs[4];Fy = *uPtrs[5];Fz = *uPtrs[6];PitchingMoment = *uPtrs[7];RollingMoment = *uPtrs[8];YawingMoment = *uPtrs[9];ForcesMoments( ); /* find the current rates of change */Accelerate( );UpdateState( ); /* apply them to current rotations */y[0] = xx; /* send out values through the y vector */y[1] = yy;y[2] = zz;y[3] = Psi;y[4] = Theta;y[5] = Phi;y[6] = u;y[7] = v;y[8] = w;y[9] = p;y[10]= q;y[11]= r;y[12]= Alpha;y[13]= Beta;y[14]= pDot;y[15]= qDot;y[16]= rDot;y[17]= uDot;y[18]= vDot;y[19]= wDot;}/* This function models the <strong>for</strong>ces and moments acting on the aircraft* first the aircraft is treated as a point mass and accelerated linearly* then rotational properties are applied and the mass becomes three* dimensional and is rotated. */void ForcesMoments( ){146

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

Saved successfully!

Ooh no, something went wrong!