Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please complete the equation using python Consider the equation that defines the Bessel function Jolt) y(t) ==y0) - YO y(0) = 1, y (0) =

please complete the equation using python

image text in transcribed

Consider the equation that defines the Bessel function Jolt) y"(t) ==y0) - YO y(0) = 1, y (0) = 0. a) Integrate the equation using the fourth-order Runge--Kutta method from t = 0 to t = 10 using a rather small step h = 0.005. You see the singular coefficient 1/t before the first derivative. Add 1.e-15 to the denominator for the program to work. Plot the solutions for y(t) and yo). You now see that the Bessel function Jo is a special function that passes through zero from time to time oscillating between the negative minima and positive maxima. Your next task is to determine the first two roots by combining the RK4 (or 'odeint") function and the two root-finding methods, bisection and Newton's. An important issue with the RK4 program used in the lectures is that it computes the values up to the moment tf - h inclusive, with h being the step. This is often enough for the plotting and visualization, but here in order to get the value at tf one needs to call RK4(f, ti, tf+h, h, yinit) and extract the last elements of the returned arrays. b) Determine the values of the first two zeros of Jot) you see on the plot using bisection method. In the RK4 (or 'odeint') program, use a very small step h = 0.0005. For the accuracy in the bisection method put eps = 1.e-6, not smaller. Smaller eps increases the time of calculations but does not make the numbers obtained closer to the much more precise values obtained from different approaches of scipy.special package (see part c)). c) Use the function jn_zeros from scipy.special module (i) to output the highly accurate values of the first two zeros and (i) to print the accuracies of your computed roots (with respect to the ones given by jn_zeros ). d) Repeat parts b) and c) using the Newton's method. If you use the function 'Newton' from the lectures, modify it so that the Bessel function and its derivative are not calculated twice by doing integration from 0 to the point of interest in the ODE solver. In this method, use eps = 1.e-4, not smaller. This is because trying to meet the necessary accuracy, values upon each iteration oscillate around the correct point amounting to a slower convergence. You should notice that finding the roots using this method is much more time consuming but leads to the results noticeably closer to the actual ones compared to the binary search. Consider the equation that defines the Bessel function Jolt) y"(t) ==y0) - YO y(0) = 1, y (0) = 0. a) Integrate the equation using the fourth-order Runge--Kutta method from t = 0 to t = 10 using a rather small step h = 0.005. You see the singular coefficient 1/t before the first derivative. Add 1.e-15 to the denominator for the program to work. Plot the solutions for y(t) and yo). You now see that the Bessel function Jo is a special function that passes through zero from time to time oscillating between the negative minima and positive maxima. Your next task is to determine the first two roots by combining the RK4 (or 'odeint") function and the two root-finding methods, bisection and Newton's. An important issue with the RK4 program used in the lectures is that it computes the values up to the moment tf - h inclusive, with h being the step. This is often enough for the plotting and visualization, but here in order to get the value at tf one needs to call RK4(f, ti, tf+h, h, yinit) and extract the last elements of the returned arrays. b) Determine the values of the first two zeros of Jot) you see on the plot using bisection method. In the RK4 (or 'odeint') program, use a very small step h = 0.0005. For the accuracy in the bisection method put eps = 1.e-6, not smaller. Smaller eps increases the time of calculations but does not make the numbers obtained closer to the much more precise values obtained from different approaches of scipy.special package (see part c)). c) Use the function jn_zeros from scipy.special module (i) to output the highly accurate values of the first two zeros and (i) to print the accuracies of your computed roots (with respect to the ones given by jn_zeros ). d) Repeat parts b) and c) using the Newton's method. If you use the function 'Newton' from the lectures, modify it so that the Bessel function and its derivative are not calculated twice by doing integration from 0 to the point of interest in the ODE solver. In this method, use eps = 1.e-4, not smaller. This is because trying to meet the necessary accuracy, values upon each iteration oscillate around the correct point amounting to a slower convergence. You should notice that finding the roots using this method is much more time consuming but leads to the results noticeably closer to the actual ones compared to the binary search

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Analysis Using SQL And Excel

Authors: Gordon S Linoff

2nd Edition

111902143X, 9781119021438

More Books

Students also viewed these Databases questions