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:
solving simultaneous equations with complex numbers

Subject: solving simultaneous equations with complex numbers

From: Adam Chapman

Date: 6 Jul, 2013 20:24:41

Message: 1 of 2

I have an equation of the form AX=B.

A=[-0.0002-6.6659i -0.0044-6.6830i
    0.0035-6.6548i -0.0049-6.6845i
   -0.0049-6.6845i 0.0110-6.6264i
    0.0075+16.6867i -0.0074+16.3202i
    0.0074+16.3595i -0.0072+15.9402i
   -0.0075+16.6466i 0.0074+16.3595i]

B=[ 0
  -0.0024-0.0011i
   0.4502+0.0079i
  -0.0528+0.0306i
  -0.0610+0.0213i
  -0.0364+0.0373i]



If I try to find a value for X using "X=A\B", then calculate "B2=A*X"

B2 is not equal to the original value of B.


I've also tried "X=linsolve(A,B)", which returns a different value for X, by again calaulting A*X does not return the original value of B.

I've been trying to work this out for a few hours but have no idea what's causing this strange behaviour.

Any help is massively appreciated.

Adam

Subject: solving simultaneous equations with complex numbers

From: Torsten

Date: 8 Jul, 2013 06:30:13

Message: 2 of 2

Adam Chapman <adamchapman1985@hotmail.co.uk> wrote in message <29dc21d0-d0ae-4ba3-9ba1-601c278c8c62@googlegroups.com>...
> I have an equation of the form AX=B.
>
> A=[-0.0002-6.6659i -0.0044-6.6830i
> 0.0035-6.6548i -0.0049-6.6845i
> -0.0049-6.6845i 0.0110-6.6264i
> 0.0075+16.6867i -0.0074+16.3202i
> 0.0074+16.3595i -0.0072+15.9402i
> -0.0075+16.6466i 0.0074+16.3595i]
>
> B=[ 0
> -0.0024-0.0011i
> 0.4502+0.0079i
> -0.0528+0.0306i
> -0.0610+0.0213i
> -0.0364+0.0373i]
>
>
>
> If I try to find a value for X using "X=A\B", then calculate "B2=A*X"
>
> B2 is not equal to the original value of B.
>
>
> I've also tried "X=linsolve(A,B)", which returns a different value for X, by again calaulting A*X does not return the original value of B.
>
> I've been trying to work this out for a few hours but have no idea what's causing this strange behaviour.
>
> Any help is massively appreciated.
>
> Adam

You have six equations and two unknowns - so you cannot expect that all equations are satisfied exactly.
MATLAB tries to determine X such that the equations are solved in the least-squares sense:
min_X ||A*X-B||_2.
Take a look at the MATLAB documentation for overdetermined systems of linear equations.

Best wishes
Torsten.

Tags for this Thread

No tags are associated with 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