4.8.12 · D1 · HinglishNumerical Methods

FoundationsCubic spline interpolation — natural, clamped

2,056 words9 min read↑ Read in English

4.8.12 · D1 · Maths › Numerical Methods › Cubic spline interpolation — natural, clamped

Parent note padhne se pehle, tumhe page par har ek mark bina jhijhke padhna aana chahiye. Neeche har ek symbol aur concept ka zero-se tour hai, is order mein ki har ek cheez sirf usse pehle waali cheez par rely kare. Agar parent note ne use likha aur maan liya ki tum jaante ho — toh woh yahan build kiya gaya hai.


1. Points, aur subscript trick

Mark ko "x-sub-i" padha jaata hai aur iska seedha matlab hai "point number ki -value". Toh pehla hai, uske baad, tak (jo last hai). Letter last point ka number hai, isliye total mein points hain (kyunki hum se nahi, se ginne lage the).

Figure — Cubic spline interpolation — natural, clamped

Figure dekho: dots hain. Condition (parent bilkul yahi likhta hai) bas yeh kehti hai ki points strictly left se right ki taraf jaate hain — koi bhi do ek share nahi karte, aur koi bhi backwards nahi jaata. Yahi ordering hai jo humein "neighbours ke beech ka interval" bolne deti hai.


2. Interval aur uski width

Picture: do neighbouring dots ke beech ka horizontal gap hai (figure s01 dekho, neeche orange bracket). Topic ko yeh kyun chahiye: har formula se divide karta hai — kyunki slope ya curvature hamesha "width ke per unit kitna change" hota hai, aur tum width jaane bina per-width change measure nahi kar sakte.


3. Cubic kya hota hai (aur cubic kyun)

Picture: ek single smooth wiggle jo upar phir neeche ja sakti hai (ya ulta) — figure s02 dekho. Ek straight line () bend nahi kar sakti; ek parabola () sirf ek taraf bend hoti hai; ek cubic bend, straighten, aur phir se bend ho sakti hai — itni flexible ki do heights ko smoothly link kare aur joins par slope aur curvature bhi control kare.

Figure — Cubic spline interpolation — natural, clamped

4. Function notation aur piecewise idea

Toh piecewise hai: alag-alag stretches par alag-alag formula, lekin overall ek continuous curve. Parent likhta hai — ise is tarah padho: "piece , left node par evaluate kiya, data height deta hai." Yahi interpolation condition hai: curve ko dots se exactly guzarna chahiye.


5. Slope: first derivative

Picture: curve par ek point par tangent rakhe gaye chhote straight ruler ki tilt (figure s03, magenta tangent). Humein isse kyun chahiye: agar do pieces ek node par milti hain lekin unki slopes alag hain, toh curve mein ek visible kink hoga — jaise chhath ka corner. demand karna (slopes left aur right dono se agree karein) kink ko mita deta hai. Yahan pieces "ek doosre se baat" karti hain.


6. Curvature: second derivative

Picture: figure s03 do arcs dikhata hai — ek gently curved (chhota ) aur ek sharply curved (bada ). Humein isse kyun chahiye: slope match karna tilt mein kinks hataata hai, lekin phir bhi ek subtle "bendiness jump" ho sakta hai. bhi match karna curve ko fair banata hai — aankhein curvature mein abrupt change nahi dekhti. , , aur teeno ko continuous demand karna bilkul wahi hai jo parent ==== kehta hai.

Figure — Cubic spline interpolation — natural, clamped

7. Moment — end-curvature ka nickname

ke saath kaam kyun karein? Kyunki ek single interval par, ek straight line hai (ek cubic ka second derivative linear hota hai). Ek straight line completely uske do endpoint values aur se pin hoti hai. Toh chaar coefficients per piece ke peeche bhaagne ki bajaye, hum sirf ek number per node track karte hain — bahut kam unknowns, aur woh ek solvable chain mein neatly link up ho jaate hain.


8. Slopes-of-slopes: right-hand side discrete curvature hai

Parent ki master equation ka right side hai Inner pieces padho: "rise over run" hai = right interval par average slope; doosra term left interval par average slope hai. Unka difference hai node cross karte waqt slope kitna badla — curvature ka ek raw, data-only estimate. Yeh "difference of differences" idea Finite differences ki duniya hai. ek constant hai jo cubic ko do baar integrate karne se nikalta hai; tum ise yahan faith par le sakte ho.


9. Boundary conditions — do missing facts

Parent coefficient-dials count karta hai lekin interpolation + smoothness se sirf equations milti hain, system ko 2 short chodke. Do aur facts do free ends par supply karne padte hain:

Dono missing two rows ki tarah plug in hote hain. "Natural" word = No curvature; "clamped" = Controlled slope.


10. Tridiagonal system — equations ki shape

Kyun care karein: ek tridiagonal system Tridiagonal systems & Thomas algorithm se bahut fast aur stably solve hota hai — heavy general matrix methods ki zaroorat nahi. Yahi ek bada practical reason hai ki splines compute karna sasta hai.


Prerequisite map

Data points x_i y_i ordered left to right

Interval width h_i

Cubic pieces S_i

Slope S prime

Curvature S double prime

Moment M_i equals S double prime at node

C2 smoothness at joins

Master tridiagonal system

Solve via Thomas algorithm

Boundary conditions natural or clamped

Runge phenomenon warns against one big polynomial

Cubic spline S x

Ise neeche ki taraf padho: points se widths aur cubic pieces milti hain; cubics se slope, phir curvature, phir moments; smoothness plus moments plus boundary facts tridiagonal system assemble karte hain; ise solve karne se spline milti hai.


Equipment checklist

Answers cover karo aur check karo ki parent padhne se pehle tum memory se har ek produce kar sakte ho.

ka kya matlab hai, aur counting kahan se shuru hoti hai?
Point number ki -value; counting se shuru hoti hai, isliye points hain.
kya hai aur har formula isse kyun divide karta hai?
, interval width; slopes aur curvatures "change per unit width" hain, isliye tumhe width se divide karna hi padega.
Ek interval par general cubic likho.
, chaar coefficients ke saath.
Ek single high-degree polynomial ki jagah har interval par ek cubic kyun?
Ek single high-degree polynomial oscillate karta hai (Runge phenomenon); per-interval cubics local aur calm rehte hain.
Seedhe words mein, kya hai?
Slope — us point par curve kitni steeply upar ya neeche jaati hai.
Seedhe words mein, kya hai?
Curvature — bendiness, yaani slope khud kitni tezi se change ho rahi hai.
continuity har interior node par kya demand karti hai?
Value, slope, aur curvature teeno dono sides se match karein — koi kink nahi aur koi curvature jump nahi.
Moment define karo.
, node par bilkul spline ki curvature.
RHS curvature estimate kyun hai?
Yeh do neighbouring average slopes ka difference hai — node ke across slope kitna badla.
Hum "2 short" kyun hain aur gap kaise bhara jaata hai?
unknown coefficients vs equations; do missing facts boundary conditions hain (natural ya clamped).
"Tridiagonal" ka kya matlab hai aur yeh good news kyun hai?
Nonzeros sirf main diagonal aur uske do neighbours par; yeh Thomas algorithm se quickly aur stably solve hota hai.