Thread Subject: Linear Simlutaneous Equations

Subject: Linear Simlutaneous Equations

From: Damien

Date: 9 Oct, 2008 13:53:12

Message: 1 of 3

Hi all,

I have the following six equations:

1. Reaction-Y1 + Force13*sin(A1) + Force12*sin(A3) = 0
2. Reaction-X1 + Force13*cos(A1) + Force12*cos(A3) = 0
3. Reaction-Y2 + Force21*sin(A1) + Force23*sin(A2) = 0
4. Reaction-X2 + Force21*cos(A1) + Force23*cos(A2) = 0
5. Reaction-Y3 + Force31*sin(A2) + Force32*sin(A3) = 0
6. Reaction-X3 + Force31*cos(A2) + Force32*cos(A3) = 0

I have calculated the Reaction values for all 6 of them, and all the angles of each of them.

How would I substitute these equations into a Matrix, so that I can solve for the forces, using the form of

AX = B

Where A is a square matrix, X is a vector of unknowns (Forces) and B is a vector of knowns, i.e, the Reactions forces.

Any help will be appreciated. Thanks.

Damien

Subject: Linear Simlutaneous Equations

From: Freelance Embedded Systems Engineer

Date: 9 Oct, 2008 16:46:20

Message: 2 of 3

Damien wrote:
> Hi all, I have the following six equations:
> 1. Reaction-Y1 + Force13*sin(A1) + Force12*sin(A3) = 0
> 2. Reaction-X1 + Force13*cos(A1) + Force12*cos(A3) = 0
> 3. Reaction-Y2 + Force21*sin(A1) + Force23*sin(A2) = 0
> 4. Reaction-X2 + Force21*cos(A1) + Force23*cos(A2) = 0
> 5. Reaction-Y3 + Force31*sin(A2) + Force32*sin(A3) = 0
> 6. Reaction-X3 + Force31*cos(A2) + Force32*cos(A3) = 0
>
> I have calculated the Reaction values for all 6 of them, and all the
> angles of each of them. How would I substitute these equations into a
> Matrix, so that I can solve for the forces, using the form of
> AX = B
> Where A is a square matrix, X is a vector of unknowns (Forces) and B
> is a vector of knowns, i.e, the Reactions forces.
> Any help will be appreciated. Thanks. Damien

Just rewrite is as a matrix/vector equation the same way that you stated it.

[sin(A3) sin(A1) 0 0 0 0 ] [Force12] [Reaction-Y1]
[cos(A3) cos(A1) 0 0 0 0 ] [Force13] [Reaction-X1]
[ 0 0 sin(A1) sin(A2) 0 0 ]*[Force21]= [Reaction-Y2]
[ 0 0 cos(A1) cos(A2) 0 0 ] [Force23] [Reaction-X2]
[ 0 0 0 0 sin(A2) sin(A3) ] [Force31] [Reaction-Y3]
[ 0 0 0 0 cos(A2) cos(A3) ] [Force32] [Reaction-X3]


                                              [A]*[X] = [B]

X = inv(A)*B if the inverse exists.
Otherwise, using the pseudoinverse to give you a leastsquare solution.
X = A\B

Note the wrap-around pattern of A3-A1,A1-A2,A2-A3

Subject: Linear Simlutaneous Equations

From: Bruno Luong

Date: 9 Oct, 2008 19:08:02

Message: 3 of 3

Freelance Embedded Systems Engineer <g9u5dd43@yahoo.com> wrote in message <48EE355C.9000106@yahoo.com>...

> X = inv(A)*B if the inverse exists.

Better use this
X = A \ B


> Otherwise, using the pseudoinverse to give you a leastsquare solution.
> X = A\B
>

No, use X = pinv(A)*B or better still X=lsqr(A,B)

Example:

A=[1 2; 2 4]
B = [3; 6]

>> A\B
Warning: Matrix is singular to working precision.

ans =

   NaN
   NaN

>> pinv(A)*B % Use lsqr

ans =

    0.6000
    1.2000

Bruno

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com