Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please write a persudo code explaing the code steps Problem 5 The first derivative 2) of a function f(x) at a point x-o can be

image text in transcribed

please write a persudo code explaing the code steps

Problem 5 The first derivative 2) of a function f(x) at a point x-o can be approximated with the two-point central difference formula: dx 2h where h is a small number relative to r 0 Here is a user-defined function that calculates the derivative of a math function by using the two-point central difference formula. function dfdx2pt twoptderi (myfunc, x0,h) % dfax2pt approximates the derivative using % the two-point central difference formula % x0 is the point where the derivative is calculated % h is a number relative to XO dfdx2pt-(myfunc (x0+h)-myfunc (x0-h)/(2*h) end (a) Create the above function (please retype) (b) Use the user-defined function twoptderi (myfunc,x0,h) to calculate the following (i) the derivative of f(x)-13 at 20-0.6 and h = ii) the derivative of f(z) = 2.32x at 2.0-2.5 and h 100 100 In both cases compare the answer obtained from twoptderi with the analytical solu- tion Here is the matlab script file that you should modify clc; clear; close al1; format long % you may want to read about the 'format, myfunc -0(x) (x^3); % define the function x0-0.6; hx0/100; dfdx2pt = twoptderi (myfunc , x0 , h)

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

Transactions On Large Scale Data And Knowledge Centered Systems Xxiv Special Issue On Database And Expert Systems Applications Lncs 9510

Authors: Abdelkader Hameurlain ,Josef Kung ,Roland Wagner ,Hendrik Decker ,Lenka Lhotska ,Sebastian Link

1st Edition

366249213X, 978-3662492130

Students also viewed these Databases questions

Question

socialist egalitarianism which resulted in wage levelling;

Answered: 1 week ago

Question

soyuznye (all-Union, controlling enterprises directly from Moscow);

Answered: 1 week ago