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 equation

Subject: Solving equation

From: Frank

Date: 24 May, 2012 07:39:09

Message: 1 of 10

Hello. I have a matrix equation problem.

Ax = b, |x_i| = 1

where the dimensions of the complex matrices A, x, b are (M-2)-by-M, M-by-1 and (M-2)-by-1, respectively. The problem has a constraint that all elements of x should have magnitude 1.

How can I solve this problem?
Is the solution unique?

Thanks a lot.

Subject: Solving equation

From: Nasser M. Abbasi

Date: 24 May, 2012 08:05:04

Message: 2 of 10

On 5/24/2012 2:39 AM, Frank wrote:
> Hello. I have a matrix equation problem.
>
> Ax = b, |x_i| = 1
>
>

> How can I solve this problem?

A\b

> Is the solution unique?

if A is not singular, yes.

--Nasser

Subject: Solving equation

From: Frank

Date: 24 May, 2012 08:45:12

Message: 3 of 10

Thanks for your reply.

However, we want x = [x_1, x_2, ... x_M]^T with |x_1|=|x_2| = ...=|x_M| = 1.
Your solution cannot satisfy the constraints.




"Nasser M. Abbasi" <nma@12000.org> wrote in message <jpkq3m$9oc$1@speranza.aioe.org>...
> On 5/24/2012 2:39 AM, Frank wrote:
> > Hello. I have a matrix equation problem.
> >
> > Ax = b, |x_i| = 1
> >
> >
>
> > How can I solve this problem?
>
> A\b
>
> > Is the solution unique?
>
> if A is not singular, yes.
>
> --Nasser
>

Subject: Solving equation

From: Nasser M. Abbasi

Date: 24 May, 2012 09:00:20

Message: 4 of 10

On 5/24/2012 3:45 AM, Frank wrote:
> Thanks for your reply.
>
> However, we want x = [x_1, x_2, ... x_M]^T with |x_1|=|x_2| = ...=|x_M| = 1.
> Your solution cannot satisfy the constraints.
>
>

There is only one solution if A is not singular?

Whatever it comes out, I have no control over that.

As an example, you are like asking to find a solution to

         4 * x = 2 ----- (1)

With the constraint that the solution is |x| = 1

But the solution is 0.5. There is only one solution.

I do not know how to give you a solution to (1) which comes out
to be satisfy your constraint that is should be something else.

So, I do not understand the question:

"Solve this equation which, has a unique solution, such that the solution
has this property and nothing else"

If your equation does not have a unique solution, then may be
may be there is a way to find all the solutions (which can be
infinite of them), and then pick the one which satisfy your
requirements. I was assuming your are solving Ax=b such that
A is not singular.

--Nasser

>
>
> "Nasser M. Abbasi"<nma@12000.org> wrote in message<jpkq3m$9oc$1@speranza.aioe.org>...
>> On 5/24/2012 2:39 AM, Frank wrote:
>>> Hello. I have a matrix equation problem.
>>>
>>> Ax = b, |x_i| = 1
>>>
>>>
>>
>>> How can I solve this problem?
>>
>> A\b
>>
>>> Is the solution unique?
>>
>> if A is not singular, yes.
>>
>> --Nasser
>>

Subject: Solving equation

From: Bruno Luong

Date: 24 May, 2012 09:06:09

Message: 5 of 10

"Frank " <allinone_2003@yahoo.com.hk> wrote in message <jpkseo$afl$1@newscl01ah.mathworks.com>...
> Thanks for your reply.
>
> However, we want x = [x_1, x_2, ... x_M]^T with |x_1|=|x_2| = ...=|x_M| = 1.

x= 2*(dec2bin(0:2^M-1)-'0')-1
x = x(find(ismember(x*A',b','rows')),:)'

% Bruno

Subject: Solving equation

From: Star Strider

Date: 24 May, 2012 13:35:14

Message: 6 of 10

"Frank " <allinone_2003@yahoo.com.hk> wrote in message <jpkoit$p1i$1@newscl01ah.mathworks.com>...
> Hello. I have a matrix equation problem.
>
> Ax = b, |x_i| = 1
>
> where the dimensions of the complex matrices A, x, b are (M-2)-by-M, M-by-1 and (M-2)-by-1, respectively. The problem has a constraint that all elements of x should have magnitude 1.
>
> How can I solve this problem?
> Is the solution unique?
>
> Thanks a lot.

--------------------------------------------------------------------

I suggest you see if ‘fmincon’ can do what you want. I don't have much experience with ‘fmincon’ so I won't attempt an example.

As to the solution being unique, that likely depends on the structure of A. You’ll have to experiment with it.

Subject: Solving equation

From: Star Strider

Date: 24 May, 2012 13:35:14

Message: 7 of 10

"Frank " <allinone_2003@yahoo.com.hk> wrote in message <jpkoit$p1i$1@newscl01ah.mathworks.com>...
> Hello. I have a matrix equation problem.
>
> Ax = b, |x_i| = 1
>
> where the dimensions of the complex matrices A, x, b are (M-2)-by-M, M-by-1 and (M-2)-by-1, respectively. The problem has a constraint that all elements of x should have magnitude 1.
>
> How can I solve this problem?
> Is the solution unique?
>
> Thanks a lot.

--------------------------------------------------------------------

I suggest you see if ‘fmincon’ can do what you want. I don't have much experience with ‘fmincon’ so I won't attempt an example.

As to the solution being unique, that likely depends on the structure of A. You’ll have to experiment with it.

Subject: Solving equation

From: Bruno Luong

Date: 24 May, 2012 14:07:07

Message: 8 of 10


> I suggest you see if ‘fmincon’ can do what you want. I don't have much experience with ‘fmincon’ so I won't attempt an example.

No, fmincon is suitable not for binary optimizaton.

>
> As to the solution being unique, that likely depends on the structure of A. You’ll have to experiment with it.

No again; a reasoning that is true for real variables is no longer true for discrete variables.

Bruno

Subject: Solving equation

From: Star Strider

Date: 24 May, 2012 16:00:21

Message: 9 of 10

"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <jplfab$sad$1@newscl01ah.mathworks.com>...
>
> > I suggest you see if ‘fmincon’ can do what you want. I don't have much experience with ‘fmincon’ so I won't attempt an example.
>
> No, fmincon is suitable not for binary optimizaton.
>
> >
> > As to the solution being unique, that likely depends on the structure of A. You’ll have to experiment with it.
>
> No again; a reasoning that is true for real variables is no longer true for discrete variables.
>
> Bruno

---------------------------------------------------------------

I got the impression from the OP that A, x, and b were all _complex_ and not necessarily discrete or binary. The constraint is that the _magnitude_ of the individual elements of the complex x-vector, abs(x(k)) = 1 for all k. Thus my reply.



BTW, you’ve posted a number of elegant programming solutions, some of which I've found extremely useful. I suggest you create a function from your post in thread #319426 and upload it to FEX. I've seen the same question posted a few times since, so there seems a need for it.

Subject: Solving equation

From: Matt J

Date: 24 May, 2012 19:44:07

Message: 10 of 10

"Frank " <allinone_2003@yahoo.com.hk> wrote in message <jpkoit$p1i$1@newscl01ah.mathworks.com>...
>
>
> Is the solution unique?
============

Without the constraints |x_i|=1, the solution will always be non-unique, because
an (M-2)-by-M can never be full-column rank.

Even with the constraints, though (and assuming you're looking for a least squares solution), the solution can be non-unique.
As a simple example, take A=eye(M-2,M) and b=zeros(M-2,1).
All x satisfying the constraints are solutions in this case.

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