{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

midterm_sol

# midterm_sol - Mezsw/é’ceulc mm as ‘m w 130132710...

This preview shows pages 1–6. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Mezsw/é’ceulc mm as ‘m w 130132710 Midterm Nathan Owen February 12, 2009 1 Optimal Control '34 Consider the minimii’rn energy optimal control problem T ‘ minimize J = / u2(t)dt (1) 0 O 1 0 0 subject to: 5c 3 Ax + Be, A m 0 O 1 , B = 0 (2) 0 O 0 1 i We wish to drive the system to a manifold 13%(T) + raga") m 1 from x{0) = 0, considering T = 1 and T m 10. From before, we know that the optima} control is obi) = wB*)\(t), where A is the (Lo—state; the state and co—state are governed by differentiai equations arising from necessary conditions on duai optimality: 5: A —BB* K hiwio wihi e Solving the ODE for the state in the forwardwtime direction and the ODE for co—state in the reverse-time direction, we have soiutions Mt) 2: erAWTMm I (a) x(t) = eA*x(0)~ fteA(‘"T>BB*eA*(T~T>/\(T)dt (5) 0 u(t) = —B*eA*<T"*>A(T) (6) Considering x(0) = O, the state equation at the endpoints yields x(T) m — U: eAiT-ﬂen’iee‘mﬂdt] Am a -—WT/\(T) (7) 1 C3 33 From the end—point constraints on x we have, as transversality conditions: A10") . 53101) A26?) m 21) \$20") (8) A3(T) G Plugging in these endpoint conditions on the c0~state, we have 1 \$1117) ”5311") w Wt 5625") (9) v 0 Mt) w «3* cm CT”) 203:0?) (10) Excluding the eguation for \$36"), we see that the endpoints 2:3(T) and w2(T) must be eigenvectors of the matrix formed by the 2—dimensi0nal upper—left quadrant of Wt 2m Wilm}. We can solve for these eigenvectors (and their corresponding eigenvalues ~21?) using MATLAB. After deﬁning the appropriate static variables A, B, T, we use the quad function to evaluate the integrai WT using adaptive Simpson quadrature (and using expm to evaluate the matrix exponential): (11) W§2m21 : 0.050 0.125 Wi2e213 5000 1250 1 0.125 0.333 ’ 10 1250 333.3 We then use the MATLAB function eig to ﬁnd eigenvectors and eigenvaiues; conveinentiy, MATLAB gives us eigenvectors of unit norm ~ exactly the values of x(T) "we are iooking for. Since we are looking to minimize the control energy, and since the controi output (10) scales with v, we want eigenvectors corresponding to the smaller absoiute vaiue of i) which W in turn corresEonds to the larger (faster) eigenvalue: A 0 35 ~0.93 . X¥L1(T) m [ I - ] 1 UT=1 m —1.31, Ayala“) m *245 (12) 0.94— 0 . —-.0 97 0.18 0 Plugging these values into eqns 5 and 6, we get the optimal trajectories for at and or, shown in Figures 1 and 2 lAeSlv necessam’lﬁ +me. Heed «[0 A; lac/K erg/raw ml 03ml: eramauj Mata 72F T=1 D 2 4 6 8 10 0 a g "G'- —1 G 2 4 6 5 10 3 M0- X 43.4 0 2 4 5 8 10 0| «0.013 O 2 Q 6 5 _ \$0 «0.005 —e.o1 "0.015 ~0.02 -0.025 No.03 Figure 2: State tmjectories in \$23 for T m 1 and T = 10. Note how in both cases, the end point is located on the circle 33%(1‘) + mgﬂ") : 1, éenoted by a black line. 3:494:21 ram: k, a“) , -g z ,1 " E m g.— 1 1 zﬁdt JG; w HEM i: {was} 7‘!" WHJ o 1% \ . ~ \ "’ Le) f 7%” j; m. +45 ) 1&1", qgéwwe "if :5 M11671 QB’G 0" L4?) 0 9‘1 FU’O‘G Mainfa’ ”QWCM ”'3“ m =‘ {a} m 1 UL: , Flue) ' L 2 “,5 “W W); WM) ][ (11» F051) + M) “rd: 0 K...” r—W‘ ‘ "‘" «hm ........ ”qr-”#1) w- ’ <f( F¥t), ¢{1),& ”Ir—hie '. w} I. y ”w' . 5 no .r~. ”In {raw-n ‘ta aﬂpig £030me 9 ugm‘ﬂﬁong Eulenr * L08 quqc @th5 a?" v: £25? ~ ff @3171“ at" ""' at 3,22“) «m; fay m.) + I) = )2 ﬁr’m mm W (3, armed "f w t SOiuf‘"'D‘”\ 4*». Ct FH’) :« ”i + C16 + £413 )6 "T‘fa P‘s-.45 3‘qu f 1% 15(0) ~: 0 1. . . can Cili'wﬁs 1 ® 5”! a: :2) \IQ—ﬁﬂhgm \' f] {I {.5 2W @ Sx'ch FTC-I} 1‘5 ti.ﬂ{oﬂ£,Hr2.z"nao-a, V (I) "5 7933 —-..:> @519 ( pct), puma; -: o 3’“ taxi -1 but; 1 (L) :2)? 2‘3 " ,A '2 d") C :5 C 5.) c1 .1 :1; 2‘ ' = _ 2 “ME? > Cld -.-e :+-€1 0:12”er , w - - ' r, J Ht; __ 4 . 53.1; + (‘22. ﬂat ... 1 1+9} We? ﬂu: m.) = a“: w 52 at. {+93- 34¢? {Cg-(3153;? KS“; ¥ Fig.3 3 iConstrained Maximization Coneider the constrained minimization problem: l l j maximize J(u) :m fT e"ﬁt\/u(t)dt (22) 0 subject to: Egg—(t) = ax(t) m um {23) 55(0) m S [33071) J m— [ 0 }, a,ﬁ,u(t) > O (24) We éonvert to an unconstrainecl maximization problem using Lagrange multiplier Mt) ’: maximize L 2 [OT ewwx/uﬁ) + A (omit) «— u(t) - 9'3) (25) If we deﬁne H 2: fax/Mt) + A (outﬁt) m u(t)), we have necessary conditions for optimal— ity: . 5b = %§-*=ax—u (26) A m #63? = mm (27) Solvéing ODE (27) backwards, relation (28), and ODE (26) forwards, we have: 20?) = eWO‘WTJMT) (29) 51%) =—“~ iyzﬁtMQ-Z = iemwtemwrhmrg (30) j t t W) m eat\$(0)— / ea{t”7)u(t)dtmSeatewiMTTQ / gait—rle—Wrezew“)OM31) 0 0 Since we want 56(T) m 0, plugging in for t m T and solving (31) for /\(T) we have: T 0 __ Sea?" _ :‘A(T) “2 / Ba(T—T)e~2ﬂre2a(rmT)dT 0 T SeO‘T : :e"°‘TA(T)“2 / 50"”)th 0 SBQT = ENE—eyeing W 25)“: [gammy _1] ew2ﬁT m e—aT oaT __: 1 88 - ewe __ 23) : AVID? _ 8—2'8T m ‘3qu 4SeO‘T(o: m 2,6) Plugging back into {30) we have the optimal control: 8’ 0: m 2,8 cw?" _ _ 1,50) : WGXQ 5H (32) In reality, this maximization problem represents an attempt to ﬁnd the optimal rate of withdrawai u(t) for an initial investment 8’ with interest rate a over T years, such that the investment value 9305) goes to zero at time T and enjoyment index J is maximized We consider the practical case of T" —— 75 years and o:— —— 5% Looking at several values of 6 and- Eintegrating \$05) over the time period using MATLAB’ s ode45 solver we see how the withdrawal and investment balance trajectories evolve Note that for 6 m 01 the control 3 0.4 .0 9 Spending Hate U{t) (% S) O 0 10 20 30 40 5G 60 70 80 Savings X{t) (% S) .._L__. _1__,,._ .. 0 1O 20 30 40 5C} 60 “3‘0 80 i Time (years) Figure 3: State and control trajectories for three choices of ﬁ output is constant as we expect since the transient term in 1105) wiil cancel out in that case. ...
View Full Document

{[ snackBarMessage ]}

### Page1 / 6

midterm_sol - Mezsw/é’ceulc mm as ‘m w 130132710...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online