Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started