Question: Problem 2: (30 points) Computers, which can add/subtract, divide/multiply, and do powers, use techniques such as series or products to calculate special functions. Here we

Problem 2: (30 points) 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 serie:s sin z2k-0 (2k+1)! handtheprodua cuenes henzem.T- (-1)kz2k+1 12z-22-... and the product series sinz-z II 2 kit 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 Taylo:r series, b. how many terms are needed for 7 digits accuracy after the decimal point for the product series Problem 2: (30 points) 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 serie:s sin z2k-0 (2k+1)! handtheprodua cuenes henzem.T- (-1)kz2k+1 12z-22-... and the product series sinz-z II 2 kit 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 Taylo:r 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
Get step-by-step solutions from verified subject matter experts
