Discussion:
inverse cross product
(too old to reply)
Mark Schelbergen
2010-05-20 13:09:04 UTC
Permalink
I use the equation below:
M=r x F (all vectors)
The moment; M and the arm; r are known, is there a way to calculate the force; F?
Does matlab has a function for this problem?

Thanks for reading my question, Mark
Matt J
2010-05-20 14:00:24 UTC
Permalink
Post by Mark Schelbergen
M=r x F (all vectors)
The moment; M and the arm; r are known, is there a way to calculate the force; F?
=====================

No, there is no unique solution for F. You can convert this equation to a matrix equation using the function xprodmat below

R=xprodmat(r);
M=R*F;

but the matrix R will always be singular.


function A=xprodmat(a)
%Matrix representation of a cross product
%
% A=xprodmat(a)
%
%in:
%
% a: 3D vector
%
%out:
%
% A: a matrix such that A*b=cross(a,b)



if length(a)<3, v(a)=0; end

ax=a(1);
ay=a(2);
az=a(3);

A=zeros(3);

A(2,1)=az; A(1,2)=-az;
A(3,1)=-ay; A(1,3)=ay;
A(3,2)=ax; A(2,3)=-ax;
Roger Stafford
2010-05-20 14:20:24 UTC
Permalink
Post by Mark Schelbergen
M=r x F (all vectors)
The moment; M and the arm; r are known, is there a way to calculate the force; F?
Does matlab has a function for this problem?
Thanks for reading my question, Mark
Matt J is right. Any vector F2 which is given by

F2 = cross(M,r)/dot(r,r)+k*r

where k is any scalar whatever, will be a solution. To see this, just take the cross product of r and such an F2 and you will always get M.

Roger Stafford
Mark Schelbergen
2010-05-25 13:10:21 UTC
Permalink
what is wrong with this:

F2=uv(cross(M,r))*norm(M)/norm(r);

where uv() is af function to determine the unit vector
Matt J
2010-05-25 14:41:42 UTC
Permalink
Post by Mark Schelbergen
F2=uv(cross(M,r))*norm(M)/norm(r);
where uv() is af function to determine the unit vector
As we've been saying, it is only 1 of an infinite number of possible solutions.
Mark Schelbergen
2010-05-25 14:55:25 UTC
Permalink
Sorry I didn't fully understand your replies..
But if I put the resulting F back into the equation beneath, with the r I used as input:
M=cross(r,F)
I get another M as I used as input.
I am confused:S
Matt J
2010-05-25 17:11:06 UTC
Permalink
Post by Mark Schelbergen
Sorry I didn't fully understand your replies..
M=cross(r,F)
I get another M as I used as input.
=============

Seems like it should work. Perhaps a bug in your implementation of uv() ?
Continue reading on narkive:
Loading...