Why is the derivative of a matrix not of the same order?

5 ビュー (過去 30 日間)
Farzad Torabi
Farzad Torabi 2022 年 11 月 15 日
回答済み: Walter Roberson 2022 年 11 月 17 日
Hi
I need to take the derivative of the "Q" matrix of joints in Matlab for a robot. but using the derivative method here
I see that the derivative of a 3x3 matrix is a 2x3 matrix! why? should it be so?
  4 件のコメント
Farzad Torabi
Farzad Torabi 2022 年 11 月 15 日
Thank you very much for your point
Les Beckham
Les Beckham 2022 年 11 月 16 日
You are quite welcome.

サインインしてコメントする。

採用された回答

Star Strider
Star Strider 2022 年 11 月 15 日
Use the gradient function instead of diff.
  6 件のコメント
Farzad Torabi
Farzad Torabi 2022 年 11 月 15 日
It worked!! Many Thanks!!!
Star Strider
Star Strider 2022 年 11 月 15 日
As always, my pleasure!

サインインしてコメントする。

その他の回答 (2 件)

Walter Roberson
Walter Roberson 2022 年 11 月 17 日
For the case where rotations are no rotations in z, but there are two joints moving around and with angular rotational velocities and :
syms x y z t alpha_1 alpha_2 cx_1 cy_1 cz_1 cx_2 cy_2 cz_2 theta theta_1 theta_2
R = @(theta) [cos(theta) sin(theta) 0 0; -sin(theta) cos(theta) 0 0; 0 0 1 0; 0 0 0 1]
R = function_handle with value:
@(theta)[cos(theta),sin(theta),0,0;-sin(theta),cos(theta),0,0;0,0,1,0;0,0,0,1]
T = @(tx, ty, tz) [1 0 0 tx; 0 1 0 ty; 0 0 1 tz; 0 0 0 1]
T = function_handle with value:
@(tx,ty,tz)[1,0,0,tx;0,1,0,ty;0,0,1,tz;0,0,0,1]
RotAround = @(theta, cx, cy, cz) T(-cx, -cy, -cz) * R(theta) * T(cx, cy, cz)
RotAround = function_handle with value:
@(theta,cx,cy,cz)T(-cx,-cy,-cz)*R(theta)*T(cx,cy,cz)
Q1 = RotAround(theta_1 + alpha_1 * t, cx_1, cy_1, cz_1)
Q1 = 
Q2 = RotAround(theta_2 + alpha_2 * t, cx_2, cy_2, cz_2)
Q2 = 
Q = simplify(Q1 * Q2)
Q = 
eqns = Q*[x;y;z;0]
eqns = 
dx = simplify(diff(eqns(1), t))
dx = 
dy = simplify(diff(eqns(2), t))
dy = 
dz = simplify(diff(eqns(3), t))
dz = 
0
You could extend this to include rotations in Z or to include additional joints.

Bruno Luong
Bruno Luong 2022 年 11 月 15 日
編集済み: Bruno Luong 2022 年 11 月 15 日
I guess you mistaken between
Use the fist is just the difference of 3 rows of Q 3x3 matrix, there fore returns 2x3 matrix. It is NOT the derivative/
  4 件のコメント
Bruno Luong
Bruno Luong 2022 年 11 月 15 日
Nah, instead of taking the derivative wrt the robot joint (where the matrix depends on), he takes the difference of rows. Completely wrong methodology.
The discrepency is in the wrong computation methodology, nothing to do with accuracy of numerical method or step size.
Farzad Torabi
Farzad Torabi 2022 年 11 月 15 日
Bruno, since you seem to have experience in robotics, please advice me which method is correct when I have a numerical matrix of Q

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeRobotics についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by