Numerical Methods for Engineers

Published by McGraw-Hill Science/Engineering/Math
ISBN 10: 0073401064
ISBN 13: 978-0-07340-106-5

Chapter 2 - Programming and Software - Problems - Page 47: 2.5

Answer

Step 1: Start Step 2: Input value to be evaluated x and maximum order n Step 3: Set order (i) equal to one Step 4: Set accumulator for approximation (approx) to zero Step 5: Set accumulator for factorial product (fact) equal to one Step 6: Calculate true value of sin(x) Step 7: If order is greater than n then proceed to step 13 Otherwise, proceed to next step Step 8: Calculate the approximation with the formula approx = approx + (−1)i-1 x2i-1 factor Step 9: Determine the error %error= true−approx100% true Step 10: Increment the order by one Step 11: Determine the factorial for the next iteration factor = factor • (2 • i − 2) • (2 • i − 1) Step 12: Return to step 7 Step 13: End

Work Step by Step

Step 1: Start Step 2: Input value to be evaluated x and maximum order n Step 3: Set order (i) equal to one Step 4: Set accumulator for approximation (approx) to zero Step 5: Set accumulator for factorial product (fact) equal to one Step 6: Calculate true value of sin(x) Step 7: If order is greater than n then proceed to step 13 Otherwise, proceed to next step Step 8: Calculate the approximation with the formula approx = approx + (−1)i-1 x2i-1 factor Step 9: Determine the error %error= true−approx100% true Step 10: Increment the order by one Step 11: Determine the factorial for the next iteration factor = factor • (2 • i − 2) • (2 • i − 1) Step 12: Return to step 7 Step 13: End
Update this answer!

You can help us out by revising, improving and updating this answer.

Update this answer

After you claim an answer you’ll have 24 hours to send in a draft. An editor will review the submission and either publish your submission or provide feedback.