Engineering
Engineering, 21.02.2020 20:45, deniseelyons15

Problem 2: Polynomial Root Calculation Problem Description:

Engineers often need to calculate the roots to a given polynomial. For low order polynomials these computations can be done by hand. For higher order polynomials these calculations can be cumbersome, if not impossible, without a computer. One method of finding real roots of a polynomial is the Newton-Raphson algorithm.

In this homework we will write a program that uses the Newton-Raphson method for calculating the roots of a polynomial. Although our program will not be able to solve for complex roots, it will be able to calculate real roots; maybe later we will upgrade the routine to include complex roots. Since it is possible that the polynomial roots are all complex, i. e. no real roots at all, or it may be that the Newton-Raphson routine fails to converge.

(a) Newton-Raphson Algorithm:

Write a C program that prompts the user to input a set of 5th-order polynomial coefficients, of the form c5; c4; c3; c2; c1; c0. Also, the user will need to submit an initial value of x which serves as the starting condition of the Newton-Raphson algorithm.

The 5th-order polynomial has the form
y = c5 x5 + c4 x 4 + c3 x 3 + c2 x 2 + c1 x + c0

We know that the first derivative of y with respect to x is
5 c5 x 4 + 4 c4 x 3 + 3 c3 x 2 + 2 c2 x + c1

We can use this information to find the roots of the polynomial. The basic idea, in the Newton-Raphson method, is as follows:

(a) Given an initial guess (or the updated value) x, and polynomial coefficients c,

calculate y
(b) Check to see if y is close enough to zero, i. e. within some small tolerance close to zero.

(i) If so then terminate. Algorithm has converged! (ii) If not then continue

(c) Use the current value of x to calculate

(d) Create a new guess for x using the update formulate x = x

answer
Answers: 1

Other questions on the subject: Engineering

image
Engineering, 04.07.2019 03:10, lauriepdx17
What precautions should you take to prevent injuries when dealing with heavy loads?
Answers: 1
image
Engineering, 04.07.2019 18:10, johnthienann58
Thermal stresses are developed in a metal when its a) initial temperature is changed b) final temperature is changed c) density is changed d) thermal deformation is prevented e) expansion is prevented f) contraction is prevented
Answers: 2
image
Engineering, 04.07.2019 18:10, ijohnh14
Shafts are machine elements that are used to a) carry axial loads b) direct shear loads c) transmit power d) rotate at constant speed e) none of the above circular and square shafts subjected to the same torque under the same circum behave a) the same way b) almost the same way
Answers: 2
image
Engineering, 04.07.2019 18:10, mamasbug4285
An air compression refrigeration system is to have an air pressure of 100 psia in the brine tank and an allowable air temperature increase of 60°f for standard vapor compression cycle temperatures of 77 f entering the expansion cylinder and 14 f entering the compression cylinder, calculate the coefficient of performance a. 2.5 b 3.3 c. 4.0 d. 5.0
Answers: 3
Do you know the correct answer?
Problem 2: Polynomial Root Calculation Problem Description:

Engineers often need to calc...

Questions in other subjects: