Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

code in pytorch Use torch and matplotlib for the following 1. A second order forward approximation to the derivative is f(x + 2h) - 4f(x+h)

code in pytorch image text in transcribed
Use torch and matplotlib for the following 1. A second order forward approximation to the derivative is f(x + 2h) - 4f(x+h) + 3f (r) $' (r) = +O(12) 2h (a) Given a function sampled at f = [f(x0), f(x1),..., f(In-1)] write a function that approxi- mates the derivatives at points (-0,21,..., In-3) and uses this approximation. (b) Design and execute testing that show that the code works as the theory predicts. 2. In this question you will derive an approximation for the second derivative pf 5. L) (a) Write the Taylor's expansion for f(x + h) around f using the first 4 terms f(a+h) = f(x) + ... (b) Write the Taylor's expansion for f(x-h) around / using the first 4 terms f(x+h) = f(x) - ... (c) Add the equations (d) Isolate S"() (e) What is the order of the approximation? Use torch and matplotlib for the following 1. A second order forward approximation to the derivative is f(x + 2h) - 4f(x+h) + 3f (r) $' (r) = +O(12) 2h (a) Given a function sampled at f = [f(x0), f(x1),..., f(In-1)] write a function that approxi- mates the derivatives at points (-0,21,..., In-3) and uses this approximation. (b) Design and execute testing that show that the code works as the theory predicts. 2. In this question you will derive an approximation for the second derivative pf 5. L) (a) Write the Taylor's expansion for f(x + h) around f using the first 4 terms f(a+h) = f(x) + ... (b) Write the Taylor's expansion for f(x-h) around / using the first 4 terms f(x+h) = f(x) - ... (c) Add the equations (d) Isolate S"() (e) What is the order of the approximation

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

Database Horse Betting The Road To Absolute Horse Racing 2

Authors: NAKAGAWA,YUKIO

1st Edition

B0CFZN219G, 979-8856410593

Students also viewed these Databases questions

Question

3. Would you say that effective teamwork saved their lives?

Answered: 1 week ago