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:
running iterations

Subject: running iterations

From: Omkar Palsule-Desai

Date: 10 Jan, 2009 02:46:02

Message: 1 of 2


Hi,

I am trying to run an iterative procedure. I have two variables X(1) and X(2) and two constants K(1) and K(2). Equations to be solved are

X(1) = max[X(2)-K(1), 0]
X(2) = max[X(1)-K(2), 0]

Basically, X(1) and X(2) are non-negative. K(1) and K(2) are real positive or negative constants. Can someone help me in running an iterative process to find an "equilibrium" solution for this?

Thank you in advance.

Omkar

Subject: running iterations

From: Roger Stafford

Date: 10 Jan, 2009 04:42:02

Message: 2 of 2

"Omkar Palsule-Desai" <omkardpd@iimahd.ernet.in> wrote in message <gk925a$ksd$1@fred.mathworks.com>...
>
> Hi,
>
> I am trying to run an iterative procedure. I have two variables X(1) and X(2) and two constants K(1) and K(2). Equations to be solved are
>
> X(1) = max[X(2)-K(1), 0]
> X(2) = max[X(1)-K(2), 0]
>
> Basically, X(1) and X(2) are non-negative. K(1) and K(2) are real positive or negative constants. Can someone help me in running an iterative process to find an "equilibrium" solution for this?
>
> Thank you in advance.
>
> Omkar

  I find it curious that you want to do iteration on this. There are ways of finding a stable X(1) and X(2) in just one step. However, if K(1)+K(2) > 0, iteration will always get you there after finitely many steps. On the other hand, if K(1)+K(2) < 0, there is no solution and iteration will cause X(1) and X(2) to increase indefinitely.

  Hint: You will find matlab's 'while' command very useful for your iteration.

Roger Stafford

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