Question: 1. Write a python function named f, which computes the value of f(x) 1 7 (x-x0) +7, f'(x) = lim h-0 wherex and y

 1. Write a python function named f, which computes the value of  

1. Write a python function named f, which computes the value of f(x) 1 7 (x-x0) +7, f'(x) = lim h-0 wherex and y are non-negative real numbers. Make sure that x= 0 and y = 1 are the default values for your function. 2. Recalling that the numerical derivative can be defined as f(x+h)-f(x-h) 2h write a python function named derivative, which compute the derivative of any function. 3. Use the above defined functions f and turev for the following. Assume x = 1/7 and y = 0.5. Use numpy to create a mesh for x in [-2,2] with 41, 401, 4001, 40001 points and compute the derivative of fat x = 0. Analyse the mesh dependence of your numerical derivative by generating a table. Also, compare them with the analytical calculation. (The analytical calculation is expected to be done by hand).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

1 Here is the Python function f that computes the given expression with default values for ... View full answer

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 Programming Questions!