Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

. Finite difference formulas. Write a Matlab function that constructs finite difference formulas for a given stencil and derivative order. That is, given points x0,

. Finite difference formulas. Write a Matlab function that constructs finite difference formulas for a given stencil and derivative order. That is, given points x0, x1, . . . , xn and a positive integer d, your code should compute c0, c1, . . . , cn such that

f (d) (x) Xn i=0 cif(x + xi).

The function signature should be

function C = fdcoeff(X, d)

where X is a numeric array containing the (distinct) stencil points, d is the desired derivative order, and C is an array of stencil coefficients. For example, fdcoeff([-1, 0, 1], 1) should return [-0.5, 0, 0.5] (the 3-point midpoint formula). Note that the textbook does not give you a formula: you will have to research it. Hint: You will need to construct and solve a linear system. You are encouraged to follow the example at http://web.media.mit.edu/~crtaylor/calculator.html.

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

Data Management Databases And Organizations

Authors: Watson Watson

5th Edition

0471715360, 978-0471715368

More Books

Students also viewed these Databases questions

Question

2 What are the implications for logistics strategy?

Answered: 1 week ago