Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started