Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1996
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1996

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Constrained Min, non-linear

  • To: mathgroup at smc.vnet.net
  • Subject: [mg4517] Re: Constrained Min, non-linear
  • From: Stephen P Luttrell <luttrell at signal.dra.hmg.gb>
  • Date: Fri, 2 Aug 1996 02:22:42 -0400
  • Organization: Defence Research Agency, Malvern
  • Sender: owner-wri-mathgroup at wolfram.com

Stefan Wolfrum wrote:
>...DELETIA...
> Where is f(x,y)=x^2+y^2 minimal, if x and y are
> constrained to abs(x+y)=1 ?

Try the following (this is long-winded for this particular
problem because the solution is geometrically obvious):

(* define the basic functions *)
f[x_, y_] := x^2 + y^2;
g[x_, y_] := x + y;
(* differentiate using a Lagrange multipler *)
dx = D[f[x,y] + a g[x,y], x];
dy = D[f[x,y] + a g[x,y], y];
(* find the stationary point *)
soln = Solve[{dx==0, dy==0}, {x,y}];
(* find values of a that satisfy Abs[g[x,y]]==1 at the stationary point *)
g0 = g[x, y] /. soln[[1]];
a1 = Solve[g0 == 1, a];
a2 = Solve[g0 == -1, a];
(* finally generate the 2 solutions *)
soln /. a1
soln /. a2

-- 
Dr Stephen P Luttrell                  luttrell at signal.dra.hmg.gb
Adaptive Systems Theory                01684-894046 (phone)
Room EX21, Defence Research Agency     01684-894384 (fax)           
Malvern, Worcs, WR14 3PS, U.K.         http://www.dra.hmg.gb/cis5pip/Welcome.html

==== [MESSAGE SEPARATOR] ====


  • Prev by Date: Re: Two Dimensional Numerical Integration Packages
  • Next by Date: Re:ListPlot the output of Print
  • Previous by thread: Constrained Min, non-linear
  • Next by thread: Re: Constrained Min, non-linear