Day 34 • • • • • • (Concept Question) Adding Air Drag Review Euler Process Trajectory with Drag Euler Convergence (Exercises) ME123 Computer Applications I Adding Air Drag • Yesterday we used Euler’s method to solve equations for which we knew the exact solution • We only did that for practice • Today we will solve equations which have no exact solution ME123 Computer Applications I Adding Air Drag Suppose we have a ball falling: 𝑘𝑉 2 𝑚 𝑚𝑔 𝑑𝑉 = −𝑚𝑔 + 𝑘𝑉 2 𝑑𝑡 𝑑𝑉 𝑘 = −𝑔 + 𝑉 2 𝑑𝑡 𝑚 This one is much harder to solve analytically. ME123 Computer Applications I Adding Air Drag This is the only new term! 𝑘𝑉 2 𝑚𝑔 𝑑𝑉 𝑘 = −𝑔 + 𝑉 2 𝑑𝑡 𝑚 𝑑𝑦 =𝑉 𝑑𝑡 𝑉 0 =0 𝑦 0 =0 You will work with these equations in the exercises. ME123 Computer Applications I Review Euler Process 1. Replace differentials with small differences 𝑑𝑥 = 𝑓 𝑥, 𝑡 𝑑𝑡 ∆𝑥 = 𝑓 𝑥, 𝑡 ∆𝑡 𝑥𝑖+1 − 𝑥𝑖 = 𝑓(𝑥, 𝑡) ∆𝑡 ME123 Computer Applications I Review Euler Process 2. Evaluate rhs at time 𝑖 𝑥𝑖+1 − 𝑥𝑖 = 𝑓(𝑥, 𝑡) ∆𝑡 𝑥𝑖+1 − 𝑥𝑖 = 𝑓(𝑥𝑖 , 𝑡𝑖 ) ∆𝑡 ME123 Computer Applications I Review Euler Process 3. Isolate 𝑥𝑖+1 𝑥𝑖+1 − 𝑥𝑖 = 𝑓(𝑥𝑖 , 𝑡𝑖 ) ∆𝑡 𝑥𝑖+1 − 𝑥𝑖 = (∆𝑡) 𝑓(𝑥𝑖 , 𝑡𝑖 ) 𝑥𝑖+1 = 𝑥𝑖 + (∆𝑡) 𝑓(𝑥𝑖 , 𝑡𝑖 ) ME123 Computer Applications I Review Euler Process 4. March in time starting from initial condition 𝑥1 = 𝑥(0) 𝑥2 = 𝑥1 + (∆𝑡) 𝑓(𝑥1 , 𝑡1 ) 𝑥3 = 𝑥2 + ∆𝑡 𝑓 𝑥2 , 𝑡2 𝑥𝑖+1 = 𝑥𝑖 + (∆𝑡) 𝑓(𝑥𝑖 , 𝑡𝑖 ) ME123 Computer Applications I Trajectory with Drag Launch a projectile with air drag: 𝑘𝑉 The air drag always acts to oppose the motion of the projectile. 2 𝑚𝑔 Its magnitude depends on the square of the magnitude of the velocity. This one has NO exact solution. It MUST be solved numerically. ME123 Computer Applications I Trajectory with Drag Launch a projectile with air drag: 𝑚 𝑘𝑉 2 𝑚 y 𝑚𝑔 x 𝑑𝑉𝑥 𝑉𝑥 2 = −𝑘 𝑉 𝑑𝑡 𝑉 𝑉𝑥 0 = 𝑉𝑙𝑎𝑢𝑛𝑐ℎ cos 𝜃 𝑑𝑉𝑦 𝑉𝑦 2 = −𝑘 𝑉 − 𝑚𝑔 𝑑𝑡 𝑉 𝑉𝑦 0 = 𝑉𝑙𝑎𝑢𝑛𝑐ℎ sin 𝜃 𝑑𝑥 = 𝑉𝑥 𝑑𝑡 𝑥 0 =0 𝑑𝑦 = 𝑉𝑦 𝑑𝑡 𝑦 0 =0 You will work with these equations in the Exercises. ME123 Computer Applications I Euler Convergence • Euler gives you an approximate answer to the equations • The smaller ∆𝑡 is, the closer the answer is to the correct solution • When you don’t know the correct solution, just keep making ∆𝑡 smaller until the answer doesn’t change much anymore ME123 Computer Applications I