Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Lagrange Multipliers-Please Help

  1. Dec 8, 2005 #1
    Hi all, I was wondering how to go about solving an optimization problem for a function f(x,y,z) where the two constraint equations are given by:

    a is less than or equal to g(x,y,z) is less than or equal to b
    (a and b are two distinct numbers)
    h(x,y,z) is less than or equal to c
    (c is another number distinct from a and b)

    Can Lagrange Multipliers solve this problem? In other words, is there some trick to put the constraint equation in the standard form for which Lagrange Multipliers works? Any help is appreciated. Thanks
     
  2. jcsd
  3. Dec 8, 2005 #2

    JasonRox

    User Avatar
    Homework Helper
    Gold Member


    When you have one constraint, you write it as (let p be the lambda thing or whatever you use)...

    Note: f_x is the partial derivative with respect to x.

    f_x (x,y,z) = p * g_x (x,y,z)
    f_y (x,y,z) = p * g_y (x,y,z)
    f_z (x,y,z) = p * g_z (x,y,z)
    g(x,y,z) = k

    ... where k is the constraint.

    For multiple constraints, simply write as (where w is your lambda_2)...

    f_x (x,y,z) = p * g_x (x,y,z) + w * h_x (x,y,z)
    f_y (x,y,z) = p * g_y (x,y,z) + w * h_y (x,y,z)
    f_z (x,y,z) = p * g_z (x,y,z) + w * h_z (x,y,z)
    g(x,y,z) = k
    h(x,y,z) = j

    ...where k and j are the constraints.

    See the pattern here? You can add as many as you want, but I do know that it's not fun solving, for most of them anyways. :tongue:

    If you have a <= or >= as a constraint, you simply find the critical points within the boundaries, evaluate them, and evaluate all the points on the boundary, and then take the largest value. This is basically the same thing as finding a maximum/minimum.
     
  4. Dec 8, 2005 #3
    Jason, thanks for the response. I understand how to use the Lagrange multipliers for an equality constraint. I think I didn't describe my problem clearly, the inequality constraints are on the variables, not on the function itself...here is my specific problem: the function to be maximized is

    f(x,y,z,t,w)=ln((y^2-x^2)(z^2-t^2)w^3))+.8x-1.2y-20z/17+14t/17-w^3/pi^3

    subject to the constraints:
    x/2+y+3z+3t+2.5w<=30
    1800<=130x+150y+200z+70t+110a<=3000

    I computed all of the partials (for any values of the variables) and set them equal to zero and found (2,3,7/3,10/3/pi) to be the only critical point but this gives a value of -3 which doesn't make much sense for the problem I'm working with, so I don't think I went about it right...
     
  5. Dec 8, 2005 #4

    JasonRox

    User Avatar
    Homework Helper
    Gold Member

    Did you check the values around the boundaries as well?

    You must check those at the critical points AND those on the boundary, and then take the maximum value.
     
  6. Dec 9, 2005 #5
    That's my problem, I don't understand how to do that; I have two constraint equations for five variables and so I don't know how to figure out the boundaries of each variable...
     
  7. Dec 9, 2005 #6

    matt grime

    User Avatar
    Science Advisor
    Homework Helper

    I tihnk the thing you need are called slack variables. google for details about them cos it's been too long since i did anything them with them to know i'll get it right.
     
  8. Dec 9, 2005 #7

    JasonRox

    User Avatar
    Homework Helper
    Gold Member

  9. Dec 9, 2005 #8
    Thanks for the link. Where I'm confused is what to do about having both an upper and lower bound as my constraints, if it was just upper bound I see what to do but I don't know how to handle both.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: Lagrange Multipliers-Please Help
Loading...