Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Exercise 1 : Stencil operations & slicing f ( x ) = ( ( x ^ ( 2 ) + 4 x + 5 )

Exercise 1: Stencil operations & slicing f(x)=((x^(2)+4x+5)/(x+2e^(x)))^(2x) Hint: Remember the use of the lambda function. # YOUR CODE HERE raise NotImplementedError() b) Calculate the derivative of f(x) with the central difference formula (below), save result in the variable fprime . f^(')(x_(i))~~(f(x_(i+1))-f(x_(i-1)))/(2\Delta x) # YOUR CODE HERE raise NotImplementedError() We add to y a scaled noise as follows # RUN THIS CELL. DO NOT MODIFY. numpy. random. seed (42) numpy. random. rand (y*size)**2-1 fprime_noise = numpy.gradient (yn,0.001) c) Next step is to compute smoothed values of the noisy data (yn) by using the average of a point with its two nearby neighbors. Use slicing to compute the following, save your result in a variable called y_smooth . y_(smooth )=(y_(i-1)+y_(i)+y_(i+1))/(3) # YOUR CODE HERE raise NotImplementedError() d) Using an average of 5 points as follows: y_(smooth _(()5))=(y_(i-2)+y_(i-1)+y_(i)+y_(i+1)+y_(i+2))/(5) Save your result in a variable called y_smooth_5. # YOUR CODE HERE raise NotImplementedError()

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

Computer Aided Database Design

Authors: Antonio Albano, Valeria De Antonellis, A. Di Leva

1st Edition

0444877355, 978-0444877352

More Books

Students also viewed these Databases questions