4.8.27 · HinglishNumerical Methods

Systems of ODEs — RK4 for systems

1,407 words6 min readRead in English

4.8.27 · Maths › Numerical Methods


Hum kya solve kar rahe hain (KYA)


RK4-for-systems ko scratch se derive karna (KAISE)

Ek step par exact integral se shuru karte hain:

RK4 is integral ko Simpson-jaisi sampling se approximate karta hai — ko start par, midpoint par do baar, aur end par evaluate karta hai — lekin estimated states use karke, unknown true ones se nahi.

Figure — Systems of ODEs — RK4 for systems

Worked Example 1 — ek 2×2 linear system

Solve karo with . (True solution: .) lo, ek step.

Toh .

Step k1. . Yeh step kyun? Current state use karke start par slope nikala.

Step k2. Intermediate state . . Yeh step kyun? Hum slope ko predicted midpoint par re-evaluate karte hain — note karo ki dono components ne advanced state use ki, sirf ek ne nahi.

Step k3. . . Yeh step kyun? use karke ek refined midpoint slope.

Step k4. . . Yeh step kyun? Interval ke end par slope.

Combine karo. True: , . ki value ~4 decimals tak match karti hai; ki value ~3 decimals tak match karti hai — sirf ek step mein.


Worked Example 2 — reduction se ek 2nd-order ODE

Solve karo , . Reduce karo: : Yeh step kyun? Example 1 jaisi hi physics hai — pendulum/oscillator. Humne ek 2nd-order ODE ko system mein convert kiya taaki RK4-for-systems directly apply ho sake. Result identical hai: track karta hai. Yeh prove karta hai ki reduction trick ek method ko saare orders handle karne deti hai.


Forecast-then-Verify


80/20 — woh thodi cheezein jo sab kuch carry karti hain

Recall Feynman: ek 12-saal ke bacche ko samjhao

Socho do dost daud rahe hain aur haath pakde hain — jahan ek jaata hai doosre par asar padta hai. Andaaza lagaane ke liye ki woh ek pal baad kahan honge, tum sirf ek baar peek nahi karte; tum chaar baar peek karte ho: shuru mein, beech mein do baar, aur end mein — har baar andaaza lagate ho ki dono dost saath mein kahan gaye. Phir tum ek smart weighted average lete ho (beech wale peeks ko double count karo). Kyunki woh haath pakde hain, tumhe har peek par dono ko move karna padta hai, kabhi ek ko akela nahi. Wahi careful four-peek average hai RK4 for systems.


Connections

  • RK4 for a single ODE — scalar parent method.
  • Reducing higher-order ODEs to first-order systems
  • Euler's method for systems — sasta, kam accurate cousin.
  • Local vs Global Truncation Error — kyun local → global.
  • Stiff systems and stability — jahan explicit RK4 struggle karta hai.
  • Simpson's Rule — woh quadrature jise RK4 mimic karta hai.

Scalar RK4 ko system ke liye RK4 mein kya change karta hai?
Har scalar (, , ) ko uske vector version se replace karo; recipe aur weights unchanged rehte hain.
Poora vector finish karne ke baad hi kyun shuru karo?
Kyunki har saare components par depend karta hai; ko har component ki synchronized advanced state chahiye.
2nd-order ODE ko first-order system mein kaise banate ho?
set karo; tab .
RK4 final combination formula (vector)?
.
RK4 ka global error order kya hai?
(local truncation ).
mein state ke liye kya argument pass karte ho?
at time .
RK4 ek step mein kaunsa integral approximate karta hai?
, Simpson-style sampled.

Concept Map

generalise via

gives

with initial data

via

becomes

Simpson sampling

works on vectors so

enables

uses

achieves

coupling breaks if

Scalar ODE y'=f

First-order system y'=f vector

IVP with y at t0

Treat unknowns as one vector

Higher-order ODE

Reduction: name derivatives

Exact integral over one step

Only algebra of f, h, add/mul

RK4 for systems vector form

Each k_i is length-n vector

Global error O h^4

Mistake: advance components separately