Answer to Question #156311 in Quantitative Methods for Nana

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'=cosx"

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


Compute function values:

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

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

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

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

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


Forward difference "O(h)"

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

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

Error is:

"\\varepsilon_t=|\\frac{True Value-ApproxValue}{True Value}|\\cdot100"

"\\varepsilon_t=|\\frac{0.7071067-0.6070247}{0.7071067}|\\cdot100=14.15\\%"


Forward difference "O(h^2)"

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

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

"\\varepsilon_t=\\frac{|0.7071067-4.4093061|}{0.7071067}\\cdot100=523.57\\%"


Backward difference "O(h)"

"y'(x_{i})=\\frac{y(x_{i})-y(x_{i-1})}{h}"

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

"\\varepsilon_t=\\frac{|0.7071067-0.7910893|}{0.7071067}\\cdot100=11.88\\%"


Backward difference "O(h^2)"

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

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

"\\varepsilon_t=\\frac{|0.7071067-0.7260122|}{0.7071067}\\cdot100=2.67\\%"


Central difference "O(h^2)"

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

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

"\\varepsilon_t=\\frac{|0.7071067-0.6990570|}{0.7071067}\\cdot100=1.14\\%"


Central difference "O(h^4)"

"y'(x_i)=\\frac{-y(x_{i+2})+8y(x_{i+1})-8y(x_{i-1})+y(x_{i-2})}{12h}"

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

"\\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!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS