Warning! This is not a fully working model. Students are supposed to tune it and add relevant filtering in order to make the algorithm practical, i.e. the rotor flux should be assumed inaccessible. Nevertheless, a basic structure of the control system, including MRAS, is there to provide a convenient starting point. Good luck!