Question: x array: func1: derivative: Use the x arrray and the derivative array calculated in this problem to find the x locations of the three extrema

x array: func1: derivative: Use the x arrray and the derivative arrayx array: calculated in this problem to find the x locations of the three

func1: extrema in the function funci . One possibility is to find the

derivative: array index pointing at the location where the sign of the derivative

Use the x arrray and the derivative array calculated in this problem to find the x locations of the three extrema in the function funci . One possibility is to find the array index pointing at the location where the sign of the derivative changes. Between the corresponding value pairs is the root. Interpolate linearly between these two points for an accurate determination of the x coordinate of the three extreme. Add the three values, round to two digits and enter into question deriv-roots. x = linspace(-2.5,1, 101) def func1(x): ''Functioni' f = sin(x**2)*((x**2)/(exp(-x/2))) return f def deriv(f,x,h): dfdx = (f(x+h) - f(x-h)) / (24h) return dfdx deriv1 = deriv(f,x,0.01) Use the x arrray and the derivative array calculated in this problem to find the x locations of the three extrema in the function funci . One possibility is to find the array index pointing at the location where the sign of the derivative changes. Between the corresponding value pairs is the root. Interpolate linearly between these two points for an accurate determination of the x coordinate of the three extreme. Add the three values, round to two digits and enter into question deriv-roots. x = linspace(-2.5,1, 101) def func1(x): ''Functioni' f = sin(x**2)*((x**2)/(exp(-x/2))) return f def deriv(f,x,h): dfdx = (f(x+h) - f(x-h)) / (24h) return dfdx deriv1 = deriv(f,x,0.01)

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!