Question: Computers, which can add/subtract, divide/multiply, and do powers, use techniques such as series or products to calculate special functions. Here we will calculate the

Computers, which can add/subtract, divide/multiply, and do powers, use techniques such as

 

Computers, which can add/subtract, divide/multiply, and do powers, use techniques such as series or products to calculate special functions. Here we will calculate the sine function via the series sin z=k=0 100 (-1)k2k+1 (2k+1)! 23 =Z- 3! 5! and the product series sin z = z [1 (+27)] = z [1 ( -9)] [1 ( ) ] [1 ()] ... A. Write a program that accepts a value z from the user (using the input command) and asks the user how many terms n in the Taylor series and in the product series the user wants (another input). Use a "for" loop to do these series. Have the program display sin z calculated via the Taylor series, and sin z calculated via the product series to 7 digits after the decimal point. Repeat this for the same z but a use a larger value of n (another input). B. Compare your sine values from A to a value calculated using Matlab's built in sine function, displayed to 7 digits after the decimal point. C. Now use a "while" loop to include terms in the respective series. Continue to add terms to the Taylor series and multiply more terms to the products until sin z from these methods is accurate to within 7 digits after the decimal point (compare to the Matlab result of B). Answer the following parts separately: a. how many terms are needed for 7 digits accuracy after the decimal point for the Taylor series,? b. how many terms are needed for 7 digits accuracy after the decimal point for the product series?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!