Question: Homework 1 0 : ODE Algorithms ( due by email before the lecture on Mon, April 2 2 ) Write your own rk 2 method.
Homework : ODE Algorithms
due by email before the lecture on Mon, April
Write your own rk method. Design your method for a general ODE; this means making the derivative function a separate method.
Use your solver in a program that solves the equation of motion a secondorder ODE for a charged particle moving in a variable external electric field within an anharmonic trapping potential given by:
where and ; assume and for simplicity and assume that the motion starts at with the particle velocity
Plot the position of the particle for the first seconds of motion to Find the turning points of the motion min and max of the position,
Solve the same equation using the rk and rk solvers use the code in the course textbook andor implementation in SciPy Plot the three solutions rk rk and rk in one figure and the relative error of rk vs rkor rk in another figure.
Time the three methods and report their execution times.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
