Results 1 to 3 of 3

Math Help - Lagrange Multipliers

  1. #1
    Newbie
    Joined
    Sep 2009
    From
    Michigan
    Posts
    20

    Lagrange Multipliers

    Could use some help! I'm close but not quite able to see what I'm doing wrong.

    Here's the setup:

    f(x) = 2x1^2 - x2^2

    subject to:
    g1(x) = x1^2 - x2 - 9
    g2(x) = -x1 + x2 +3

    with xtau = {-2 -5}T

    I found the gradient of f(xtau) to be {4x1 -2x2}T, which using xtau turns into {-8 10}.

    I computed the gradients of g1(x) and g2(x) to be:
    gradient g1(x) = {2x1 -1}T
    gradient g2(x) = {-1 1}T

    Correct so far?

    From this, I get a bit confused when setting up the computation for the Lagrange multiplier (meaning I don't get an answer that matches one of the possible choices).

    My understanding is that it should be:
    gradient of f(x) + lambda1*gradient of g1(x) + lambda2*gradient of g2(x) = 0 matrix

    In Matlab I enter the following:

    b = [-8; 10];
    A = [-4, 0; -1, 0];
    x = A \ b; % to compute least squares

    At this point, I get {-0.4 9.6}T which doesn't appear to be correct.

    Any help in understanding what I'm doing wrong will be appreciated.

    Thanks!
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by dsprice View Post
    Could use some help! I'm close but not quite able to see what I'm doing wrong.

    Here's the setup:

    f(x) = 2x1^2 - x2^2

    subject to:
    g1(x) = x1^2 - x2 - 9
    g2(x) = -x1 + x2 +3
    Ok up to here, we have a constrained non-linear optimisation problem.

    But what is all of this:

    with xtau = {-2 -5}T

    I found the gradient of f(xtau) to be {4x1 -2x2}T, which using xtau turns into {-8 10}.

    I computed the gradients of g1(x) and g2(x) to be:
    gradient g1(x) = {2x1 -1}T
    gradient g2(x) = {-1 1}T

    Correct so far?

    From this, I get a bit confused when setting up the computation for the Lagrange multiplier (meaning I don't get an answer that matches one of the possible choices).

    My understanding is that it should be:
    gradient of f(x) + lambda1*gradient of g1(x) + lambda2*gradient of g2(x) = 0 matrix

    In Matlab I enter the following:

    b = [-8; 10];
    A = [-4, 0; -1, 0];
    x = A \ b; % to compute least squares

    At this point, I get {-0.4 9.6}T which doesn't appear to be correct.

    Any help in understanding what I'm doing wrong will be appreciated.

    Thanks!
    where is the Lagrangian, what does xtau represent and what is T?

    CB
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Sep 2009
    From
    Michigan
    Posts
    20
    Sorry. I need to learn how to enter equations in normal format.

    xtau is x with tau as the superscript. xtau is the candidate solution for the optimization problem. T should also be a superscript. T is the transform of the matrix shown as I didn't know how to represent it as a one column vector.

    Okay, so the gradient of f(xtau) is a one column vector of df/dx1 and df/dx2. This translates into 4x1 and -2x2. At xtau, this computes to a one column vector of -8 and 10. The gradient of g1(x) should be a one column vector of 2x1 and -1, and the gradient of g2(x) should be a one column vector of -1 and 1. Hopefully right so far.

    If I understand the computation of the Lagrange multipliers at xtau correctly, then the gradient of f(xtau) + lambda1*(gradient of g1(xtau)) + lambda2*(gradient of g2(xtau)) should be set to the 0 vector. At this point, the problem becomes one of solving for lambda1 and lambda2.

    Ah! I just figured out what I did wrong! In setting up the equation, instead of using the gradient of f(xtau), I used xtau directly! Now I get one of the 8 possible solutions and am comfortable that I now have it right.

    Thanks! This did help to walk through it as I've been racking my brains out for several days trying to figure out what was wrong.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. lagrange multipliers
    Posted in the Calculus Forum
    Replies: 1
    Last Post: November 10th 2009, 03:24 AM
  2. Lagrange Multipliers
    Posted in the Calculus Forum
    Replies: 3
    Last Post: May 1st 2009, 12:49 PM
  3. Lagrange Multipliers in 4D
    Posted in the Calculus Forum
    Replies: 1
    Last Post: February 23rd 2009, 10:37 AM
  4. Lagrange multipliers
    Posted in the Calculus Forum
    Replies: 4
    Last Post: February 22nd 2009, 02:17 PM
  5. Lagrange Multipliers
    Posted in the Calculus Forum
    Replies: 1
    Last Post: February 2nd 2009, 10:26 PM

Search Tags


/mathhelpforum @mathhelpforum