Drone dynamics or Mathematical model in SITL

You can take a look here at some diagrams:

The code you are looking for is librarires/SITL