Answered step by step
Verified Expert Solution
Question
1 Approved Answer
IN PYTHON: 5. Step Size Control Solve the Van der Pol equation y =(1 - y2)y - y, y(0) = 2, y (0) = 0
IN PYTHON:
5. Step Size Control Solve the Van der Pol equation y" =(1 - y2)y - y, y(0) = 2, y (0) = 0 with y = 15 in the time interval t = [0,50 with the classical and an adaptive Runge kutta method. 1. Transform the differential equation into a first order system. 2. Use scipy integrate. RK45 to solve the ODE with stepsize control. This is an embedded Runge Kutta method with step-size controll as we dis- cussed in class. Make a plot for the numerical solution and also plot some markers on the t-axis for each tr. Use the tolerances rtol=1e-7, atol-1e-7. You can use the following code to get started: S = scipy.integrate. RK45(..., rtol=1e-7, atol-1e-7) while s.status is 'running': s.step() print(s.t, s.y[0]) 3. Solve the same problem with your own implementation of the classical Runge Kutta Method. Use 1000 time steps and plot the graph into the same figure as the adaptive solution. 4. Print out the number of steps of both methods and their difference at the final time. 5. Step Size Control Solve the Van der Pol equation y" =(1 - y2)y - y, y(0) = 2, y (0) = 0 with y = 15 in the time interval t = [0,50 with the classical and an adaptive Runge kutta method. 1. Transform the differential equation into a first order system. 2. Use scipy integrate. RK45 to solve the ODE with stepsize control. This is an embedded Runge Kutta method with step-size controll as we dis- cussed in class. Make a plot for the numerical solution and also plot some markers on the t-axis for each tr. Use the tolerances rtol=1e-7, atol-1e-7. You can use the following code to get started: S = scipy.integrate. RK45(..., rtol=1e-7, atol-1e-7) while s.status is 'running': s.step() print(s.t, s.y[0]) 3. Solve the same problem with your own implementation of the classical Runge Kutta Method. Use 1000 time steps and plot the graph into the same figure as the adaptive solution. 4. Print out the number of steps of both methods and their difference at the final time
Step by Step Solution
There are 3 Steps involved in it
Step: 1
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