Question: 3 . 2 . 2 Implementation and Assessment: Recursion Relations A program implementing recurrence relations is most easily written using subscripts. If you need to

3.2.2 Implementation and Assessment: Recursion Relations
A program implementing recurrence relations is most easily written using subscripts. If you need to polish up on your skills with subscripts, you may want to study our program Bessel. py in Listing. 3.1 before writing your own.
Write a program that uses both upward and downward recursion to calculate jl(x) for the first 25l values for x=0.1,1, and 10.
Tune your program so that at least one method gives "good" values (meaning a relative error 10-10. See Table 311 for some sample values.
Show the convergence and stability of your results.
Compare the upward and downward recursion methods, printing out Ll(up),jl(down), and the relative difference |)/(|jl(up)|+|jl(down)||.
The errors in computation depend on x, and for certain values of x, both up and down recursions give similar answers. Explain the reason for this.
Listing 3.I
Bessel.py determines spherical Bessel functions by downward recursion (you should modify this to also work by upward recursion).
Bessel.py
from visual import.
from visual.graph import
xmax=40.
xmin=0.25
step =0.1, # Global class variables
order =10; start =50,# Plot j_order
graph 1= gdisplay (width =500, height =500, title =' Sperical Bessel,???
L=1(red),10', xtitle =?'x', ytitle ='(x)',1
xmin=xmin,xmax=xmax,ymin=-0.2,ymax=0.5)
funct1= gcurve color = color, red
 3.2.2 Implementation and Assessment: Recursion Relations A program implementing recurrence relations

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!