Question #156311

a.Calculate forward and backward difference approximations of 𝑂(ℎ) and 𝑂(ℎ2) and

central difference approximations 𝑂(ℎ2) and (𝑂(ℎ4) for the first derivative of 𝑦 =

sin 𝑥 at 𝑥 = 𝜋

4

and the step size is 𝜋

12

b.Estimate the percentage relative error, 𝜀𝑡 for each approximation. 


1
Expert's answer
2021-01-19T04:16:43-0500

Analytical solution:

y=cosxy'=cosx

y(π/4)=0.7071067y'(\pi/4)=0.7071067


Compute function values:

y(xi2)=sin(π42π12)=0.2588190y(x_{i-2})=sin(\frac{\pi}{4}-\frac{2\pi}{12})=0.2588190

y(xi1)=sin(π4π12)=0.5y(x_{i-1})=sin(\frac{\pi}{4}-\frac{\pi}{12})=0.5

y(xi)=sin(π4)=0.7071067y(x_{i})=sin(\frac{\pi}{4})=0.7071067

y(xi+1)=sin(π4+π12)=0.8660254y(x_{i+1})=sin(\frac{\pi}{4}+\frac{\pi}{12})=0.8660254

y(xi+2)=sin(π4+2π12)=0.9659258y(x_{i+2})=sin(\frac{\pi}{4}+\frac{2\pi}{12})=0.9659258


Forward difference O(h)O(h)

y(xi)=y(xi+1)y(xi)hy'(x_{i})=\frac{y(x_{i+1})-y(x_i)}{h}

y(π/4)=0.86602540.7071067π/12=0.6070247y'(\pi/4)=\frac{0.8660254-0.7071067}{\pi/12}=0.6070247

Error is:

εt=TrueValueApproxValueTrueValue100\varepsilon_t=|\frac{True Value-ApproxValue}{True Value}|\cdot100

εt=0.70710670.60702470.7071067100=14.15%\varepsilon_t=|\frac{0.7071067-0.6070247}{0.7071067}|\cdot100=14.15\%


Forward difference O(h2)O(h^2)

y(xi)=y(xi+2)+4y(xi+1)3y(xi)2hy'(x_{i})=\frac{y(x_{i+2})+4y(x_{i+1})-3y(x_i)}{2h}

y(π/4)=0.9659258+40.866025430.70710672π/12=4.4093061y'(\pi/4)=\frac{0.9659258+4\cdot0.8660254-3\cdot0.7071067}{2\pi/12}=4.4093061

εt=0.70710674.40930610.7071067100=523.57%\varepsilon_t=\frac{|0.7071067-4.4093061|}{0.7071067}\cdot100=523.57\%


Backward difference O(h)O(h)

y(xi)=y(xi)y(xi1)hy'(x_{i})=\frac{y(x_{i})-y(x_{i-1})}{h}

y(π/4)=0.70710670.5π/12=0.7910893y'(\pi/4)=\frac{0.7071067-0.5}{\pi/12}=0.7910893

εt=0.70710670.79108930.7071067100=11.88%\varepsilon_t=\frac{|0.7071067-0.7910893|}{0.7071067}\cdot100=11.88\%


Backward difference O(h2)O(h^2)

y(xi)=3y(xi)4y(xi1)+y(xi2)2hy'(x_{i})=\frac{3y(x_{i})-4y(x_{i-1})+y(x_{i-2})}{2h}

y(π/4)=30.707106740.5+0.25881902π/12=0.7260122y'(\pi/4)=\frac{3\cdot0.7071067-4\cdot0.5+0.2588190}{2\pi/12}=0.7260122

εt=0.70710670.72601220.7071067100=2.67%\varepsilon_t=\frac{|0.7071067-0.7260122|}{0.7071067}\cdot100=2.67\%


Central difference O(h2)O(h^2)

y(xi)=y(xi+1)y(xi1)2hy'(x_i)=\frac{y(x_{i+1})-y(x_{i-1})}{2h}

y(π/4)=0.86602540.52π/12=0.6990570y'(\pi/4)=\frac{0.8660254-0.5}{2\pi/12}=0.6990570

εt=0.70710670.69905700.7071067100=1.14%\varepsilon_t=\frac{|0.7071067-0.6990570|}{0.7071067}\cdot100=1.14\%


Central difference O(h4)O(h^4)

y(xi)=y(xi+2)+8y(xi+1)8y(xi1)+y(xi2)12hy'(x_i)=\frac{-y(x_{i+2})+8y(x_{i+1})-8y(x_{i-1})+y(x_{i-2})}{12h}

y(π/4)=0.9659258+80.866025480.5+0.258819012π/12=0.7069969y'(\pi/4)=\frac{-0.9659258+8\cdot0.8660254-8\cdot0.5+0.2588190}{12\pi/12}=0.7069969

εt=0.70710670.70699690.7071067100=0.02%\varepsilon_t=\frac{|0.7071067-0.7069969|}{0.7071067}\cdot100=0.02\%


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!
LATEST TUTORIALS
APPROVED BY CLIENTS