Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Show how this looks on python programming 1. So far in class the only implicit method we have discussed is the Backward-Euler method, but there
Show how this looks on python programming
1. So far in class the only implicit method we have discussed is the Backward-Euler method, but there are many more (infinitely many!). For example, consider the second-order Adam's Moulton method, At Yk+1=Yk+(f(tk+1, Yk+1) + f(tk, yk)) 2 (can you tell why it's implicit?). In this problem, we will solve the stiff ODE discussed in Activity 7, y' (t) = (5 x 105)(-y+sin(t)), 0t 2 y (0) = 0, using 100 equally spaced points between 0 and 2. (a) To solve using the Adam's Moulton method given above, you will need to solve a root-finding problem, g(2) = 0, at each step. To make sure that you are setting this up correctly, create an anonymous function g at t = 0 and evaluate 9(3)]. Save the result to A1. (You can define g(z) up to constant. So submit A1 as the absolute value of g(z)). (b) Implement the Adam's-Moulton method given above to solve the IVP at the 100 equally spaced points between 0 and 2. Save the resulting array of 100 elements to the array A2. 2. In this problem we will compare the built-in explicit solvers that implement RK45 scipy. integrate.solve.ivp with the implicit solvers, scipy. integrate. solve ivp with method = 'BDF'. The Belousov-Zhabotinsky (BZ) reaction is a chemical reaction that gives rise to a nonlinear chemical oscillator. The BZ reac- tion has many important applications, but most importantly for me, it looks cool. Really, I highly recommend looking it up on YouTube. A model for the BZ reaction is given by y(t) = s(y2-y1y2 +9 - 94) 1 3/2 (1) = (-y2-y1y2 + Y3) 8 y(t) = w(y1 - y3). Here y corresponds to the concentration of Bromous Acid, (HBrO2), 1/2 corresponds to the concen- tration of Bromide (BR), y3 corresponds to the concentration of Cerium (Ce+), and s, w, and q are dimensionless parameters relating to the rate of conversions between compounds. Here we will take s = 77.27, and w= 0.161, and we will change q to see how it changes the behavior of the so- lutions (changing q changes the stiffness of the ODE). Throughout, we will use the initial condition 31 (0) = 1, 92 (0) = 2, y3 (0) = 3 and solve for 0 < t < 30.
Step by Step Solution
★★★★★
3.53 Rating (170 Votes )
There are 3 Steps involved in it
Step: 1
It looks like youve provided a detailed problem statement with multiple subparts Each part of the problem requires specific calculations and implementations in Python Ill guide you through each step p...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started