function y=derivrot(u); global Asat % ************************************************** % SIMULATION DE LA STABILISATION D'UN SATELLITE PAR % GRADIENT DE GRAVITE ET AMORTISSEMENT PAR DES % MAGNETOCOUPLEURS FONCTIONNANT AVEC DES COMMANDES % BASEES SUR LA DERIVEE DU CHAMP MAGNETIQUE TERRESTRE % ************************************************** % ------------------ DEBUT PROGRAMME --------------- % ************************************************ % Le vecteur d'entrée pour le traitement du système % différentiel est à 7 composantes. % % u(1)=p rotation absolue satellite sur x % u(2)=q ...........................sur y % u(3)=r ...........................sur z % % u(4)=q0 Première composante du quaternion % u(5)=q1 Deuxième ........................ % u(6)=q2 Troisième ....................... % u(7)=q3 Quatrième ....................... % *********** Detail de la fonction**************** % ELLE PERMET LE CALCUL DU SECOND MEMBRE DE L'EQUATION % TMC, NE CONCERNANT QUE LA MATRICE D'INERTIE Asat ET % LE VECTEUR ROTATION INERTIEL DE COMPOSANTES p q r % ************************************************** % vecteur rotation inertiel sur x y z ( dim 3 vert ) p=u(1);q=u(2);r=u(3);omega=[p q r]'; % Moment cinétique en axes satellite ( dim 3 vert) mom_cin=Asat*omega; vect(1:3)=omega;vect(4:6)=mom_cin; deriv_rot0=-prodvect(vect); deriv_rot=inv(Asat)*deriv_rot0; % Sortie de la fonction( dim 3 vert) y=deriv_rot; end % *******************************************************