0
0
SciPydata~10 mins

Bessel functions in SciPy - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to import the Bessel function jv from scipy.special.

SciPy
from scipy.special import [1]

result = jv(0, 1.0)
print(result)
Drag options to blanks, or click blank then click option'
Ayv
Bjn
Civ
Djv
Attempts:
3 left
💡 Hint
Common Mistakes
Importing the wrong Bessel function like jn or yv.
Forgetting to import from scipy.special.
2fill in blank
medium

Complete the code to compute the Bessel function of order 1 at x=2.5.

SciPy
from scipy.special import jv

value = jv([1], 2.5)
print(value)
Drag options to blanks, or click blank then click option'
A2
B-1
C1
D0
Attempts:
3 left
💡 Hint
Common Mistakes
Using 0 instead of 1 for the order.
Confusing the order with the value of x.
3fill in blank
hard

Fix the error in the code to compute the modified Bessel function of the first kind I_0 at x=3.0.

SciPy
from scipy.special import iv

result = iv([1], 3.0)
print(result)
Drag options to blanks, or click blank then click option'
A0
B1
C-1
D2
Attempts:
3 left
💡 Hint
Common Mistakes
Using order 1 instead of 0.
Confusing the function iv with jv.
4fill in blank
hard

Fill both blanks to create a dictionary of Bessel function values for orders 0 to 2 at x=1.5.

SciPy
from scipy.special import jv

values = {n: jv([1], 1.5) for n in range([2])}
print(values)
Drag options to blanks, or click blank then click option'
An
B3
C2
D1
Attempts:
3 left
💡 Hint
Common Mistakes
Using a fixed order instead of the loop variable.
Using range(2) which excludes order 2.
5fill in blank
hard

Fill all three blanks to create a list of modified Bessel function values I_n(x) for n=0 to 4 at x=2.0.

SciPy
from scipy.special import iv

values = [iv([1], [2]) for [3] in range(5)]
print(values)
Drag options to blanks, or click blank then click option'
An
B2.0
Dx
Attempts:
3 left
💡 Hint
Common Mistakes
Using a wrong variable name for the loop.
Using the wrong x value.