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:
How to solve nonlinear vector eqaution?

Subject: How to solve nonlinear vector eqaution?

From: Lockywolf

Date: 24 Oct, 2011 13:37:29

Message: 1 of 3

The equation looks the following:

(x-m1)'Y1(x-m1)=a*(x-m2)'Y2(x-m2)

'a' is a real, 'Y1' and 'Y2' are 2-dimencional matrices, 'm1' and 'm2' are 2-dim vectors and 'x' is a 2-dim vector for which i want to solve the equation.

Of course it has an infinite number of solutions.(it is an ellypse actually)

I want to plot the zeros on [-5 5]x[-1 6]

How can i do it?

Subject: How to solve nonlinear vector eqaution?

From: Bill Whiten

Date: 25 Oct, 2011 09:26:11

Message: 2 of 3

"Lockywolf" wrote in message <j83pmp$1iq$1@newscl01ah.mathworks.com>...
> The equation looks the following:
>
> (x-m1)'Y1(x-m1)=a*(x-m2)'Y2(x-m2)
>
> 'a' is a real, 'Y1' and 'Y2' are 2-dimencional matrices, 'm1' and 'm2' are 2-dim vectors and 'x' is a 2-dim vector for which i want to solve the equation.
>
> Of course it has an infinite number of solutions.(it is an ellypse actually)
>
> I want to plot the zeros on [-5 5]x[-1 6]
>
> How can i do it?

Choose values for x(1) then you have a quadratic for x(2) which is easily solved.
You can then plot the ellipse.

Subject: How to solve nonlinear vector eqaution?

From: Christopher Creutzig

Date: 8 Nov, 2011 09:00:59

Message: 3 of 3

On 24.10.11 15:37, Lockywolf wrote:
> The equation looks the following:
>
> (x-m1)'Y1(x-m1)=a*(x-m2)'Y2(x-m2)
>
> 'a' is a real, 'Y1' and 'Y2' are 2-dimencional matrices, 'm1' and 'm2' are 2-dim vectors and 'x' is a 2-dim vector for which i want to solve the equation.
>
> Of course it has an infinite number of solutions.(it is an ellypse actually)
>
> I want to plot the zeros on [-5 5]x[-1 6]
>
> How can i do it?

a = rand;
Y1 = rand(2,2);
Y2 = rand(2,2);
m1 = rand(2, 1);
m2 = rand(2, 1);

ezplot(@(x,y) ...
  ([x;y]-m1)'*Y1*([x;y]-m1)-a*([x;y]-m2)'*Y2*([x;y]-m2), ...
  [-5 5 -1 6])


Christopher

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