Computing & Programming with Matlab2014 S1 AssignmentThis assignment requires some programming and plotting activities. The assignment requires someunderstanding of the discrete maths implementation of integration and differentiation (which willbe explained)SCENARIO:Your assignment is based around data collected from some kind of sensor measuring 3Ddisplacement or velocity or acceleration. You are required to convert from one of these kinematictypes to the other types eg: if you are given displacement, then you would be converting to velocityAND acceleration. If you were given velocity then you would be converting to both accelerationAND displacement. If you were given acceleration then you would be converting to both velocityAND displacementBACKGROUND MATH / PHYSICSThe position vector,r(ors), the velocity vector,v, and the acceleration vector,aare expressedusing rectangular coordinates in the following way:How are these related :Ifrorvoraare described by functions then each is either the integral or the differentiation ofanother, as below, calculatingv.from the derivative ofrandafrom the derivative ofv.Conversely, as below,vis calculated as the integral ofa,ris calculated as the integral ofv.BUT: in sensor based data, these are not continuous functions but discrete samples and the maths iscompletely simplified.vi=(riri1)?t=(riri1)*samplerateIn the above, the average velocity at a point in time, is the change in position (?r) divided bythe change in time (?t). The change in time is simply the inverse of the samplerate(eg 1/samplerate). Using matlab, if the displacement samples are loaded in a vector, then to generatethe velocity the vector is subtracted from a one sample shifted copy of itself and the resultantmatlab vector multiplied by the samplerate (eg?t= 1/samplerate and dividing by?.tis thesame as multiplying by samplerate.Eg: for a samplerate of 10 samples / secr=[0.15, 0.3, 0.45, 0.61, 0.77, 0.94, 1.1 ](metres)then we assume for the moment thatr0is zero and get_v=[0.15-0, 0.3-0.15, 0.45-0.3, 0.61-0.45, 0.77-0.61, 0.94-0.77, 1.1-0.94]*sampleratev=[1.5, 1.5, 1.5, 1.6, 1.6, 1.7, 1.6]BUT: subtracting zero from the first sample can cause the first velocity (or acceleration) calculationto be anomalous. It is better to generate the differences between each pair of samples and theresultant data set will be one sample shorter than the source data.To calculate the integral requires the summing of successive samples and multiplying by?t(ordivide by the samplerate)ri=?1i(vn?t)=?1ivnsampleratefor example, if the velocity vector was_v=[ 1.5, 1.5, 1.5, 1.6, 1.6, 1.7, 1.6 ]thenr=[1.5, 3.0, 4.5, 6.1, 7.7, 9.4, 11 ] /samplerate..
Use the order calculator below and get started! Contact our live support team for any assistance or inquiry.
[order_calculator]