Decentral lecture 2: Solving ordinary differential equations (ODEs) Hanneke Gelderblom, Adrie Mackus, Hjalmar Mulders, Silke Peeters Department of Applied Physics Overview of the course Interpretation Physical reality Variables, dimensions, nondimensionalization Physical phenomena • Elementary oscillations • Growth and decay • Electrical circuits • Mechanical waves • Non-linear oscillations • Chaotic behavior 2 Mathematical formulation Mathematical tools • Vectors • Polar coordinates • Differential equations • Taylor series • Linearization Title of the presentation - by tab Insert -> Header text and Footer text Evolution equation Analysis Analysis tools • Analytical solutions • Numerical solutions • Phase diagrams • Equilibrium states • Stability analysis • Insight Menu for today 08:45-09:15 Classification of ODEs 09:15-09:30 Exercises 3.1 – 3.5 09:30-09:45 Break 09:45-10:15 Solving homogeneous ODEs part I 10:15-10.30 Exercise LC circuit 10:30-10:45 Break 10:45-11:15 Solving homogeneous ODEs part II 11:15-11:30 Exercises 3.9, 3.11, 3.12 11:30-11.45 Break 11:45-12:00 Solving inhomogeneous ODEs 12:00-12:30 Exercises 3.8, 3.10, 3.13, 3.14 Homework: All exercises Ch.3 (exercises decentral + exercises 3.6, 3.7) 3 Department of Applied Physics and Science Education Corrections lecture notes Ch3 You can also find these slides on Canvas • p.54: eq. (3.12) and (3.14): a0x0 should be a0x • Top of p. 59: π π π‘ π should be π π π‘ π 4 Department of Applied Physics and Science Education Corrections exercises Ch3 • 9.3.5 (a): Show for the linear combination x(t) = Ax1(t)+Bx2(t) • 9.3.9 (a): equation (3.42) and (3.44) • 9.3.9 (b): Use the method of case I of the auxiliary equation • 9.3.11: • ππ ππ Θπ = π = 0 should be ΰΈ«′π=π = 0 ππ₯ ππ₯ π 9.3.13 (c): Also assume that π = ππ΄π π • 9.3.14: inversely proportional to time t should be inversely proportional to a timescale τ 5 Department of Applied Physics and Science Education Solving differential equations How do physical systems change? π π½ = ππ½ → π½ π π π What functions describe the change? Solutions to differential equations (DEs)! How to solve? You know: Direct integration, separation of variables, … there is more! Solution strategies work for certain types of DEs → Need for classification 6 Department of Applied Physics and Science Education Classification: Ordinary vs. Partial differential equations Ordinary differential eq. (ODE) Partial differential eq. (PDE) • Only 1 independent variable • Multiple independent variables • x(t), y(x), q(t) etc. • y(x,t), x(y,z,t) etc. • ππ¦ Example: + π₯ = 0 ππ₯ • Example: The wave equation (Ch.5) π 2 π¦(π₯, π‘) 1 π 2 π¦(π₯, π‘) = 2 ππ₯ 2 π£ ππ‘ 2 y In this course, we focus mostly on ODEs. Today we only discuss ODEs. t=tobserve 7 Department of Applied Physics x x=xobserve t Classification: Order Order: Natural number that gives the highest derivative in the equation a) b) c) d) e) π2π₯ +π₯ =0 ππ‘ 2 ππ₯ + 5π₯ = 0 ππ‘ π4π₯ ππ₯ + + 2π‘π₯ = 0 ππ‘ 4 ππ‘ π2π₯ + sin π₯ = 0 ππ‘ 2 ππ₯ π₯ − (π₯ 2 − 1) = 0 ππ‘ f) π2π₯ + 2π₯ = sin ππ‘ ππ‘ 2 8 Department of Applied Physics and Science Education Classification: Order Order: Natural number that gives the highest derivative in the equation a) b) c) d) e) π2π₯ +π₯ =0 ππ‘ 2 ππ₯ + 5π₯ = 0 ππ‘ π4π₯ ππ₯ + + 2π‘π₯ = 0 ππ‘ 4 ππ‘ π2π₯ + sin π₯ = 0 ππ‘ 2 ππ₯ π₯ − (π₯ 2 − 1) = 0 ππ‘ 2 1 4 2 1 f) π2π₯ + 2π₯ = sin ππ‘ ππ‘ 2 9 Department of Applied Physics and Science Education 2 Classification: Order Order: Natural number that gives the highest derivative in the equation A DE of Nth order can be written as a system of N coupled 1st order DEs a) π2π₯ +π₯ =0 ππ‘ 2 Set π₯1 (π‘) = π₯ and π₯2 (π‘) = ππ₯1 . Then formulate a): ππ‘ ππ₯1 = π₯2 ππ‘ ππ₯2 = −π₯1 ππ‘ This method will prove very handy when analyzing behavior of systems! 10 Department of Applied Physics and Science Education Classification: Homogeneity Homogeneous: Every term contains the dependent variable explicitly (or is 0) a) b) c) d) e) π2π₯ +π₯ =0 ππ‘ 2 ππ₯ + 5π₯ = 0 ππ‘ π4π₯ ππ₯ + + 2π‘π₯ = 0 ππ‘ 4 ππ‘ π2π₯ + sin π₯ = 0 ππ‘ 2 ππ₯ π₯ − (π₯ 2 − 1) = 0 ππ‘ f) π2π₯ + 2π₯ = sin ππ‘ ππ‘ 2 11 Department of Applied Physics and Science Education Classification: Homogeneity Homogeneous: Every term contains the dependent variable explicitly (or is 0) a) b) c) d) e) π2π₯ +π₯ =0 ππ‘ 2 ππ₯ + 5π₯ = 0 ππ‘ π4π₯ ππ₯ + + 2π‘π₯ = 0 ππ‘ 4 ππ‘ π2π₯ + sin π₯ = 0 ππ‘ 2 ππ₯ π₯ − (π₯ 2 − 1) = 0 ππ‘ homogeneous homogeneous homogeneous homogeneous inhomogeneous f) π2π₯ + 2π₯ = sin ππ‘ ππ‘ 2 12 Department of Applied Physics and Science Education inhomogeneous Classification: Autonomy t: time-invariant Autonomous: The independent variable does not occur explicitly in the DE a) b) c) d) e) π2π₯ +π₯ =0 ππ‘ 2 ππ₯ + 5π₯ = 0 ππ‘ π4π₯ ππ₯ + + 2π‘π₯ = 0 ππ‘ 4 ππ‘ π2π₯ + sin π₯ = 0 ππ‘ 2 ππ₯ π₯ − (π₯ 2 − 1) = 0 ππ‘ f) π2π₯ + 2π₯ = sin ππ‘ ππ‘ 2 13 Department of Applied Physics and Science Education Classification: Autonomy t: time-invariant Autonomous: The independent variable does not occur explicitly in the DE a) b) c) d) e) π2π₯ +π₯ =0 ππ‘ 2 ππ₯ + 5π₯ = 0 ππ‘ π4π₯ ππ₯ + + 2π‘π₯ = 0 ππ‘ 4 ππ‘ π2π₯ + sin π₯ = 0 ππ‘ 2 ππ₯ π₯ − (π₯ 2 − 1) = 0 ππ‘ autonomous autonomous non-autonomous autonomous autonomous f) π2π₯ + 2π₯ = sin ππ‘ ππ‘ 2 14 Department of Applied Physics and Science Education non-autonomous Classification: Linearity And no products (π₯π¦) or special functions (sin π₯ ) Linear: The dependent variable appears only to the 1st power a) b) c) d) e) f) 15 π2π₯ +π₯ =0 ππ‘ 2 ππ₯ + 5π₯ = 0 ππ‘ π4π₯ ππ₯ + + 2π‘π₯ = 0 ππ‘ 4 ππ‘ π2π₯ + sin π₯ = 0 ππ‘ 2 ππ₯ π₯ − (π₯ 2 − 1) = 0 ππ‘ Linear ODEs are generally much easier to solve than nonlinear ODEs.* π2π₯ + 2π₯ = sin ππ‘ ππ‘ 2 Department of Applied Physics and Science Education *For non-linear ODEs you often cannot find analytical solutions (Ch. 6 – 8), though you can linearize them (Ch. 5)! And no products (π₯π¦) or special functions (π π₯ ) Classification: Linearity Linear: The dependent variable appears only to the 1st power a) b) c) d) e) f) 16 π2π₯ +π₯ =0 ππ‘ 2 ππ₯ + 5π₯ = 0 ππ‘ π4π₯ ππ₯ + + 2π‘π₯ = 0 ππ‘ 4 ππ‘ π2π₯ + sin π₯ = 0 ππ‘ 2 ππ₯ π₯ − (π₯ 2 − 1) = 0 ππ‘ π2π₯ + 2π₯ = sin ππ‘ ππ‘ 2 linear linear linear non-linear Linear ODEs are generally much easier to solve than nonlinear ODEs.* non-linear linear Department of Applied Physics and Science Education *For non-linear ODEs you often cannot find analytical solutions (Ch. 6 – 8), though you can linearize them (Ch. 5)! On linear differential equations (see also exercise 9.3.5) Any linear combination of solutions to a linear DE is also a solution. If π π = ππ π and π π = ππ π are solutions to the nth order, linear, homogeneous ODE ππ π₯ ππ−1 π₯ π2 π₯ ππ₯ ππ π + ππ−1 π−1 + … + π2 2 + π1 + π0 π₯ = 0, ππ‘ ππ‘ ππ‘ ππ‘ then π π = π¨ππ π + π©ππ (π) is also a solution. “General solution” 17 Department of Applied Physics and Science Education On linear differential equations (see also exercise 9.3.5) If π π = ππ π is a solution to the nth order, linear, homogeneous ODE ππ π₯ ππ−1 π₯ π2 π₯ ππ₯ ππ π + ππ−1 π−1 + … + π2 2 + π1 + π0 π₯ = 0 ππ‘ ππ‘ ππ‘ ππ‘ and π π = ππ π is a solution to the nth order, linear, inhomogeneous ODE ππ π₯ ππ−1 π₯ π2 π₯ ππ₯ ππ π + ππ−1 π−1 + … + π2 2 + π1 + π0 π₯ = π(π‘), ππ‘ ππ‘ ππ‘ ππ‘ then π π = ππ π + ππ (π) is also a solution. “Homogeneous solution” ππ π = π¨ππ π + π©ππ (π) 18 “Particular solution” Department of Applied Physics and Science Education Menu for today 08:45-09:15 Classification of ODEs 09:15-09:30 Exercises 3.1 – 3.5 09:30-09:45 Break 09:45-10:15 Solving homogeneous ODEs part I 10:15-10.30 Exercise LC circuit 10:30-10:45 Break 10:45-11:15 Solving homogeneous ODEs part II 11:15-11:30 Exercises 3.9, 3.11, 3.12 11:30-11.45 Break 11:45-12:00 Solving inhomogeneous ODEs 12:00-12:30 Exercises 3.8, 3.10, 3.13, 3.14 Homework: All exercises Ch.3 (exercises decentral + exercises 3.6, 3.7) 19 Department of Applied Physics and Science Education 1st order homogeneous ODEs Direct integration • • ππ₯ =πΆ ππ‘ ππ₯ = π(π‘) ππ‘ Separation of variables • • ππ₯ =β π₯ ππ‘ ππ₯ =π π‘ β π₯ ππ‘ Decentral 1 “shortcut” Standard solutions ππ₯ 1 = ± π₯ ππ‘ π π₯ π‘ = πΆπ π‘ ±π τ: characteristic timescale Example: π π‘ = π‘ −1 ππ₯ π₯ π‘ = ΰΆ± ππ‘ ππ‘ = ΰΆ± π‘ −1 ππ‘ = ln π‘ + πΆ 20 Example: π π‘ = π‘, β π₯ = π₯ −1 1 ππ₯ = π π‘ ππ‘ β(π₯) π₯ π‘ = Department of Applied Physics and Science Education π‘2 + πΆ 1st order homogeneous ODEs Direct integration • • ππ₯ =πΆ ππ‘ ππ₯ = π(π‘) ππ‘ Separation of variables • • ππ₯ =β π₯ ππ‘ ππ₯ =π π‘ β π₯ ππ‘ Decentral 1 “shortcut” Standard solutions ππ₯ 1 = ± π₯ ππ‘ π π₯ π‘ = πΆπ π‘ ±π τ: characteristic timescale Example: π π‘ = π‘ −1 ππ₯ π₯ π‘ = ΰΆ± ππ‘ ππ‘ = ΰΆ±π‘ 21 −1 ππ‘ = ln π‘ + πΆ Example: π π‘ = π‘, β π₯ = π₯ −1 1 ππ₯ = π π‘ ππ‘ β(π₯) π₯ π‘ = Department of Applied Physics and Science Education π‘2 + πΆ Example: RC-circuit ππ 1 =− π ππ‘ πΉπͺ π₯ π‘ π‘ −πΉπͺ = π0 π 1st order homogeneous ODEs: Boundary conditions An Nth order ODE requires N integrations, giving N integration constants. A unique solution thus requires N boundary conditions. Car accelerating at constant ππππ ππ£ = ππππ ππ‘ π£ π‘ = ΰΆ± ππππ ππ‘ = ππππ π‘ + πΆ 1st order ODE → 1 initial condition: π£ π‘ = 0 = πΆ = π£0 → π£(π‘) = ππππ π‘ + π£0 22 Department of Applied Physics and Science Education If independent variable is time t: Boundary condition = initial condition 2nd order homogeneous ODEs: Boundary conditions An Nth order ODE requires N integrations, giving N integration constants. A unique solution thus requires N boundary conditions. Car accelerating at constant ππππ π2 π₯ = ππππ 2 ππ‘ 1 π₯ π‘ = ΰΆ΅ ππππ ππ‘ = ππππ π‘ 2 + πΆ1 π‘ + πΆ2 2 2nd order ODE → 2 initial conditions: π₯αΆ π‘ = 0 = πΆ1 = π£0 π₯ π‘ = 0 = πΆ2 = π₯0 23 Department of Applied Physics and Science Education 1 2 → π₯ π‘ = ππππ π‘ 2 + π£0 π‘ + π₯0 2nd order homogeneous ODEs: LC circuit (Exercise) • t < 0 s: charge in capacitor is Q0 • t = 0 s: electrical switch closed, discharging starts • Kirchhoff’s loop rule: σπ π=0 ππ = 0 • πΌ= ππ ππ‘ → + or - ? Goal: find evolution equation for charge on the plates, and solve it (i.e. find explicit expression for q(t)) + π πΆ 24 − π πΆ +πΏ ππΌ ππ‘ −πΏ ππΌ ππ‘ Department of Applied Physics and Science Education ππΆππ = π πΆ Inductor (coil) opposes change in current flow. The self-inductance L induces a voltage: ππΌ ππΆπππ = πΏ ππ‘ 2nd order homogeneous ODEs: LC circuit (Answer) • t < 0 s: charge in capacitor is Q0 • t = 0 s: electrical switch closed, discharging starts π ππΌ • σπ π=0 ππ = πΆ − πΏ ππ‘ = 0 (clockwise loop) • ππ π2 π π πΌ = − ππ‘ → L ππ‘ 2 + πΆ = 0 • π2 π π + = 0 → Standard solution ππ‘ 2 πΏπΆ • π π‘ = π΄ sin ππ‘ + π΅ cos ππ‘ • With π = 25 1 (as in exercise 9.1.10!) πΏπΆ Department of Applied Physics and Science Education ππΆππ = π πΆ Inductor (coil) opposes change in current flow. The self-inductance L induces a voltage: ππΌ ππΆπππ = πΏ ππ‘ Menu for today 08:45-09:15 Classification of ODEs 09:15-09:30 Exercises 3.1 – 3.5 09:30-09:45 Break 09:45-10:15 Solving homogeneous ODEs part I 10:15-10.30 Exercise LC circuit 10:30-10:45 Break 10:45-11:15 Solving homogeneous ODEs part II 11:15-11:30 Exercises 3.9, 3.11, 3.12 11:30-11.45 Break 11:45-12:00 Solving inhomogeneous ODEs 12:00-12:30 Exercises 3.8, 3.10, 3.13, 3.14 Homework: All exercises Ch.3 (exercises decentral + exercises 3.6, 3.7) 26 Department of Applied Physics and Science Education Some mathematics: Complex numbers (see 2WCB0) • • • • The imaginary unit π is defined by: π 2 = −1 → π = −1 Complex number is written as: π§ = π₯ + π¦π (→ π π π§ = π₯ and πΌπ π§ = π¦) Euler’s formula: π π§ = π π₯ π ππ¦ = π π₯ (cos π¦ + π sin π¦) Express cosine and sine using π: π ππ¦ + π −ππ¦ cos π¦ = 2 π ππ¦ − π −ππ¦ sin π¦ = 2π 27 Department of Applied Physics and Science Education Im(z) y O z=x+yi x Re(z) 2nd order homogeneous ODEs: RLC circuit • t < 0 s: charge in capacitor is Q0 • t = 0 s: electrical switch closed, discharging starts ππΆπππ = πΏ ππΌ ππ‘ • Kirchhoff’s loop rule: σπ π=0 ππ = 0 • πΌ=− ππ ππ‘ • Goal: find evolution equation for charge on the plates, and solve it (i.e. find explicit expression for q(t)) • Assume: π < 2 πΏ → D < 0 (Case III) πΆ ππ = πΌπ Department of Applied Physics and Science Education π πΆ Damped oscillation: π π‘ = π΄π ππ‘ sin ππ‘ + π΅π ππ‘ cos ππ‘ With π = 28 ππΆππ = −π 2πΏ (π = ) and π = 2πΏ π 1 π 2 − 2 πΏπΆ 4πΏ 2nd order homogeneous ODEs: LC vs. RLC circuit π2 π π ODE: ππ‘ 2 + πΏπΆ = 0 Damped oscillation Oscillation π π‘ = π΄ sin ππ‘ + π΅ cos ππ‘ With π = 29 π2 π ππ π ODE: πΏ ππ‘ 2 + π ππ‘ + πΆ = 0 1 πΏπΆ Department of Applied Physics π π‘ = π΄π ππ‘ sin ππ‘ + π΅π ππ‘ cos ππ‘ −π 2πΏ With π = (π = ) and π = 2πΏ π 1 π 2 − πΏπΆ 4πΏ2 Menu for today 08:45-09:15 Classification of ODEs 09:15-09:30 Exercises 3.1 – 3.5 09:30-09:45 Break 09:45-10:15 Solving homogeneous ODEs part I 10:15-10.30 Exercise LC circuit 10:30-10:45 Break 10:45-11:15 Solving homogeneous ODEs part II 11:15-11:30 Exercises 3.9, 3.11, 3.12 11:30-11.45 Break 11:45-12:00 Solving inhomogeneous ODEs 12:00-12:30 Exercises 3.8, 3.10, 3.13, 3.14 Homework: All exercises Ch.3 (exercises decentral + exercises 3.6, 3.7) 30 Department of Applied Physics and Science Education Inhomogeneous ODEs: educated guess for ππ π 2 π π₯ ππ₯ π 2 +π + ππ₯ + π(π‘) = 0 ππ‘ ππ‘ General solution: π₯ π‘ = π₯β π‘ + π₯π π‘ We focus on 2nd (and 1st) order ODEs, but this method works for any order Find π₯π π‘ through educated guess Appropriate educated guesses xp(t) for various d(t): 31 Department of Applied Physics and Science Education Find solution π₯β π‘ to homogeneous equivalent ODE: • 2nd order ODE: auxiliary equation • 1st order ODE: Separation of variables Inhomogeneous ODEs: educated guess for ππ π π2 π₯ ππ₯ π 2 +π + ππ₯ + π(π‘) = 0 ππ‘ ππ‘ General solution: π₯ π‘ = π₯β π‘ + π₯π π‘ = π΄π₯1 π‘ + π΅π₯2 π‘ + π₯π π‘ Find π₯π π‘ through educated guess What if the educated guess does not work? • This will happen if the educated guess is also a solution to the equivalent homogeneous ODE (π(π‘) = 0) • First try: π₯π π‘ = π‘ β πππ’πππ‘ππ ππ’ππ π • If that does not work, try: π₯π π‘ = π‘ 2 β πππ’πππ‘ππ ππ’ππ π 32 Department of Applied Physics and Science Education Decision tree: Choosing the right solution method Section 3.4 of the lecture notes guides you through the branches for various electrical circuits. 33 Department of Applied Physics and Science Education
0
You can add this document to your study collection(s)
Sign in Available only to authorized usersYou can add this document to your saved list
Sign in Available only to authorized users(For complaints, use another form )