# Acceleration Rotation and Integration

The accelerations produced by the accelerometers in the body can be rotated into the reference from the simple vector rotation in the Quaternion math section.

One must remember that the accelerometers don't measure all the accelerations in the inertial frame. Specifically, local celestial bodies will have an acceleration on the vehicle depending on there relative positions. Don't forget to add it in.

The Quoternian equations is now

```DelatV = Q At Qconv
```

Where Q is the quatonian body to reference rotation and At is the accelerations time time (Measured Delta V in the body frame)

The easiest way to find the At vector is to simply multiply the measured acceleration rates by the accleration time (update interval) and go. This ignors the fact that the body frame is rotation while the acclerations are happening. To account for that the At term has to be expanded into :

```At = (A + 0.5 W cross A )*(t)
```

where A is the vector of measured accelerations and W is the rotation update from the attitude section and t is the update period.

An additional term can be added to compensate for non-linear accelerations, ie make the A an integral, but without some other form of information, that term is generally set to zero.

So the 'Integration is now just simply: (all in the same inertial reference frame)

```VELnew = VELold + At
POSnew = POSold + VELnew*(dT) + 0.5 At*dT
```

Where POS, VEL and At are the obvious vectors and dT is the update interval.