Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In Python code Exercise B.3: Study a function and its derivative Consider the function f(x) = sin x + for x ranging from 0 to

In Python code

image text in transcribed

Exercise B.3: Study a function and its derivative Consider the function f(x) = sin x + for x ranging from 0 to 1, and the derivative f'(x) - x+8 cos (x + 8) Here, e is a given input parameter. a) Develop a program that creates a plot of the derivative of f = f(x) based on a finite difference approximation using n computational nodes. The program should also graph the exact derivative given by f' = f'(x) above. b) Test the program using n = 10 and = 1/5. c) How large do you have to choose n in order for the difference between these two functions to be less than 0.1? Hint Each function gives an array. Create a while loop and use the max function of the arrays to retrieve the maximum value and compare these. d) Let e = 1/10 and recalculate. Exercise B.3: Study a function and its derivative Consider the function f(x) = sin x + for x ranging from 0 to 1, and the derivative f'(x) - x+8 cos (x + 8) Here, e is a given input parameter. a) Develop a program that creates a plot of the derivative of f = f(x) based on a finite difference approximation using n computational nodes. The program should also graph the exact derivative given by f' = f'(x) above. b) Test the program using n = 10 and = 1/5. c) How large do you have to choose n in order for the difference between these two functions to be less than 0.1? Hint Each function gives an array. Create a while loop and use the max function of the arrays to retrieve the maximum value and compare these. d) Let e = 1/10 and recalculate

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

SQL Database Programming

Authors: Chris Fehily

1st Edition

1937842312, 978-1937842314

More Books

Students also viewed these Databases questions

Question

=+7. Elaborate a SWOT analysis section of a strategic plan.

Answered: 1 week ago

Question

6 Identify the MO pictured below. How is this MO transmitted

Answered: 1 week ago