Hi , i need help with Lagrange multipliers the question is as follows can you please go though it step by step any help is much appreciated thank you :) . Minimise p1+p2=60 Constraints 1-p1+p1^2=c1 1-0.6p2+p2^2=c2
I don't know how to approach this freaking question ? can anyone outline the steps i needs to find the minimum cost?
Just goggled multiplier formula: i guess: l(p,lamda)= p1+p2-60-l1(1+0.6p2+p2^2)-l2(1-p1+p2^2) is this correct?
Grrr I can't remember how to do these lol. Lemme write some stuff down and maybe it will jog my memory.
okay cool im new to this stuff...
your equation should be \[ f(p_1, p_2, L_1, L_2)= p_1 + p_2-60+ L_1(1-p_1+p_1^2-c_1) +L_2(1-0.6p_2+p_2^2-c2)\]
I assume p1 and p2 are variables. now take the 4 partial derivatives of f
right so the first part i did kinda made sense...
Yest p1 and p2 must be variables i guess , what about the l1 and l2 values should i expand the brackets ?
it doesn't matter much. what do you get for the d f/ dp1 ?
that l1 and l2 is confusng me ?
you treat them like variables p1 and p2 when you take the derivative of f() with respect to p1, all variables except p1 are treated as a constant.
1+l2=0 l2=-1 ? df/p1
among the terms there is the term L1(1-p1+p1^2- c1) d /d p1 = -L1 + 2 p1
lol i missed i 2pi i suck .. so next i have to do p2 i guess?
yes, the df/dL1 and df/dL2
so df/p2 =1-0.6l2 +2p2 ?
derivative df/dp2 f()= p1+p2−60+L1(1−p1+p1^2−c1)+L2(1−0.6p2+p2^2−c2) 1 -0.6*L2 + 2* p2 yes, that looks good
cool let me try to work out l1 and l2 quicky
hmmm do i have to expand the brackets for l1 and l2?
no, just treat the (stuff) in L1*(stuff) as a constant c*L1 and derivative is c
df/dl1=1-p1+p1^2 df/dl2= 1-0.6p2+p2^2 ?
for df/d L1 we have only this term with L1 : L1(1−p1+p1^2−c1) you get (1−p1+p1^2−c1)
so i guess df/dl2= (1-0.6p2+p2^2-c2) i expanded it lol should have left it factorized ...
So i think you have to equal them to zero to find the stationary points ?
yes, and that is often the hardest part. You often seem to get ugly equations using Lagrange...
so for df/dp1 do imake p1 the subject ?
i have never done or approached Lagrange ever before completely new to this...
at this point you have 4 equations and 4 unknowns. But they are non-linear equations, which makes them harder to solve. once you solve for all four "variables", you plug them into the original equation to get the optimum f() value (subject to the constraints) I have not solved these yet...
like this df/dp1=df/dp2 and df/dl1= df/dl2 ?
since its =0 i can equate them cant i?
I think you can solve for L1= -1/(2p1-1) L2= -1/(2 p2 - 0.6) use the quadratic formula to solve for p1 from the 3rd equation same for p2 from the 4th equation. put all of that mess into the original
df/dl1=1+root3/2i and 1root3/2i df/dl2= 3/10 +root91/10i and 3/10 -root91/10i ?
sorry not df ...
1−p1+p1^2−c1=0 I assume that c1 is an unknown constant
yes c1 and c2
subing it back in now...
these can't be correct df/dl1=1+root3/2i and 1root3/2i df/dl2= 3/10 +root91/10i and 3/10 -root91/10i ? because we have c1 and c2 in the originals equations
df/dl1=0 c1=1-pi+p1^2= 1+root3/2i and - 1root3/2i ? and so on ...
no, you have 1−p1+p1^2−c1=0 p1^2 - p1 + (1-c1) = 0 match to ax^2 + bx + c= 0 a=1, b= -1 , c= (1-c1)
ah ok ...
=1+or - root(-1)^2-4*1*(1-xc1)/2(1-c1)
its seems to be unsolvable..
we won't get a nice number, but a messy expression in terms of c1 and c2
so you needs to rearrange to get c1 and c2 the qudratic formula?
is this correct =1+or - root((-1)^2-4*1*(1-xc1))/2(1-c1) how do i proceed from here? for c1
the solution to \[ p_1^2 - p_1 + (1-c1) = 0 \] is \[ p_1= \frac{1 \pm\sqrt{4c_1-3}}{2} \]
damn stupid mistake...1 i see!
p2=1+ - root(-0.6)^2-4*(1-c2)/2 p2=1+ - 0.6-*2root(1-c2)/2
canel the 2 also
\[ p2= \frac{1}{2} (1 \pm \sqrt{0.36 -4 +4c_2} )\]
right now sub into the original equation?
I used SAGE (math program that does symbolic computation) to find \[ \frac{1}{10}\sqrt{100 c_2 - 91} + \frac{1}{2}\sqrt{4 c_1 - 3} - \frac{296}{5} \]
yes, first sub these into L1 = equation and L2 = equation so both L1 and L2 are functions of c1 and c2 put those into the original replace p1 and p2 with the values just found. It is very messy.
ok so how do you find the minimum cost from this ?
by simplifying the original equation after subbing in for p1, p2, L1, and L2 you get what I posted
so what you posed is the minimum cost ... i thought it will be a number or something ...
your constraints are Constraints 1-p1+p1^2=c1 1-0.6p2+p2^2=c2 so the answer will be in terms of c1 and c2 if you have numbers for c1 and c2, then you can get a number
ah i see can i post the original question to see if you have done it correct ?
yes
Two generators are connected to provide total power to meet load demands. The costs of the two generators are each expressed as functions of power output, C1=1-P1+p1^2 and C2 =1 +O.6P2+P2^2 (i) . If the load demand requires at least 60' units, formulate a minimum cost design problem {cost' and power are on a per unit basis}, identifying design variables, the objective, and all constraints. (ii) By introducing appropriate slack varlable(s), use Lagrange multipliers to find the minimum cost power distribution solution. (iii) Sketch a graphical interpretation of the optimization problem.
|dw:1379458568726:dw|
Join our real-time social learning platform and learn together with your friends!