Level 5 — MasteryOrdinary Differential Equations

Ordinary Differential Equations

printable — key stays hidden on paper

Level 5 | Time: 90 min | Total: 60 marks

Q1 — Laplace, Convolution & Impulse Response (24)

(a) [4] Derive transfer function H(s)=Y/FH(s)=Y/F, ROC, poles. (b) [5] Prove convolution theorem from definition. (c) [5] Compute impulse response h(t)h(t) using ωd\omega_d. (d) [6] Step input u(ta)u(t-a): solve by second-shift AND convolution; show agreement. (e) [4] Euler pseudocode (state-space) + steady-state value (ω0=2,ζ=0.25\omega_0=2,\zeta=0.25).

Q2 — Nonlinear System: Pendulum (20)

x˙=y, y˙=sinxβy, β>0.\dot x=y,\ \dot y=-\sin x-\beta y,\ \beta>0. (a) [3] Critical points in π<xπ-\pi<x\le\pi. (b) [9] Jacobian, linearize, classify each equilibrium. (c) [6] Origin, β=1\beta=1: eigen-solve linear system. (d) [2] Why linearization fails for centres; bifurcation value.

Q3 — Legendre Series & Special Function (16)

(1x2)y2xy+λ(λ+1)y=0.(1-x^2)y''-2xy'+\lambda(\lambda+1)y=0. (a) [6] x=0x=0 ordinary; recurrence for ana_n. (b) [5] Termination when λ=n\lambda=n; give P2P_2. (c) [5] Prove 11P1P2dx=0\int_{-1}^1 P_1P_2\,dx=0; state general relation.

Answer keyMark scheme & solutions

Question 1

(a) Transfer function (4) Laplace with zero ICs: L{y}=s2Y\mathcal{L}\{y''\}=s^2Y, L{y}=sY\mathcal{L}\{y'\}=sY. So (s2+2ζω0s+ω02)Y(s)=F(s).(s^2+2\zeta\omega_0 s+\omega_0^2)Y(s)=F(s). (2 — using derivative rule) H(s)=YF=1s2+2ζω0s+ω02.H(s)=\frac{Y}{F}=\frac{1}{s^2+2\zeta\omega_0 s+\omega_0^2}. (1) Poles: s=ζω0±iω01ζ2=ζω0±iωds=-\zeta\omega_0\pm i\omega_0\sqrt{1-\zeta^2}=-\zeta\omega_0\pm i\omega_d. ROC: (s)>ζω0\Re(s)>-\zeta\omega_0 (right of rightmost pole). (1)

(b) Convolution theorem (5) L{(gh)}=0est ⁣0tg(τ)h(tτ)dτdt.\mathcal{L}\{(g*h)\}=\int_0^\infty e^{-st}\!\int_0^t g(\tau)h(t-\tau)\,d\tau\,dt. (1) Region: 0τt<0\le\tau\le t<\infty. Swap order (Fubini, valid since integrand absolutely integrable when g,hg,h of exponential order and s\Re s large enough): (1 for stating condition) =0g(τ) ⁣τesth(tτ)dtdτ.=\int_0^\infty g(\tau)\!\int_\tau^\infty e^{-st}h(t-\tau)\,dt\,d\tau. (1) Substitute u=tτu=t-\tau, du=dtdu=dt: =0g(τ)esτ ⁣0esuh(u)dudτ=(0g(τ)esτdτ)H(s)=G(s)H(s).=\int_0^\infty g(\tau)e^{-s\tau}\!\int_0^\infty e^{-su}h(u)\,du\,d\tau = \Big(\int_0^\infty g(\tau)e^{-s\tau}d\tau\Big)H(s)=G(s)H(s). (2)

(c) Impulse response (5) H(s)=1(s+ζω0)2+ωd2H(s)=\dfrac{1}{(s+\zeta\omega_0)^2+\omega_d^2} (complete the square). (2) Since L{eatsinωdt}=ωd(s+a)2+ωd2\mathcal{L}\{e^{-at}\sin\omega_d t\}=\dfrac{\omega_d}{(s+a)^2+\omega_d^2}, (1) h(t)=1ωdeζω0tsin(ωdt),t0.h(t)=\frac{1}{\omega_d}e^{-\zeta\omega_0 t}\sin(\omega_d t),\quad t\ge0. (2)

(d) Step response two ways (6) Route 1 — convolution: y=hf=0th(tτ)u(τa)dτ=ath(tτ)dτy=h*f=\int_0^t h(t-\tau)u(\tau-a)d\tau=\int_a^t h(t-\tau)d\tau for t>at>a. Let σ=tτ\sigma=t-\tau: y=0tah(σ)dσ=1ωd0taeζω0σsinωdσdσ.y=\int_0^{t-a}h(\sigma)d\sigma=\frac{1}{\omega_d}\int_0^{t-a}e^{-\zeta\omega_0\sigma}\sin\omega_d\sigma\,d\sigma. (2) Using 0Teaσsinωdσdσ=aeaT(sinωdT)ωdeaTcosωdT+ωda2+ωd2\int_0^T e^{-a\sigma}\sin\omega_d\sigma\,d\sigma=\frac{a\,e^{-aT}(-\sin\omega_d T)-\omega_d e^{-aT}\cos\omega_d T+\omega_d}{a^2+\omega_d^2} with a=ζω0a=\zeta\omega_0, a2+ωd2=ω02a^2+\omega_d^2=\omega_0^2: y(t)=1ω02[1eζω0(ta)(cosωd(ta)+ζω0ωdsinωd(ta))], t>a.y(t)=\frac{1}{\omega_0^2}\Big[1-e^{-\zeta\omega_0(t-a)}\Big(\cos\omega_d(t-a)+\tfrac{\zeta\omega_0}{\omega_d}\sin\omega_d(t-a)\Big)\Big],\ t>a. (2) Route 2 — second shift: For step at t=0t=0, Y(s)=H(s)/sY(s)=H(s)/s. Partial fractions / inverse give the bracket above with argument tt; second-shift theorem L{u(ta)g(ta)}=easG(s)\mathcal{L}\{u(t-a)g(t-a)\}=e^{-as}G(s) replaces ttat\to t-a, reproducing the same expression. Both agree. (2)

(e) Euler + steady state (4) State-space x1=y, x2=yx_1=y,\ x_2=y': x˙1=x2, x˙2=f2ζω0x2ω02x1\dot x_1=x_2,\ \dot x_2=f-2\zeta\omega_0 x_2-\omega_0^2 x_1. (1)

h=0.01; x1=0; x2=0; t=0
while t<T:
    f = 1                     # unit step
    dx1 = x2
    dx2 = f - 2*z*w0*x2 - w0**2*x1
    x1 += h*dx1; x2 += h*dx2; t += h
    record(t, x1)

(2) Steady state: set derivatives =0ω02y=1=0 \Rightarrow \omega_0^2 y=1, y=1/ω02=1/4y_\infty=1/\omega_0^2=1/4. (1)

Question 2

(a) Critical points (3) y=0y=0 and sinx=0x=0, π\sin x=0 \Rightarrow x=0,\ \pi. Points: (0,0)(0,0) and (π,0)(\pi,0). (3)

(b) Jacobian & classification (9) J=(01cosxβ)J=\begin{pmatrix}0&1\\-\cos x&-\beta\end{pmatrix}. (2) At (0,0)(0,0): J=(011β)J=\begin{pmatrix}0&1\\-1&-\beta\end{pmatrix}, char eqn s2+βs+1=0s^2+\beta s+1=0, s=β±β242s=\frac{-\beta\pm\sqrt{\beta^2-4}}{2}. For 0<β<20<\beta<2: complex with negative real part → stable spiral; for β>2\beta>2stable node. (4) At (π,0)(\pi,0): J=(011β)J=\begin{pmatrix}0&1\\1&-\beta\end{pmatrix}, char eqn s2+βs1=0s^2+\beta s-1=0, s=β±β2+42s=\frac{-\beta\pm\sqrt{\beta^2+4}}{2}: one positive, one negative root → saddle (unstable). (3)

(c) Origin, β=1\beta=1 (6) s2+s+1=0s=12±i32s^2+s+1=0\Rightarrow s=-\tfrac12\pm i\tfrac{\sqrt3}{2}. (2) Eigenvector for ss: (0s)v1+v2=0v2=sv1(0-s)v_1+v_2=0\Rightarrow v_2=s v_1, take v=(1,s)T\mathbf v=(1,s)^T. (2) Real general solution: x(t)=et/2[c1(cos32tusin32tw)+c2()],\mathbf x(t)=e^{-t/2}\Big[c_1\big(\cos\tfrac{\sqrt3}{2}t\,\mathbf u-\sin\tfrac{\sqrt3}{2}t\,\mathbf w\big)+c_2(\dots)\Big], concretely x(t)=et/2(Acos32t+Bsin32t)x(t)=e^{-t/2}\big(A\cos\tfrac{\sqrt3}{2}t+B\sin\tfrac{\sqrt3}{2}t\big), y=x˙y=\dot x. (2)

(d) (2) A nonlinear centre has purely imaginary linear eigenvalues; nonlinear terms can push it to a stable/unstable spiral, so linearization is inconclusive (borderline case). Node↔spiral bifurcation at origin occurs at β=2\beta=2 (discriminant zero). (2)

Question 3

(a) Recurrence (6) p(x)=2x1x2p(x)=\frac{-2x}{1-x^2}, q(x)=λ(λ+1)1x2q(x)=\frac{\lambda(\lambda+1)}{1-x^2} analytic at 00 → ordinary point. (1) Sub y=anxny=\sum a_n x^n: n(n1)anxn2n(n1)anxn2nanxn+λ(λ+1)anxn=0.\sum n(n-1)a_n x^{n-2}-\sum n(n-1)a_n x^n-2\sum n a_n x^n+\lambda(\lambda+1)\sum a_n x^n=0. (2) Coefficient of xnx^n: (n+2)(n+1)an+2=[n(n1)+2nλ(λ+1)]an=[n(n+1)λ(λ+1)]an,(n+2)(n+1)a_{n+2}=[n(n-1)+2n-\lambda(\lambda+1)]a_n=[n(n+1)-\lambda(\lambda+1)]a_n, an+2=n(n+1)λ(λ+1)(n+1)(n+2)an.a_{n+2}=\frac{n(n+1)-\lambda(\lambda+1)}{(n+1)(n+2)}a_n. (3)

(b) Termination & P2P_2 (5) When λ=n\lambda=n: numerator vanishes at that nn, so an+2=0a_{n+2}=0 and the series (same parity) terminates → polynomial. (2) For λ=2\lambda=2: a2=062a0=3a0a_2=\frac{0-6}{2}a_0=-3a_0, a4=0a_4=0. Even series: y=a0(13x2)y=a_0(1-3x^2). Normalize P2(1)=1P_2(1)=1: a0(13)=2a0=1a0=12a_0(1-3)=-2a_0=1\Rightarrow a_0=-\tfrac12: P2=12(3x21)P_2=\tfrac12(3x^2-1). (3)

(c) Orthogonality (5) P1=xP_1=x, P2=12(3x21)P_2=\tfrac12(3x^2-1). 11x12(3x21)dx=1211(3x3x)dx=0\int_{-1}^1 x\cdot\tfrac12(3x^2-1)dx=\tfrac12\int_{-1}^1(3x^3-x)dx=0 (odd integrand). (3) General: 11PmPndx=22n+1δmn\int_{-1}^1 P_m P_n dx=\frac{2}{2n+1}\delta_{mn}. (2)

[
{"claim":"H(s) poles have real part -zeta*omega0","code":"s,z,w0=symbols('s zeta omega0',positive=True); roots=solve(s**2+2*z*w0*s+w0**2,s); result = all(simplify(re(r.rewrite(sqrt))+z*w0)==0 for r in [ -z*w0+I*w0*sqrt(1-z**2), -z*w0-I*w0*sqrt(1-z**2) ])"},
{"claim":"impulse response inverse Laplace correct","code":"t,z,w0=symbols('t zeta omega0',positive=True); wd=w0*sqrt(1-z**2); s=symbols('s'); H=1/(s**2+2*z*w0*s+w0**2); h=inverse_laplace_transform(H,s,t); result = simplify(h-exp(-z*w0*t)*sin(wd*t)/wd)==0"},
{"claim":"step steady state = 1/w0^2 with w0=2 gives 1/4","code":"result = Rational(1,4)==Rational(1,2**2)"},
{"claim":"origin beta=1 eigenvalues -1/2 +- i sqrt3/2","code":"s=symbols('s'); r=solve(s**2+s+1,s); result = set(r)=={Rational(-1,2)+I*sqrt(3)/2, Rational(-1,2)-I*sqrt(3)/2}"},
{"claim":"P2 normalized and orthogonal to P1","code":"x=symbols('x'); P1=x; P2=(3*x**2-1)/2; result = (integrate(P1*P2,(x,-1,1))==0) and (P2.subs(x,1)==1) and (integrate(P2*P