(2 intermediate revisions by the same user not shown) | |||
Line 10: | Line 10: | ||
:[[QE2013_AC-3_ECE580-1|Part 1]],[[QE2013_AC-3_ECE580-2|2]],[[QE2013_AC-3_ECE580-3|3]],[[QE2013_AC-3_ECE580-4|4]],[[QE2013_AC-3_ECE580-5|5]] | :[[QE2013_AC-3_ECE580-1|Part 1]],[[QE2013_AC-3_ECE580-2|2]],[[QE2013_AC-3_ECE580-3|3]],[[QE2013_AC-3_ECE580-4|4]],[[QE2013_AC-3_ECE580-5|5]] | ||
− | + | <br> '''Solution 1: ''' <br> | |
− | <br> '''Solution: ''' <br> | + | |
<math>x(3) = x(2) + 2u(2) = x(1) + 2u(1) + 2u(2) = x(0) + 2u(0) + 2u(1) + 2u(2) </math> | <math>x(3) = x(2) + 2u(2) = x(1) + 2u(1) + 2u(2) = x(0) + 2u(0) + 2u(1) + 2u(2) </math> | ||
Line 18: | Line 17: | ||
<math>\therefore \ Constraint: 2u(0) + 2u(1) + 2u(2) = 6 </math> | <math>\therefore \ Constraint: 2u(0) + 2u(1) + 2u(2) = 6 </math> | ||
− | Let <math>f(u) = u^2(0) + u^2(1) + u^2(2), h(u) = 2u(0) + 2u(1) + 2u(2) - 6 </math> | + | Let <math>f(u) = u^2(0) + u^2(1) + u^2(2), h(u) = 2u(0) + 2u(1) + 2u(2) - 6 </math> (1/2 in the objective function can be ignored for now) |
Let u* be a local minimizer. Lagrange theorem says there exists a λ such that: | Let u* be a local minimizer. Lagrange theorem says there exists a λ such that: | ||
− | <math>\nabla f(u*) + \lambda \nabla h(u*) = 0 \\ | + | <math>\nabla f(u^*) + \lambda \nabla h(u^*) = 0 \\ |
− | h(u*) = 0 </math> | + | h(u^*) = 0 </math> |
+ | |||
+ | Therefore, | ||
+ | |||
+ | <math>2 u^*(0) + 2 \lambda = 0 \\ | ||
+ | 2 u^*(1) + 2 \lambda = 0 \\ | ||
+ | 2 u^*(2) + 2 \lambda = 0 \\ | ||
+ | 2 u^*(0) + 2 u^*(1) + 2 u^*(2) - 6 = 0 \\ \\ | ||
+ | |||
+ | \therefore u^*(0) = u^*(1) = u^*(2) = 1</math> | ||
+ | |||
+ | Optimal performance index is <math>\frac{3}{2}</math> | ||
+ | |||
+ | <br> '''Solution 2: ''' <br> | ||
+ | |||
+ | <math>J = \frac{1}{2} u^T u \\ | ||
+ | x(k+1) = x(k) + 2u(k), x(0) = 3, x(3) = 9 \\ | ||
+ | x(1) = x(0) + 2u(0) \\ | ||
+ | x(2) = x(1) + 2u(1) = x(0) + 2u(0) + 2u(1) \\ | ||
+ | x(3) = x(2) + 2u(2) = x(0) + 2u(0) + 2u(1) + 2u(2) \\ | ||
+ | \therefore 2u(0) + 2u(1) + 2u(2) = 9 - 3 = 6</math> | ||
+ | |||
+ | <math>Au = 6</math> where A = [2 2 2] | ||
+ | |||
+ | <math>min\ \frac{1}{2} u^T u \\ | ||
+ | subject\ to\ Au = 6 \\</math> | ||
+ | <br> | ||
+ | |||
+ | <math>f(u) = \frac{1}{2} u^T u \\ | ||
+ | h(u) = Au - 6 \\ | ||
+ | l(u, \lambda) = f(u) + \lambda h(u) = \frac{1}{2} u^T u + \lambda Au - 6 \lambda \\ | ||
+ | D_u l(u, \lambda) = u^T + \lambda A = \begin{bmatrix} | ||
+ | u(0) + 2\lambda & u(1) + 2\lambda & u(2) + 2\lambda | ||
+ | \end{bmatrix} = \begin{bmatrix} | ||
+ | 0 & 0 & 0 | ||
+ | \end{bmatrix} \\ | ||
+ | D_\lambda l(u, \lambda) = Au - 6 = 2u(0) + 2u(1) + 2u(2) - 6 = 0 \\ | ||
+ | 2(-2 \lambda) + 2(-2 \lambda) + 2(-2 \lambda) - 6 = 12 \lambda - 6 = 0 \Rightarrow \lambda^* = -\frac{1}{2} \\ | ||
+ | u^*(0) = u^*(1) = u^*(2) = -2\lambda = 1 \\ | ||
+ | L(u, \lambda) = F(u) + \lambda H(u) = 1 > 0 \\</math> | ||
+ | <br> | ||
+ | |||
+ | <math>\therefore u^* = \begin{bmatrix} 1 & 1 & 1 \end{bmatrix}^T </math>is a minimizer | ||
+ | |||
+ | <br> '''Comment: ''' Solution 1 and 2 are the same. Solution 1 skips a few steps with formulas while Solution 2 does not. They both have the same results. <br> | ||
+ | |||
[[ QE2013 AC-3 ECE580|Back to QE2013 AC-3 ECE580]] | [[ QE2013 AC-3 ECE580|Back to QE2013 AC-3 ECE580]] |
Latest revision as of 11:21, 25 March 2015
QE2013_AC-3_ECE580-4
Solution 1:
$ x(3) = x(2) + 2u(2) = x(1) + 2u(1) + 2u(2) = x(0) + 2u(0) + 2u(1) + 2u(2) $
$ \because x(0) = 3, x(3) = 9 $
$ \therefore \ Constraint: 2u(0) + 2u(1) + 2u(2) = 6 $
Let $ f(u) = u^2(0) + u^2(1) + u^2(2), h(u) = 2u(0) + 2u(1) + 2u(2) - 6 $ (1/2 in the objective function can be ignored for now)
Let u* be a local minimizer. Lagrange theorem says there exists a λ such that:
$ \nabla f(u^*) + \lambda \nabla h(u^*) = 0 \\ h(u^*) = 0 $
Therefore,
$ 2 u^*(0) + 2 \lambda = 0 \\ 2 u^*(1) + 2 \lambda = 0 \\ 2 u^*(2) + 2 \lambda = 0 \\ 2 u^*(0) + 2 u^*(1) + 2 u^*(2) - 6 = 0 \\ \\ \therefore u^*(0) = u^*(1) = u^*(2) = 1 $
Optimal performance index is $ \frac{3}{2} $
Solution 2:
$ J = \frac{1}{2} u^T u \\ x(k+1) = x(k) + 2u(k), x(0) = 3, x(3) = 9 \\ x(1) = x(0) + 2u(0) \\ x(2) = x(1) + 2u(1) = x(0) + 2u(0) + 2u(1) \\ x(3) = x(2) + 2u(2) = x(0) + 2u(0) + 2u(1) + 2u(2) \\ \therefore 2u(0) + 2u(1) + 2u(2) = 9 - 3 = 6 $
$ Au = 6 $ where A = [2 2 2]
$ min\ \frac{1}{2} u^T u \\ subject\ to\ Au = 6 \\ $
$ f(u) = \frac{1}{2} u^T u \\ h(u) = Au - 6 \\ l(u, \lambda) = f(u) + \lambda h(u) = \frac{1}{2} u^T u + \lambda Au - 6 \lambda \\ D_u l(u, \lambda) = u^T + \lambda A = \begin{bmatrix} u(0) + 2\lambda & u(1) + 2\lambda & u(2) + 2\lambda \end{bmatrix} = \begin{bmatrix} 0 & 0 & 0 \end{bmatrix} \\ D_\lambda l(u, \lambda) = Au - 6 = 2u(0) + 2u(1) + 2u(2) - 6 = 0 \\ 2(-2 \lambda) + 2(-2 \lambda) + 2(-2 \lambda) - 6 = 12 \lambda - 6 = 0 \Rightarrow \lambda^* = -\frac{1}{2} \\ u^*(0) = u^*(1) = u^*(2) = -2\lambda = 1 \\ L(u, \lambda) = F(u) + \lambda H(u) = 1 > 0 \\ $
$ \therefore u^* = \begin{bmatrix} 1 & 1 & 1 \end{bmatrix}^T $is a minimizer
Comment: Solution 1 and 2 are the same. Solution 1 skips a few steps with formulas while Solution 2 does not. They both have the same results.