Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Programming Assignment 4 CSci 251, Spring 2017 Infinlto Series Trigonometric functions are usually calculated on computers using truncated infinite series. An infinite series is an

image text in transcribed
image text in transcribed
Programming Assignment 4 CSci 251, Spring 2017 Infinlto Series Trigonometric functions are usually calculated on computers using truncated infinite series. An infinite series is an infinite set of terms a sine particular function or expression. For example, the infinite series used to evaluate the of a number is sin(x) x 5! (2n-1) sin(x) (2n-1)! where x is in units of radians. Since a computer does not have enough memory (or time, obviously) to add an infinite s a finite number of for every sine that is calculated, infinite series the number of of terms, determined by a pre-defined precision. Nrepresents terms. program a MATLAB program that prompts for degrees, and then prompts for a precision. Determine the number of terms required to evaluate the sine for the given precision as compared to MATLAB's sin(x) (x in units of radians). For each iteration, output the current value of the series as shown in the Sample Output. ngs to Note 1. The MATLAB command for m is pi. The MATLAB command for sine in radians is sin(x) 2. The MATLAB command for factorial is factorial(x). 3. Convert degrees (deg) to radians using Matlab's deg2rad(dy function. 4. You are required to use a while loop to determine the calculated sine (infinite series) 5. When calculating the threshold value (actualSine seriesSine) in your while-loop condition, use the absolute value of the difference: abs(x) 6. Terms in the series alternate SIGN, All odd number terms are positive, and even number terms are negative, Keep track of which number term you are on to determine if you ADD or SUBTRACT. For example, is the fourth term in the sine series, thereforelt is SUBTRACTED from the current seriesSine. 7. The power and the subsequent factorial both increase by factors of 2 Keep track of lhe current power for each iteration of the while loop by adding 2 each time a

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Database Foundations Technology Fundamentals For IT Success

Authors: Bob Bryla

1st Edition

0782143725, 9780782143720

More Books

Students also viewed these Databases questions

Question

Do the previous problem with R-22 as the working fluid.

Answered: 1 week ago

Question

When would you use one approach, and when would you use another?

Answered: 1 week ago