Answered step by step
Verified Expert Solution
Question
1 Approved Answer
plese use python to solve it! 3. In this problem we are going to consider a famous problem, that can have stiffness. It is the
plese use python to solve it!
3. In this problem we are going to consider a famous problem, that can have stiffness. It is the Van der Pol oscillator, x(t)(1x(t)2)x(t)+x(t)=0. The Van der Pol oscillator represents an oscillator with non-linear damping. The damping term is the (1x2)x term. In this problem we will use =200 and the initial conditions x(0)=2,x(0)=0. (a) Recall that second-order ODEs can be written in the form of two first-order ODEs. Define y=x(t) to find a system of two first-order ODEs for the Van der Pol oscillator. Your system should look like x(t)=y(t)= Create two anonymous functions, dxdt and dydt, that implement the system you've defined above. Plug in (x,y)=(2,3), save the result of x to the variable A6 and y to the variable A7. (b) Solve the ODE using the built-in RK45 solver for 0t400. Save the values of x(t) to the array A8. Hint: think about how we use the initial conditions x(0)=2 and x(0)=0 with the new variables x(t) and y(t). How is y(0) related to x(0) ? (c) Solve the ODE using the built-in implicit BDF solver with the same configuration as above. Save the values of x(t) to the array A9. (d) With =200 the ODE is stiff (you will explore this more in Writeup Problem 1). To measure the stiffness, record the ratio between the number of points used in the RK45 solver to the number of points used in the implicit BDF solver. Save your answer to the variable A10. (e) The nonlinear Van der Pol equation is too difficult to solve analytically, so people often resort to a simpler model. When x is small, one can use linearization (a useful tool!) to approximate the ODE. This gives a linear second-order differential equation for the Van der Pol oscillator, x(t)x(t)+x(t)=0 Again convert this to a system of two ODEs using y=x(t) and create two functions dxdt and dydt representing x(t) and y(t) respectively. To check your work, plug in (x,y)=(2,3), save the result of x to the variable A11 and y to the variable A12Step 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