Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
inverse cross product

Subject: inverse cross product

From: Mark Schelbergen

Date: 20 May, 2010 13:09:04

Message: 1 of 7

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

Subject: inverse cross product

From: Matt J

Date: 20 May, 2010 14:00:24

Message: 2 of 7

"Mark Schelbergen" <mjewrik@hotmail.com> wrote in message <ht3c9g$8ko$1@fred.mathworks.com>...
> 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?
=====================

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;

Subject: inverse cross product

From: Roger Stafford

Date: 20 May, 2010 14:20:24

Message: 3 of 7

"Mark Schelbergen" <mjewrik@hotmail.com> wrote in message <ht3c9g$8ko$1@fred.mathworks.com>...
> 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 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

Subject: inverse cross product

From: Mark Schelbergen

Date: 25 May, 2010 13:10:21

Message: 4 of 7

what is wrong with this:

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

where uv() is af function to determine the unit vector

Subject: inverse cross product

From: Matt J

Date: 25 May, 2010 14:41:42

Message: 5 of 7

"Mark Schelbergen" <mjewrik@hotmail.com> wrote in message <htgi7t$3jq$1@fred.mathworks.com>...
> what is wrong with this:
>
> 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.

Subject: inverse cross product

From: Mark Schelbergen

Date: 25 May, 2010 14:55:25

Message: 6 of 7

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

Subject: inverse cross product

From: Matt J

Date: 25 May, 2010 17:11:06

Message: 7 of 7

"Mark Schelbergen" <mjewrik@hotmail.com> wrote in message <htgoct$46k$1@fred.mathworks.com>...
> 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.
=============

Seems like it should work. Perhaps a bug in your implementation of uv() ?

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us