4.8.28 · D4 · HinglishNumerical Methods

ExercisesBoundary value problems — shooting method, finite difference

2,105 words10 min read↑ Read in English

4.8.28 · D4 · Maths › Numerical Methods › Boundary value problems — shooting method, finite difference

Do symbols baar baar aate hain; inhe ek baar pin kar lo taaki koi line undefined mark use na kare:


Level 1 — Recognition

L1.1 — IVP ya BVP?

Har ek ko classify karo. Batao ki tum march karoge (IVP) ya aim / puzzle-solve karoge (BVP), aur kyun.

  • (a)
  • (b)
Recall Solution

Kya decide karta hai: dekho conditions kahan hain. Dono ek hi point par ⇒ IVP (wahan aur dono pata hain, toh aage step kar sakte ho). Ek-ek dono ends par ⇒ BVP.

  • (a) Dono conditions par ⇒ IVP. Start par poori state pata hai, toh e.g. RK4 se aage march karo.
  • (b) left end par, right end par ⇒ two-point BVP. March nahi kar sakte (starting slope missing hai) — shooting ya finite difference use karo.

L1.2 — Stencil coefficients padh ke nikalo

Linear BVP ko standard form mein likhne par, interior node par finite-difference row hai ke liye ke saath, teen coefficients (lower, diagonal, upper) aur right-hand side likho jab ho.

Recall Solution

Identify karo toh .

  • lower
  • diagonal
  • upper
  • RHS

Notice karo lower upper — yeh asymmetry exactly first-derivative (convection) term ki wajah se hai.


Level 2 — Application

L2.1 — Ek secant shooting step

Ek BVP mein landing-miss function hai. Do shots ne diya nikalne ke liye ek secant update karo.

Recall Solution

Kyun secant: ko saste mein differentiate nahi kar sakte (har evaluation ek poora IVP solve hai), toh hum ko last do points se ek straight line se approximate karte hain aur wahan zero dhundhhte hain. Sign check: ne aur ke beech sign badla, toh root aur ke beech hai — aur wahan hai. Sahi hai.

L2.2 — Linear shooting exactly do shots mein

Linear BVP ko linear-interpolation shortcut se solve karo. Shots aur use karo. Target .

Recall Solution

Kyun do shots kaafi hain: linear ODE ke liye landing value , ka straight-line function hai, toh ek line hai — do points use exactly fix kar dete hain, iteration nahi chahiye.

  • Shot : IVP , toh .
  • Shot : linearity se , toh . hit karne ke liye interpolate karo: ka exact starting slope hai. ✓ Do shots mein exactly recover hua.

L2.3 — FDM with ek interior node

ko ke saath solve karo (toh , ek interior node ).

Recall Solution

Yahan . Single interior row (): ke saath: . Boundary values known hain: . Unhe right side move karo: True value ; error sirf do intervals ke saath.


Level 3 — Analysis

L3.1 — Tridiagonal system build karo aur solve karo ()

ko () ke saath solve karo. ke liye tridiagonal system set up karo aur solve karo. ko truth se compare karo.

Recall Solution

, . Har interior row: , yaani diagonal , off-diagonals . Nodes . Boundaries , .

i=1:&\quad -2.0625\,y_1 + y_2 = -y_0 = 0,\\ i=2:&\quad y_1 -2.0625\,y_2 + y_3 = 0,\\ i=3:&\quad y_2 -2.0625\,y_3 = -y_4 = -1.1752. \end{aligned}$$ **Thomas / elimination** (forward sweep): - Row 1: $y_1=y_2/2.0625$. - Row 2 mein substitute karo: $\dfrac{y_2}{2.0625}-2.0625\,y_2+y_3=0\Rightarrow(-2.0625+0.4848)y_2+y_3=0\Rightarrow -1.5777\,y_2+y_3=0$, toh $y_3=1.5777\,y_2$. - Row 3 mein substitute karo: $y_2-2.0625(1.5777\,y_2)=-1.1752\Rightarrow(1-3.2540)y_2=-1.1752\Rightarrow -2.2540\,y_2=-1.1752$. $$y_2=\frac{1.1752}{2.2540}=\mathbf{0.5214}.$$ Back-substitute: $y_1=0.5214/2.0625=\mathbf{0.2528}$, $y_3=1.5777(0.5214)=\mathbf{0.8226}$. **Compare:** $\sinh(0.5)=0.5211$. Midpoint par error ab $\approx0.0003$ hai — versus $N=2$ par $0.0012$. $h$ adha karne par error lagbhag $4\times$ gira, jo $O(h^2)$ confirm karta hai.
Figure — Boundary value problems — shooting method, finite difference

L3.2 — Naive secant bracket miss kyun kar sakta hai

aur diye hain (same as L2.1), suppose karo ki true curved hai: actually. Ek line mein explain karo ki ek linear secant step exact answer kyun nahi hai yahan, aur kya karna chahiye.

Recall Solution

Secant step ne assume kiya tha ki ek straight line hai, toh usne predict kiya ki root par hai. Lekin real : function curved hai (ODE nonlinear hai), toh do points se ek line root ek shot mein nahi pakad sakti. Fix: iterate karo — nayi pair use karo… actually sign-changing pair kyunki — aur ek aur secant step lo, tab tak repeat karo jab tak . Do shots mein exactness sirf linear ka privilege hai.


Level 4 — Synthesis

L4.1 — FDM with convection term

ko (, ek interior node ) ke saath set up karo aur solve karo. Note karo ki standard form hai jisme .

Recall Solution

Single interior row par coefficients:

  • lower ,
  • diagonal ,
  • upper ,
  • RHS .

Row: . Boundaries : Asymmetry lowerupper convection term ka fingerprint hai: information flow direction ki taraf jhukti hai.

L4.2 — Order-of-accuracy audit

Usi BVP ke do FDM runs ne midpoint errors diye aur . Observed order estimate karo Kya scheme designed as perform kar rahi hai?

Recall Solution

Kyun : agar , toh adha karne par error se multiply hota hai; ratio , aur uska lene par milta hai. Central-difference scheme ke liye designed hai, aur measured order hai — exactly as designed perform kar rahi hai. (Dekho Truncation error and order of accuracy.)


Level 5 — Mastery

L5.1 — Method choose karo aur justify karo

Tumhe ek stiff, nonlinear BVP solve karni hai long domain par jahan par chhoti si slope error exponentially badhti hai. Kaun sa method — shooting ya FDM — choose karoge, aur do concrete reasons do.

Recall Solution

Finite difference choose karo. Reasons:

  1. Long/stiff domains par stability: shooting ek IVP ko aage march karti hai, toh guessed slope mein chhoti si error par exponentially amplify hoti hai — yahi toh yahan difficulty ki definition hai. FDM saare nodes simultaneously solve karta hai, errors ko local rakhta hai propagate hone ki bajaye.
  2. Sensitive root-find nahi: stiff problem ke liye bahut steeply curved hoti hai, toh par secant/Newton ill-conditioned hota hai. FDM problem ko ek (banded) algebraic system mein convert karta hai; nonlinear part ke liye poore system par Newton apply karo (Jacobian tridiagonal-ish hai, phir bhi Tridiagonal systems — Thomas algorithm se sasta).

Trade-off acknowledged: FDM ko har Newton step mein nonlinear solve chahiye, lekin jab shooting blow up ho jaati hai tab uski stability decisively jeet jaati hai.

L5.2 — Full pipeline, ek clean pass

ko RK-free reasoning ke saath shooting se solve karo: kyunki ODE linear hai tum exact IVP solution use kar sakte ho. aur shoot karo, phir exact slope par linearly interpolate karo, aur finally recovered solution se state karo.

Recall Solution

Kyun : ke liye, unique IVP solution hai (yeh ODE satisfy karta hai, , aur ).

  • Shot : .
  • Shot : .
  • Target . Interpolate: ke saath: , toh exact midpoint value (shooting ne true solution recover ki kyunki ODE linear hai).

Recall One-line self-test

Central second-difference stencil for ::: , accurate to . Landing-miss function in shooting ::: ; solve . Why linear BVP shoots exact in 2 tries ::: ek straight line hai, aur 2 points ek line fix kar dete hain. Observed order from two errors ::: .