Apprendre Maple Index du Forum Apprendre Maple
Site dédié au logiciel de calcul formel Maple
 
  Page d'accueilPage d'accueil   FAQFAQ    RechercherRechercher    Liste des MembresListe des Membres    Groupes d'utilisateursGroupes d'utilisateurs 
S'enregistrerS'enregistrer    ProfilProfil   Se connecter pour vérifier ses messages privésSe connecter pour vérifier ses messages privés   ConnexionConnexion 

Dérivée d'un vecteur position

 
Poster un nouveau sujet   Répondre au sujet    Apprendre Maple Index du Forum -> Maple en analyse
Voir le sujet précédent :: Voir le sujet suivant  
Auteur Message
bendesarts



Inscrit le: 27 Fév 2009
Messages: 234

MessagePosté le: 29 Nov 2009 11:15    Sujet du message: Dérivée d'un vecteur position Répondre en citant

Bonjour,

Je cherche à dériver un vecteur appelé ici On par rapport à t. Puis, à mettre le système sous la forme "Dérivé du vecteur = J * dq/dt" où q est le vecteur des paramètres.

D'abord, dans mon vecteur On, il faut d'abord que je précise les variables qui dépendent du temps et celle qui ne dépendent pas du temps. Ensui, il faut dériver ce vecteur par rapport au temps. Enfin j'aimerais identifier la matrice jacobienne J sachant que dq/dt = [dtheta1/dt dtheta2/dt dd3/dt dtheta4/dt

Voilà pour le moment l'expression de mon vecteur On que j'aimerais dériver :

Code:
> restart;

> with(linalg):
  f := (d, theta, a, alpha) -> [


>   [cos(theta), -cos(alpha) sin(theta), sin(theta) sin(alpha), a cos(theta)],


>   [sin(theta), cos(theta) cos(alpha), -cos(theta) sin(alpha), a sin(theta)],


>   [0, sin(alpha), cos(alpha), d], [0, 0, 0, 1]];


>   T01 := f(d1, theta1, 0, 0);


>   T12 := f(d2, theta2, a2, 0);


>   T23 := f(d3, 0, a3, 0);


>   T34 := f(0, theta4, 0, 0);


>   T04 := map(combine, evalm(((T01 &* T12) &* T23) &* T34));


>   On := submatrix(T04, 1 .. 3, 4 .. 4);

Warning, the protected names norm and trace have been redefined and unprotected

f := (d, theta, a, alpha) -> [





  [cos(theta), -cos(alpha) sin(theta), sin(theta) sin(alpha), a cos(theta)],





  [sin(theta), cos(theta) cos(alpha), -cos(theta) sin(alpha), a sin(theta)],





  [0, sin(alpha), cos(alpha), d], [0, 0, 0, 1]]

                  [cos(theta1)  -sin(theta1)  0  0 ]


                  [                                ]


                  [sin(theta1)  cos(theta1)   0  0 ]


           T01 := [                                ]


                  [     0            0        1  d1]


                  [                                ]


                  [     0            0        0  1 ]

            [cos(theta2)  -sin(theta2)  0  a2 cos(theta2)]


            [                                            ]


            [sin(theta2)  cos(theta2)   0  a2 sin(theta2)]


     T12 := [                                            ]


            [     0            0        1        d2      ]


            [                                            ]


            [     0            0        0        1       ]

                             [1  0  0  a3]


                             [           ]


                             [0  1  0  0 ]


                      T23 := [           ]


                             [0  0  1  d3]


                             [           ]


                             [0  0  0  1 ]

                   [cos(theta4)  -sin(theta4)  0  0]


                   [                               ]


                   [sin(theta4)  cos(theta4)   0  0]


            T34 := [                               ]


                   [     0            0        1  0]


                   [                               ]


                   [     0            0        0  1]

T04 := [[cos(theta1 + theta2 + theta4), -sin(theta1 + theta2 + theta4), 0,





  cos(theta1 + theta2) a3 + a2 cos(theta1 + theta2)], [





  sin(theta1 + theta2 + theta4), cos(theta1 + theta2 + theta4), 0,





  sin(theta1 + theta2) a3 + a2 sin(theta1 + theta2)], [0, 0, 1, d3 + d2 + d1],





  [0, 0, 0, 1]]

         [cos(theta1 + theta2) a3 + a2 cos(theta1 + theta2)]


         [                                                 ]


   On := [sin(theta1 + theta2) a3 + a2 sin(theta1 + theta2)]


         [                                                 ]


         [                  d3 + d2 + d1                   ]



Merci d'avance pour votre aide

Benjamin
Revenir en haut de page
Voir le profil de l'utilisateur Envoyer un message privé
ALS



Inscrit le: 11 Sep 2006
Messages: 647

MessagePosté le: 30 Nov 2009 12:50    Sujet du message: Répondre en citant

Bonjour, voici ce que je vous propose:

Code:

> restart;
> with(linalg):
> f := (d, theta, a, alpha) -> [ [cos(theta), -cos(alpha)* sin(theta), sin(theta) *sin(alpha), a* cos(theta)],
>    [sin(theta), cos(theta)* cos(alpha), -cos(theta) *sin(alpha), a* sin(theta)],
>    [0, sin(alpha), cos(alpha), d], [0, 0, 0, 1]];
>
>
>    T01 := f(d1, theta1, 0, 0);
>    T12 := f(d2, theta2, a2, 0);
>    T23 := f(d3, 0, a3, 0);
>    T34 := f(0, theta4, 0, 0);
>    T04 := map(combine, evalm(((T01 &* T12) &* T23) &* T34));
>
>    On := submatrix(T04, 1 .. 4, 4 .. 4);
>

  f := (d, theta, a, alpha) -> [[cos(theta), -cos(alpha) sin(theta),

        sin(theta) sin(alpha), a cos(theta)], [sin(theta),

        cos(theta) cos(alpha), -cos(theta) sin(alpha), a sin(theta)],

        [0, sin(alpha), cos(alpha), d], [0, 0, 0, 1]]


  T01 := [[cos(theta1), -sin(theta1), 0, 0],

        [sin(theta1), cos(theta1), 0, 0], [0, 0, 1, d1], [0, 0, 0, 1]

        ]


  T12 := [[cos(theta2), -sin(theta2), 0, a2 cos(theta2)],

        [sin(theta2), cos(theta2), 0, a2 sin(theta2)], [0, 0, 1, d2],

        [0, 0, 0, 1]]


  T23 := [[1, 0, 0, a3], [0, 1, 0, 0], [0, 0, 1, d3], [0, 0, 0, 1]]


  T34 := [[cos(theta4), -sin(theta4), 0, 0],

        [sin(theta4), cos(theta4), 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]


  T04 :=

        [cos(%1) , -sin(%1) , 0 ,

        cos(theta1 + theta2) a3 + a2 cos(theta1 + theta2)]

        [sin(%1) , cos(%1) , 0 ,

        sin(theta1 + theta2) a3 + a2 sin(theta1 + theta2)]

        [0 , 0 , 1 , d3 + d2 + d1]

        [0 , 0 , 0 , 1]

  %1 := theta1 + theta2 + theta4


            [cos(theta1 + theta2) a3 + a2 cos(theta1 + theta2)]
            [                                                 ]
            [sin(theta1 + theta2) a3 + a2 sin(theta1 + theta2)]
      On := [                                                 ]
            [                  d3 + d2 + d1                   ]
            [                                                 ]
            [                        1                        ]

> On:=subs(theta1=theta1(t),theta2=theta2(t),d3=d3(t),theta4=theta4(t),evalm(On));

                         [cos(%1) a3 + a2 cos(%1)]
                         [                       ]
                         [sin(%1) a3 + a2 sin(%1)]
                   On := [                       ]
                         [    d3(t) + d2 + d1    ]
                         [                       ]
                         [           1           ]

                       %1 := theta1(t) + theta2(t)

> dOn:=map(x->diff(x,t),On);

                      [-sin(%2) %1 a3 - a2 sin(%2) %1]
                      [                              ]
                      [cos(%2) %1 a3 + a2 cos(%2) %1 ]
                      [                              ]
               dOn := [           d                  ]
                      [           -- d3(t)           ]
                      [           dt                 ]
                      [                              ]
                      [              0               ]

                        /d           \   /d           \
                  %1 := |-- theta1(t)| + |-- theta2(t)|
                        \dt          /   \dt          /

                       %2 := theta1(t) + theta2(t)

> J:=matrix([[diff(theta1(t),t)],[diff(theta2(t),t)],[diff(d3(t),t)],[diff(theta4(t),t)]]);
>

                              [d           ]
                              [-- theta1(t)]
                              [dt          ]
                              [            ]
                              [d           ]
                              [-- theta2(t)]
                              [dt          ]
                         J := [            ]
                              [  d         ]
                              [  -- d3(t)  ]
                              [  dt        ]
                              [            ]
                              [d           ]
                              [-- theta4(t)]
                              [dt          ]

> A:=matrix([[-(a2+a3)*sin(theta1(t)+theta2(t)),-(a2+a3)*sin(theta1(t)+theta2(t)),0,0],[(a2+a3)*cos(theta1(t)+theta2(t)),(a2+a3)*cos(theta1(t)+theta2(t)),0,0],[0,0,1,0],[0,0,0,0]]);

           [-(a3 + a2) sin(%1)    -(a3 + a2) sin(%1)    0    0]
           [                                                  ]
           [(a3 + a2) cos(%1)     (a3 + a2) cos(%1)     0    0]
      A := [                                                  ]
           [        0                     0             1    0]
           [                                                  ]
           [        0                     0             0    0]

                       %1 := theta1(t) + theta2(t)

> simplify(evalm(dOn-evalm(A &* J)));

                                 [0]
                                 [ ]
                                 [0]
                                 [ ]
                                 [0]
                                 [ ]
                                 [0]



Donc dOn = AJ.

A+
Revenir en haut de page
Voir le profil de l'utilisateur Envoyer un message privé
bendesarts



Inscrit le: 27 Fév 2009
Messages: 234

MessagePosté le: 01 Déc 2009 8:19    Sujet du message: regroupement de termes ou factorisation dans une expression Répondre en citant

Ok merci beaucoup pour votre aide
Vous êtes d'une grande aide.
Encore une petite question:
Après m'être inspiré fortement de ce que vous m'avez proposé, j'en suis là. J'aimerais regrouper dans mon expression finale dOn en fonction des composantes de ce qu'on appellait J. En d'autres termes, regrouper dans l'expression dOn les termes en dérivées dtheta1/dt dtheta2/dt ...

Code:
with(linalg):
  f := (d, theta, a, alpha) -> [


>   [cos(theta), -cos(alpha) sin(theta), sin(theta) sin(alpha), a cos(theta)],


>   [sin(theta), cos(theta) cos(alpha), -cos(theta) sin(alpha), a sin(theta)],


>   [0, sin(alpha), cos(alpha), d], [0, 0, 0, 1]];


>   T01 := f(d1, theta1, 0, 0);


>   T12 := f(d2, theta2, a2, 0);


>   T23 := f(d3, 0, a3, 0);


>   T34 := f(0, theta4, 0, 0);


>   T4h := f(0, 0, a4, 0);


>   T0h := map(combine, evalm((((T01 &* T12) &* T23) &* T34) &* T4h));


>   On := submatrix(T0h, 1 .. 3, 4 .. 4);


>   On := subs(theta1 = theta1(t), theta2 = theta2(t), d3 = d3(t),


>   theta4 = theta4(t), evalm(On));


>             /      d       \


>   dOn := map|x -> --- x, On|;


>             \      dt      /

Warning, the protected names norm and trace have been redefined and unprotected

f := (d, theta, a, alpha) -> [





  [cos(theta), -cos(alpha) sin(theta), sin(theta) sin(alpha), a cos(theta)],





  [sin(theta), cos(theta) cos(alpha), -cos(theta) sin(alpha), a sin(theta)],





  [0, sin(alpha), cos(alpha), d], [0, 0, 0, 1]]

                  [cos(theta1)  -sin(theta1)  0  0 ]


                  [                                ]


                  [sin(theta1)  cos(theta1)   0  0 ]


           T01 := [                                ]


                  [     0            0        1  d1]


                  [                                ]


                  [     0            0        0  1 ]

            [cos(theta2)  -sin(theta2)  0  a2 cos(theta2)]


            [                                            ]


            [sin(theta2)  cos(theta2)   0  a2 sin(theta2)]


     T12 := [                                            ]


            [     0            0        1        d2      ]


            [                                            ]


            [     0            0        0        1       ]

                             [1  0  0  a3]


                             [           ]


                             [0  1  0  0 ]


                      T23 := [           ]


                             [0  0  1  d3]


                             [           ]


                             [0  0  0  1 ]

                   [cos(theta4)  -sin(theta4)  0  0]


                   [                               ]


                   [sin(theta4)  cos(theta4)   0  0]


            T34 := [                               ]


                   [     0            0        1  0]


                   [                               ]


                   [     0            0        0  1]

                             [1  0  0  a4]


                             [           ]


                             [0  1  0  0 ]


                      T4h := [           ]


                             [0  0  1  0 ]


                             [           ]


                             [0  0  0  1 ]

T0h := [[cos(theta1 + theta2 + theta4), -sin(theta1 + theta2 + theta4), 0, cos(theta1





   + theta2 + theta4) a4 + cos(theta1 + theta2) a3 + a2 cos(theta1 + theta2)],





  [sin(theta1 + theta2 + theta4), cos(theta1 + theta2 + theta4), 0, sin(theta1





   + theta2 + theta4) a4 + sin(theta1 + theta2) a3 + a2 sin(theta1 + theta2)],





  [0, 0, 1, d3 + d2 + d1], [0, 0, 0, 1]]

On := [[cos(theta1 + theta2 + theta4) a4 + cos(theta1 + theta2) a3





   + a2 cos(theta1 + theta2)], [sin(theta1 + theta2 + theta4) a4





   + sin(theta1 + theta2) a3 + a2 sin(theta1 + theta2)], [d3 + d2 + d1]]

On := [[cos(theta1(t) + theta2(t) + theta4(t)) a4





   + cos(theta1(t) + theta2(t)) a3 + a2 cos(theta1(t) + theta2(t))], [sin(





  theta1(t) + theta2(t) + theta4(t)) a4 + sin(theta1(t) + theta2(t)) a3





   + a2 sin(theta1(t) + theta2(t))], [d3(t) + d2 + d1]]

       [[


dOn := [[


       [[


                                        // d           \   / d           \


-sin(theta1(t) + theta2(t) + theta4(t)) ||--- theta1(t)| + |--- theta2(t)|


                                        \\ dt          /   \ dt          /





     / d           \\   


   + |--- theta4(t)|| a4


     \ dt          //   





                                // d           \   / d           \\   


   - sin(theta1(t) + theta2(t)) ||--- theta1(t)| + |--- theta2(t)|| a3


                                \\ dt          /   \ dt          //   





                                   // d           \   / d           \\]  [   


   - a2 sin(theta1(t) + theta2(t)) ||--- theta1(t)| + |--- theta2(t)||], [cos(


                                   \\ dt          /   \ dt          //]  [   





                                     // d           \   / d           \


  theta1(t) + theta2(t) + theta4(t)) ||--- theta1(t)| + |--- theta2(t)|


                                     \\ dt          /   \ dt          /





     / d           \\   


   + |--- theta4(t)|| a4


     \ dt          //   





                                // d           \   / d           \\   


   + cos(theta1(t) + theta2(t)) ||--- theta1(t)| + |--- theta2(t)|| a3


                                \\ dt          /   \ dt          //   





                                   // d           \   / d           \\] 


   + a2 cos(theta1(t) + theta2(t)) ||--- theta1(t)| + |--- theta2(t)||],


                                   \\ dt          /   \ dt          //] 





  [ d       ]]


  [--- d3(t)]]


  [ dt      ]]

Revenir en haut de page
Voir le profil de l'utilisateur Envoyer un message privé
ALS



Inscrit le: 11 Sep 2006
Messages: 647

MessagePosté le: 02 Déc 2009 8:05    Sujet du message: Répondre en citant

Bonjour,
voici une solution en jonglant un peu avec les substitutions, factorisations et en utilisant la fonction collect.

Code:

>  restart;
>  with(linalg):
>  f := (d, theta, a, alpha) -> [ [cos(theta), -cos(alpha)* sin(theta), sin(theta) *sin(alpha), a* cos(theta)],
>     [sin(theta), cos(theta)* cos(alpha), -cos(theta) *sin(alpha), a* sin(theta)],
>     [0, sin(alpha), cos(alpha), d], [0, 0, 0, 1]];
 
 
>     T01 := f(d1, theta1, 0, 0);
>     T12 := f(d2, theta2, a2, 0);
>     T23 := f(d3, 0, a3, 0);
>     T34 := f(0, theta4, 0, 0);
>     T04 := map(combine, evalm(((T01 &* T12) &* T23) &* T34));

>     On := submatrix(T04, 1 .. 4, 4 .. 4);
>  On:=subs(theta1=theta1(t),theta2=theta2(t),d3=d3(t),theta4=theta4(t),evalm(On));
 
> dOn:=map(x->diff(x,t),On);
 



  f := (d, theta, a, alpha) -> [[cos(theta), -cos(alpha) sin(theta),

        sin(theta) sin(alpha), a cos(theta)], [sin(theta),

        cos(theta) cos(alpha), -cos(theta) sin(alpha), a sin(theta)],

        [0, sin(alpha), cos(alpha), d], [0, 0, 0, 1]]


  T01 := [[cos(theta1), -sin(theta1), 0, 0],

        [sin(theta1), cos(theta1), 0, 0], [0, 0, 1, d1], [0, 0, 0, 1]

        ]


  T12 := [[cos(theta2), -sin(theta2), 0, a2 cos(theta2)],

        [sin(theta2), cos(theta2), 0, a2 sin(theta2)], [0, 0, 1, d2],

        [0, 0, 0, 1]]


  T23 := [[1, 0, 0, a3], [0, 1, 0, 0], [0, 0, 1, d3], [0, 0, 0, 1]]


  T34 := [[cos(theta4), -sin(theta4), 0, 0],

        [sin(theta4), cos(theta4), 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]


  T04 :=

        [cos(%1) , -sin(%1) , 0 ,

        cos(theta1 + theta2) a3 + a2 cos(theta1 + theta2)]

        [sin(%1) , cos(%1) , 0 ,

        sin(theta1 + theta2) a3 + a2 sin(theta1 + theta2)]

        [0 , 0 , 1 , d3 + d2 + d1]

        [0 , 0 , 0 , 1]

  %1 := theta1 + theta2 + theta4


            [cos(theta1 + theta2) a3 + a2 cos(theta1 + theta2)]
            [                                                 ]
            [sin(theta1 + theta2) a3 + a2 sin(theta1 + theta2)]
      On := [                                                 ]
            [                  d3 + d2 + d1                   ]
            [                                                 ]
            [                        1                        ]


                         [cos(%1) a3 + a2 cos(%1)]
                         [                       ]
                         [sin(%1) a3 + a2 sin(%1)]
                   On := [                       ]
                         [    d3(t) + d2 + d1    ]
                         [                       ]
                         [           1           ]

                       %1 := theta1(t) + theta2(t)


                      [-sin(%2) %1 a3 - a2 sin(%2) %1]
                      [                              ]
                      [cos(%2) %1 a3 + a2 cos(%2) %1 ]
                      [                              ]
               dOn := [           d                  ]
                      [           -- d3(t)           ]
                      [           dt                 ]
                      [                              ]
                      [              0               ]

                        /d           \   /d           \
                  %1 := |-- theta1(t)| + |-- theta2(t)|
                        \dt          /   \dt          /

                       %2 := theta1(t) + theta2(t)


                              //d           \   /d           \\
  -sin(theta1(t) + theta2(t)) ||-- theta1(t)| + |-- theta2(t)|| a3 -
                              \\dt          /   \dt          //

        a2 sin(theta1(t) + theta2(t))

        //d           \   /d           \\
        ||-- theta1(t)| + |-- theta2(t)||
        \\dt          /   \dt          //

> m:=subs(diff(theta1(t),t)=dth1,diff(theta2(t),t)=dth2,evalm(dOn));

          [-sin(%1) (dth1 + dth2) a3 - a2 sin(%1) (dth1 + dth2)]
          [                                                    ]
          [cos(%1) (dth1 + dth2) a3 + a2 cos(%1) (dth1 + dth2) ]
          [                                                    ]
     m := [                      d                             ]
          [                      -- d3(t)                      ]
          [                      dt                            ]
          [                                                    ]
          [                         0                          ]

                       %1 := theta1(t) + theta2(t)

> m:=map( x->factor(  collect(x,[dth1,dth2])),evalm(m));

           [-sin(theta1(t) + theta2(t)) (dth1 + dth2) (a3 + a2)]
           [                                                   ]
           [cos(theta1(t) + theta2(t)) (dth1 + dth2) (a3 + a2) ]
           [                                                   ]
      m := [                     d                             ]
           [                     -- d3(t)                      ]
           [                     dt                            ]
           [                                                   ]
           [                         0                         ]

> dOn:=subs(dth1=diff(theta1(t),t),dth2=diff(theta2(t),t),evalm(m));

  dOn :=

        [
        [-sin(theta1(t) + theta2(t))
        [

        //d           \   /d           \\          ]
        ||-- theta1(t)| + |-- theta2(t)|| (a3 + a2)]
        \\dt          /   \dt          //          ]

        [                           //d           \   /d           \\
        [cos(theta1(t) + theta2(t)) ||-- theta1(t)| + |-- theta2(t)||
        [                           \\dt          /   \dt          //

                 ]
        (a3 + a2)]
                 ]

        [d       ]
        [-- d3(t)]
        [dt      ]

        [0]



It's OK?
Revenir en haut de page
Voir le profil de l'utilisateur Envoyer un message privé
Montrer les messages depuis:   
Poster un nouveau sujet   Répondre au sujet    Apprendre Maple Index du Forum -> Maple en analyse Toutes les heures sont au format GMT + 2 Heures
Page 1 sur 1

 
Sauter vers:  
Vous ne pouvez pas poster de nouveaux sujets dans ce forum
Vous ne pouvez pas répondre aux sujets dans ce forum
Vous ne pouvez pas éditer vos messages dans ce forum
Vous ne pouvez pas supprimer vos messages dans ce forum
Vous ne pouvez pas voter dans les sondages de ce forum


phpBB

Développé par phpBB © 2001, 2006 phpBB Group
Traduction par : phpBB-fr.com


Apprendre Maple - ©  - Alain Le Stang - Navigation optimisée pour une résolution 1024 x 768.