Question

In: Advanced Math

solve using MATLAB. Title: Numerical differentiations. Use Richardson extrapolation to estimate the first derivative of y = cos x at x = π/4...

solve using MATLAB.
Title: Numerical differentiations.

Use Richardson extrapolation to estimate the first derivative of y = cos x at x = π/4 using step sizes of h1 = π/3 and h2 = π/6. Employ centered differences of O(h2) for the initial estimates.

solve using MATLAB.

Solutions

Expert Solution


%%Matlab code for Richardson Extrapolation
clear all
close all

%function for which differentiation have to do
f=@(x) cos(x) ;
x=pi/4;
h1=pi/3; h2=pi/6;

%differetiation using central difference
df1=(f(x+h1)-f(x-h1))/(2*h1);
df2=(f(x+h2)-f(x-h2))/(2*h2);

fprintf('\tExact differential at x=pi/4 is %f\n',-sin(x));

fprintf('\tCentral difference for h1=%f is %f\n',h1,df1)

fprintf('\tCentral difference for h2=%f is %f\n',h2,df2)

dff=df2+((df2-df1)/3);

fprintf('\tRichardson extrapolation at x=%f is %f\n',pi/4,dff)

%%%%%%%%%%%% End of Code %%%%%%%%%%%


Related Solutions

Use MATLAB to solve graphically the planar system of linear equations x +4 y = −4...
Use MATLAB to solve graphically the planar system of linear equations x +4 y = −4 4x +3 y =4 to an accuracy of two decimal points. Hint: The MATLAB command zoom on allows us to view the plot in a window whose axes are one-half those of original. Each time you click with the mouse on a point, the axes’ limits are halved and centered at the designated point. Coupling zoom on with grid on allows you to determine...
3. Consider the parametric curve x = sin 2t, y = − cos 2t for −π/4...
3. Consider the parametric curve x = sin 2t, y = − cos 2t for −π/4 ≤ t ≤ π/4. (a) (2 pts) Find the Cartesian form of the curve. (b) (3 pts) Sketch the curve. Label the starting point and ending point, and draw an arrow on the curve to indicate the direction of travel. (c) (5 pts) Find an equation for the curve’s tangent line at the point √2/2, −√2/2 .
Using matlab Find x and y that solve the following system: ln(x 2 + y) =...
Using matlab Find x and y that solve the following system: ln(x 2 + y) = 1 − y , xy = − √ x
Use Laplace transform to solve the initial value problem y''+y'= π with y(0) = π, y'(0)...
Use Laplace transform to solve the initial value problem y''+y'= π with y(0) = π, y'(0) = 0.
Solve the given initial-value problem. y'' + y = 0,    y(π/3) = 0,    y'(π/3) = 4
Solve the given initial-value problem. y'' + y = 0,    y(π/3) = 0,    y'(π/3) = 4
Solve the following system : z” + y ′ = cos x, y” − z =...
Solve the following system : z” + y ′ = cos x, y” − z = sin x, z(0) = −1, z′ (0) = −1, y(0) = 1, y′ (0) = 0.
Test bank 1)- What is x[n]? x(t) = 5 cos (25 π t + π /4)...
Test bank 1)- What is x[n]? x(t) = 5 cos (25 π t + π /4) with Fs = 10 samples/sec 2)- How are Ts and fs related? 3)- What is the definition of the z-transform? 4)- What the poles and zeros of this function?
Set-up surface area of y = cos 2x rotated about x-axis [0, π/4] and sketch the...
Set-up surface area of y = cos 2x rotated about x-axis [0, π/4] and sketch the surface
Solve this differential equation using Matlab yy' + xy2 =x , with y(0)=5 for x=0 to...
Solve this differential equation using Matlab yy' + xy2 =x , with y(0)=5 for x=0 to 2.5 with a step size 0.25 (a) Analytical (b) Euler (c) Heun d) 4th order R-K method Display all results on the same graph
Solve the initial value problem: 9y″+18y′+19y=0, y(π/2)=−2, y′(π/2)=−2. Give your answer as y=... . Use x...
Solve the initial value problem: 9y″+18y′+19y=0, y(π/2)=−2, y′(π/2)=−2. Give your answer as y=... . Use x as the independent variable.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT