PICTURE. Ek cart position x1 par baithi hai aur speed x2 se right ja rahi hai. Tumhara haath isko force u se push kar raha hai. Target hai origin — woh chhota sa flag 0 par. Yahi is problem ki puri duniya hai.
u wala arrow red hai kyunki yahi ek cheez tumhare command mein hai. Hum ab se jo bhi karte hain woh ek hi sawaal ka jawab deta hai: kitni takat se, aur kis direction mein, woh red arrow push kare, yeh dekhte hue ki cart abhi kahan hai?
LINEAR kyun important hai? Kyunki ek seedha rule hi ek aisa akela kind hai jise hum poori tarah closed form mein solve kar sakte hain. LQR ka poora fayda isi par tika hai.
PICTURE. State ek plane mein ek point ki tarah rehti hai (position across, velocity up). Har point par ek arrow dikhata hai ki machine apne aap kis direction mein drift karti hai (Ax). Tumhara push Bu us arrow ko thoda sa nudge karta hai.
Black arrows dekho: bina push ke, ek cart jo right par hai aur right ja rahi hai (x1>0,x2>0) aur right drift karti hai — woh bhaag jaati hai. Red overlay dikhata hai ki u ki ek choice un arrows ko flag ki taraf wapas kaise mod deti hai.
Squares kyun, absolute values ya fourth powers kyun nahi? Do reasons hain, ek practical, ek magical.
Practical: ek square smooth hota hai aur zero par koi sharp corner nahi hota, isliye machine kabhi chatter nahi karti.
Magical: ek linear machine ko ek squared bill do to controller khud linear nikalta hai. Yahi coincidence reason hai ki LQR beautiful hai. Hum yeh neeche prove karte hain.
PICTURE. Ek squared penalty ek bowl hai. Neeche hona (on-target, no push) kuch nahi costa; wall climb karna zyada se zyada cost karta hai, tezi se tezi.
Orange bowl x mein error bill hai; teal bowl u mein effort bill hai. Kyunki Q⪰0 aur R≻0 hain, dono bowls upar khulti hain — woh kabhi zameen ke neeche nahi jaatein. LQR woh path dhundhta hai jis par total bowl-height hamesha sabse chhoti rahe.
V ek bowl (quadratic x⊤Px) kyun honi chahiye? Teen clues, har ek forced:
Target par, perfectly khelne par zero cost, isliye V(0)=0 — bowl origin par zameen ko touch karta hai.
Target ke left aur right symmetric mirror situations hain, isliye koi odd/linear term survive nahi karta.
Ek seedhi machine ek squared bill se cubes ya quartics nahi bana sakti — shape ek saaf bowl rehti hai.
Isliye V(x)=x⊤Px, jahan P numbers ka ek unknown symmetric grid hai — woh ek cheez jo humein dhundhnee hai. Yeh choice exactly value-function guess hai.
PICTURE. Bowl V state plane ke upar baithi hai. Har direction mein uski steepness P set karta hai. P dhundho aur har situation ki kimat pata chal jaati hai — aur, jaise hum dekhenge, perfect push bhi.
Woh last line HJB equation hai. "Instant cost future bill ke fall ko cancel karta hai" ka slogan ab derived hai, sirf assert nahi.
PICTURE. Bowl ki andar ki wall par khade ho. Upar jaata slope arrow ∇V hai. Tumhari motion x˙=Ax+Bu ek aur arrow hai. Unka alignment (chain rule se) bata deta hai ki future bill drop ho raha hai ya nahi (downhill ja rahe ho) aur kitni tezi se.
Bracket ke andar, sirf ek cheez hai jo tum control karte ho — u. Har woh cheez jisme u hai:
a bowl in uu⊤Ru+a tilt2x⊤PBu
Yeh ek bowl hai (kyunki R≻0, matlab R ek genuine upward bowl hai) jise state tilt kar rahi hai. Ek tilted bowl ka exactly ek sabse neecha point hota hai. Slope ko u mein zero set karke wahan slide karo:
2Ru+2B⊤Px=0⟹u∗=−R−1B⊤Px=−Kx
R−1 kyun aata hai, aur R strictly positive kyun hona chahiye? Agar effort free hoti (R→0) to tum infinitely hard shove karte — u mein bowl flat hoti aur koi bottom nahi hota. Ek real, strictly-positive R bowl ko ek genuine bottom deta hai, isliye R−1 exist karta hai aur ek finite best push exist karta hai. Yeh feedback law u=−Kx hai, ab derived, guess nahi.
PICTURE. Ek fixed state ke liye, tumhari push ke function ki tarah cost ek parabola hai. Uska vertex perfect push hai. Steeper parabola (bada R) → vertex zero ke karib → gentler push.
Ab hum u∗=−R−1B⊤Px ko Bellman ke balance mein substitute karte hain aur carefully terms collect karte hain. Shuru karo yahan se:
0=x⊤Qx+u∗⊤Ru∗+2x⊤P(Ax+Bu∗).
Term (i) — drift 2x⊤PAx symmetric pair A⊤P+PA ban jaata hai. Number x⊤PAx ek 1×1 scalar hai, isliye yeh apne transpose ke barabar hai: x⊤PAx=(x⊤PAx)⊤=x⊤A⊤P⊤x=x⊤A⊤Px (P=P⊤ use karte hue). Do identical copies ka average lene par,
2x⊤PAx=x⊤PAx+x⊤A⊤Px=x⊤(A⊤P+PA)x.
Isliye akela lop-sided PAsymmetric sum A⊤P+PA ki tarah rewrite hota hai — "drift up the bowl" term.
Term (ii) — u∗ ke do pieces merge hokar −PBR−1B⊤P bante hain.u∗=−R−1B⊤Px ko effort cost aur tilt mein alag alag plug karo:
u∗⊤Ru∗=x⊤PB=R−1R−1RR−1B⊤Px=+x⊤PBR−1B⊤Px,2x⊤PBu∗=−2x⊤PBR−1B⊤Px.
Jodo: (+1−2)=−1, isliye milke yeh dete hain:
−x⊤PBR−1B⊤Px.
Yeh exactly woh hai jo steering bachata hai — optimizer ek reduction kharidta hai, isliye minus sign.
Collect karo (i) + (ii) + error term x⊤Qx:0=x⊤(drift up the bowlA⊤P+PAwhat steering saves−PBR−1B⊤P+running error priceQ)x.
Yeh har state x par hold karna chahiye. Ek quadratic form jo sabhi x ke liye zero ho, sirf flat zero matrix se aa sakta hai, isliye beech ka poora grid vanish hona chahiye:
Nonlinear kyun hai? Saving term mein P ko P se multiply kiya gaya hai — ek square. Yeh ek akela squared term hi hai jo ise ek plain linear equation ki jagah ek Riccati equation banata hai.
PICTURE. Equation grids ka ek see-saw hai: drift (A⊤P+PA) aur error price (Q) P ko upar dhakelte hain; steering saving (−PBR−1B⊤P) ise neeche kheenchti hai. Balance point woh P hai jo hum chahte hain.
Panel 4 (Steps 4–5) — Bellman's knobu=−Kx: U-curve ko uske vertex par ghumaane se ek linear law milta hai.
Panel 5 (Step 6) — Riccati → P: back-substitution force karta hai A⊤P+PA−PBR−1B⊤P+Q=0, jiska stabilizing root tumhe K=R−1B⊤P deta hai.
Panels ke beech har black arrow ek "therefore" hai: linear + quadratic therefore bowl therefore linear law therefore Riccati therefore ek gain.
Recall Feynman: poori walk plain words mein
Tum ek cart ko ek flag tak push kar rahe ho. Pehle maine tumhe do numbers sikhaye jo cart describe karte hain (kahan, kitni tezi se) aur woh ek cheez jo tum control karte ho (tumhara push). Cart ek seedha-line rule follow karti hai: tumhara push uski speed ko feed karta hai, uski speed uski position ko. Phir maine tumhe ek bill diya — ek part flag se door baithne ke liye, ek part zyada dhakka dene ke liye — aur dono ko square kiya taaki bill ek smooth bowl ho jo kabhi zero se neeche na jaaye (yahi Q⪰0, R≻0 hai). Kahin bhi khade ho, wahan ek tumhari situation ki kimat hai, aur kyunki sab kuch straight-and-squared hai woh kimat khud ek smooth bowl hai, x⊤Px. Perfect play ka matlab hai har second jo bill tum bharte ho woh exactly match kare ki kitni tezi se tumhara future bill gir raha hai jab tum us bowl se slide karte ho — mujhe yeh Bellman's principle use karke mila, time ko "agla instant" aur "uske baad sab kuch" mein tod ke, aur chain rule dV/dt=∇V⊤x˙ use karke kyunki bowl smooth hai. State freeze karo aur tumhari push-vs-cost ek simple U-curve hai; uska bottom perfect push hai, aur woh nikal ke aata hai "jitna off ho uske proportion mein push karo," u=−Kx. Woh best push wapas balance mein daalo aur algebra ek matrix equation ugalta hai — Riccati — jiska acha (bowl-up) solution P tumhe K ek baar aur hamesha ke liye deta hai. Sasta fuel → hammer karo; bahut mehenga fuel → mushkil se tap karo; free error → aaram karo; runaway cart → phir bhi tame. Ek recipe, ek baar compute karo, har jagah kaam kare.