C is a variable matrix, C=[w,x,y,x]
I have an equation T*Q*M=B; All the matrices are 4*4
B and Q are known constant matrices. But T and M are matrices which have elements as a function of variables in C.
For example: T=[0,cos(x).sin(y),0,
0,0,0,0,
1,1,1,1
0,0,0,0]
Similarly M.
Is it possible to solve for the matrix C(i.e for the variables in C).Help if possible

5 件のコメント

Walter Roberson
Walter Roberson 2019 年 8 月 4 日
Do you need all of the possible solutions as formulas ? Do you need any one numeric solution? Do you need any one numeric solution subject to some bounds constraints on x?
hrushikesh kyathari
hrushikesh kyathari 2019 年 8 月 4 日
I need any one solution.
Walter Roberson
Walter Roberson 2019 年 8 月 4 日
編集済み: Walter Roberson 2019 年 8 月 4 日
Make a function that calculates T*Q*M-B and fsolve() it.
hrushikesh kyathari
hrushikesh kyathari 2019 年 8 月 4 日
Tsb=[cos(c(1,1)),-sin(c(1,1)),0,c(2,1),
sin(c(1,1)),cos(c(1,1)),0,c(3,1),
0,0,1,0.0963,
0,0,0,1];
Tbo=[1,0,0,0.1662,
0,1,0,0,
0,0,1,0.0026
0,0,0,1];
M=[1,0,0,0.033,
0,1,0,0,
0,0,1,0.6546,
0,0,0,1];
Slist=[0,0,1,0,0.033,0,
0,-1,0,-0.5076,0,0,
0,-1,0,-0.3526,0,0,
0,-1,0,-0.2176,0,0,
0,0,1,0,0,0]';
Toe=FKinBody(M,Slist,c((4:8),1));
fun=(Tsb*Tbo*Toe)-X;
H = fsolve(fun,-500)
This is my code, When I try to run Fsolve it is showing error:FUN must be a function, a valid character vector expression, or an inline function object.
Walter Roberson
Walter Roberson 2019 年 8 月 4 日
編集済み: Walter Roberson 2019 年 8 月 4 日
What is FKinBody ?
In
fun=(Tsb*Tbo*Toe)-X;
what is X ? And what happened to B ?

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

回答 (2 件)

Walter Roberson
Walter Roberson 2019 年 8 月 4 日

0 投票

Tsb = @(c) [cos(c(1)), -sin(c(1)), 0, c(2);
sin(c(1)), cos(c(1)), 0, c(3);
0, 0, 1, 0.0963;
0, 0, 0, 1];
Tbo=[1, 0, 0, 0.1662;
0, 1, 0, 0;
0, 0, 1, 0.0026;
0, 0, 0, 1];
M=[1, 0, 0, 0.033;
0, 1, 0, 0;
0, 0, 1, 0.6546;
0, 0, 0, 1];
Slist=[0, 0, 1, 0, 0.033, 0;
0, -1, 0, -0.5076, 0, 0;
0, -1, 0, -0.3526, 0, 0;
0, -1, 0, -0.2176, 0, 0;
0, 0, 1, 0, 0, 0]';
Toe = @(c) FKinBody(M, Slist, c(4:8));
fun = @(c) (Tsb(c) * Tbo * Toe(c)) - B;
c0 = randi([-1000 1000], 1, 4);
H = fsolve(fun, c0)
John D'Errico
John D'Errico 2019 年 8 月 4 日

0 投票

You have what? 2 unknowns? I've seen various versions of these equations that you have written. But you do not have 16 unknowns.
You want 16 equations to be solved. That 4x4 matrix equation is equivalent to 16 equations. So unless you have 16 unknowns, you need to accept the solution will not be exact.
So you will use a solver that will handle a nonlinear least squares. I might suggest something like lsqnonlin or lsqcurvefit. They are not just there for curve fitting.

カテゴリ

製品

リリース

R2019a

タグ

質問済み:

2019 年 8 月 4 日

回答済み:

2019 年 8 月 4 日

Community Treasure Hunt

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

Start Hunting!

Translated by