10.07.2015 Views

Static and Dynamic Optimization (42111)

Static and Dynamic Optimization (42111)

Static and Dynamic Optimization (42111)

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Static</strong> <strong>and</strong> <strong>Dynamic</strong> <strong>Optimization</strong> (<strong>42111</strong>)Niels Kjølstad PoulsenSection for Mathematical StatisticsDept. of Informatics <strong>and</strong> Mathematical ModellingThe Technical University of Denmarkbuild. 305, room 213email: nkp@imm.dtu.dkphone: +45 4525 3356mobile: +45 2890 3797Lecture 13: Time Optimal Problems1 / 27


Outline of lectureTime optimal problemsReading: 47-54, 67-692 / 27


Motion controlThe problem is to bring the systemẋ = u t x 0 = x 0from the initial position, x 0 , to the final position, x T , in minimum time,while the control action (or the decision function) is bounded to|u t| ≤ uThe performance index is∫ T ∫ TJ = T T + 0 dt = 0+ 1 dt0 0Notice, either is (φ T = T , L = 0) or (φ = 0, L = 1)The Hamiltonian function is:H = λ tu t5 / 27


Motion controlThe Hamiltonian function is:H = λ tu t<strong>and</strong> the optimality conditions are simplyẋ = u t−˙λ = 0u t= arg min uHwith the boundary conditions:x 0 = x 0 x T = x T λ T = νThe Transversality condition is1+λ T u T = 06 / 27


Motion control (Costate)The Hamiltonian function is:H = λ tu t<strong>and</strong> the optimality conditions are simplyẋ = u tλ = νu t= arg min uHwith the boundary conditions:x 0 = x 0 x T = x T λ T = νThe Transversality condition is1+λ T u T = 07 / 27


Motion control (Control)The Hamiltonian function is:H = λ tu t<strong>and</strong> the optimality conditions are simplyẋ = u tλ = νu t = −u sign(λ t) = −u sign(ν)with the boundary conditions:x 0 = x 0 x T = x T λ T = νThe Transversality condition is1+λ T u T = 08 / 27


Motion control (Transversality)The Hamiltonian function is:H = λ tu t<strong>and</strong> the optimality conditions are simplyẋ = u tλ = νu t = −u sign(ν)with the boundary conditions:x 0 = x 0 x T = x T λ T = νThe Transversality condition is1−νu sign(ν) = 0 → ν = ± 1 u9 / 27


Motion control (State equation)The Hamiltonian function is:H = λ tu t<strong>and</strong> the optimality conditions are simplyx t = x 0 −u sign(ν) t <strong>and</strong> x T = x 0 −u sign(ν) Tλ = νu t = −u sign(ν)with the boundary conditions:x 0 = x 0 x T = x T → T = |x T −x 0 |uThe Transversality condition issign(ν) = −sign(x T −x 0 )λ T = νν = ± 1 u→ ν = − 1 u sign(x T −x 0 )10 / 27


Motion control (Conclusion)This results in the control strategyu t = u sign(x T −x 0 )<strong>and</strong>x t = x 0 +u sign(x T −x 0 ) t11 / 27


Pause12 / 27


Bang Bang Control.Consider a mass affected by a force. This is a second order system given by[ ] [ ] [ ] [ ]d z v z z0==dt v u v v0 0z position v velocity u control action, specific forceAssume the control action, i.e. the specific force is limited to|u| ≤ 1while the objective is to take the system from its original state to the origin[ ] [ ] zT 0x T = = vT 0in minimum time. The performance index is accordinglyJ = TThe Hamilton function isH = λ z v +λ v u♠13 / 27


Bang Bang Control.The Hamilton function <strong>and</strong> the terminal contribution areH = λ z v +λ v uφ = TWe can now write the conditions as the state equation,[ ] [ ]d z v=dt v uthe costate equations− d dt[ λ z λ v ] = [ 0 λ z ] ⇐the optimality condition (Pontryagins maximum principle)u t = −sign(λ v t )<strong>and</strong> the boundary conditions[ ] [ ] [ ] [ z0 z0 zT 0= =v 0 v 0 vT 0The transversality condition is:] [ λ zTλ v T] [ ] ν z=ν v1+H T = 1+λ z T v T +λ v T u T = 1+λ v T u T = 0 ⊲⊳ ♠⊲⊳14 / 27


Bang Bang Control.The Hamilton function isH = λ z v +λ v uWe can now write the conditions as the state equation,[ ] [ ]d z v=dt v uthe costate equationsλ z t = νz λ v t = νv +ν z (T −t) ⊲⊳the optimality condition (Pontryagins maximum principle)u t = −sign(λ v t)⇐<strong>and</strong> the boundary conditions[ ] [ ] [ ] [ z0 z0 zT 0= =v 0 v 0 vT 0The transversality condition is:] [ λ zTλ v T] [ ] ν z=ν v1+λ v T u T = 0 → λ v T = νv = ±1 ⊲⊳15 / 27


Bang Bang Control.To summarize,we have 3 unknown quantities, ν z , ν v <strong>and</strong> T <strong>and</strong> 3 conditions to meet,z T = 0 v T = 0 <strong>and</strong> λ v T = ±1.If the control has a constant values u = ±1, then the solution is simplyv t= v 0 +utz t = z 0 +v 0 t+ 1 2 ut2 16 / 27


Bang Bang Control.u = 1 (Accelration)v t = v 0 +tz t= z 0 +v 0 t+ 1 2 t22Trajectories for u=11.510.5v0−0.5−1−1.5−2−4 −3 −2 −1 0 1 2 3 4 5z17 / 27


Bang Bang Control.u = −1 (Deacceleration)v tz t= v 0 −t= z 0 +v 0 t− 1 2 t22Trajectories for u=−11.510.5v0−0.5−1−1.5−2−5 −4 −3 −2 −1 0 1 2 3 4z18 / 27


Bang Bang Control - On the switching curve.No switching if the terminal point (origin) <strong>and</strong> the starting point is on the same parabola (<strong>and</strong> inthe directionis of arrows), i.e. satisfy the equations0 = v 0 +uT f u = ±1 (1)0 = z 0 +v 0 T f + 1 2 uT2 fwhere T f = T . Solution:T f = − v 0u ≥ 0 z 0 = 1 v022 ufor either u = 1 or u = −1. Since T f ≥ 0:(must be satisfied) (2)u = −sign(v 0 ) T f = |v 0 |z0 = − 1 2 sign(v 0)v 2 0(The Switching curve)If v 0 > 0 then u = −1 <strong>and</strong> z 0 = − 1 2 v2 0 .If v 0 < 0 then u = 1 <strong>and</strong> z 0 = 1 2 v2 0 . 19 / 27


Bang Bang Control.The switching (or the acceleration/deaccelleration) curve:{ −1z 0 = 2 v2 0 deacc. u = −1 for v 0 > 012 v2 0 acc. u = 1 for v 0 < 0= − 1 2 v2 0 sign(v 0)2Trajectories for u=± 11.510.5v0−0.5−1−1.5−2−5 −4 −3 −2 −1 0 1 2 3 4 5z20 / 27


Bang Bang Control.Let us return to the general case.From Pontryagin <strong>and</strong> the solution to the costate equation:( )u t = −sign ν v +ν z (T −t)There will be a switching unless the initial point lies on switching curve. We will have 2 possibilities.u t ={ 1 for 0 ≤ t ≤ Ts−1 for T s < t ≤ Tz 0 < − 1 2 v2 0sign(v 0 )Below the switching curve.{ −1 for 0 ≤ t ≤ Tsu t =1 for T s < t ≤ Tz 0 > − 1 2 v2 0 sign(v 0)Above the switching curve.21 / 27


Bang Bang Control.v2Trajectories for u=± 11.510.50−0.5−1−1.5−2−5 −4 −3 −2 −1 0 1 2 3 4 5zAs a state feedback law⎧1 for z < − 1 2 v2 sign(v) (Below switching curve)⎪⎨ −1 for z = − 1 2 v2 <strong>and</strong> v > 0 (Down along switching curve)u t =−1 for z > − 1 2⎪⎩v2 sign(v) (Above switching curve)1 for z = 1 2 v2 <strong>and</strong> v < 0 (Up along switching curve)22 / 27


Bang Bang Control.Searching for T <strong>and</strong> T s. Assume z 0 > − 1 2 v2 0 sign(v 0) (above switching curve)2Trajectories for u=± 11.510.5v0−0.5−1−1.5−2−5 −4 −3 −2 −1 0 1 2 3 4 5zFor t < T s u t = −1 <strong>and</strong> T s < t ≤ T u t = 123 / 27


Bang Bang Control.For t < T s u t = −1 <strong>and</strong>v t = v 0 −t z t = z 0 +v 0 t− 1 2 t2 (1)which is valid until we reach the switching curve given byz = − 1 2 v2 sign(v) = 1 2 v2 (because v < 0) (2)This happens at T s wherez 0 +v 0 T s − 1 2 T2 s = 1 2 (v 0 −T s) 2orT s = v 0 +√z 0 + 1 2 v2 024 / 27


Bang Bang Control.The velocity at the switching point isv s = v 0 −T s (≤ 0)The time left for the origin is˜T = |v s| = T s −v 0For t > T s we accelerate (u t = 1) <strong>and</strong> in total√T = ˜T +T s = T s −v 0 +T s = v 0 +2 z 0 + 1 2 v2 025 / 27


6Contour areas for T=2, 4 <strong>and</strong> 642v0−2−4−6−20 −15 −10 −5 0 5 10 15 20z26 / 27


Project 2Name <strong>and</strong> ID on frontName(s) <strong>and</strong> ID(s) of group mates on front (separated from ovn id)Only electronic upload to CampusNet.Deadline 21.12.2012helpdesk: nkp (305/213)27 / 27

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!