Write a program to find all real roots

Assignment Help Programming Languages
Reference no: EM13192837

Roots of Polynomial

Write a program to find all real roots of a given polynomial f. Starting with 0.0, use step size of 0.25 to find a and b such that sign(f(a)) <> sign(f(b)). Run the false position method for 3 iterations, then change to the Newton's method, using the middle point of a and b as the starting point, until |f(Xn)| |Xn - Xn-1|/|Xn-1|

Divide out Xn, using the synthetic division, and repeat the process until the degree of polynomial is reduced to 2. Use the quadratic equation to find the last two roots.

Print out all roots and number of iterations in Newton's method.

input file name: Root.dat
input file format:

LINE 1: N 1 intger, the degree of polynomial

LINE 2: An An-1 An-2 ........A1 A0n+1 floats separated by one space, coefficients of polynomial

Output: (to terminal)

all real roots in scientific notation.

number of iterations in Newton's method.

Reference no: EM13192837

Questions Cloud

Compute the change in enthalpy of reaction for two moles : Calculate the change in enthalpy of reaction for two moles of CO(g) reacting with one mole of O2 (g) to form CO2(g). The molar heats of formation for each of these gases are CO -110.5 KJ/mol,
State shift reaction is important in hydrogen gas production : The water-gas shift reaction is important in hydrogen gas production. The balanced reaction shown below has a Kp of 9.48 at 700K. If 1.5 atm of H20 are placed in a container and heated to 700K, how much hydrogen gas
State what percentage of a serving of this sandwich : What percentage of a serving of this sandwich did Michael burn during his winning time of 1 minute 54 seconds in the 200-meter individual medley relay race?
Compute the partial pressure in atmospheres : Calculate the partial pressure in atmospheres of O2 in the air outside an airplane cruising at an altitude of 10km where the atmospheric pressure is 190.0 mmHg.
Write a program to find all real roots : Write a program to find all real roots of a given polynomial f. Starting with 0.0, use step size of 0.25 to find a and b such that sign(f(a)) sign(f(b)).
State glass bulb containing an unknown amount : Suppose you have a 250 mL glass bulb containing an unknown amount of PCl3 gas. If the bulb contains 1.5 atm of PCl3 at 25C
State the rate at which a metal alloy oxidizes in an oxygen : The rate at which a metal alloy oxidizes in an oxygen containing atmoshphere is a type of the Arrhenius equation (rate(k)=Ce^(-Q/RT)). For example, the rate og oxidation of a magnesium alloy is represented by a rate constant k.
Compute the total heat capacity of calorimeter : The temperature of the calorimeter increases from 19.7C to 20.6C. If under constant volme conditions the heat of combustion of glucose is -2805 kj/mol, calculate the total heat capacity of calorimeter.
State the high resolution mass of a compound : The high resolution mass of a compound was measured to be 187.0878, Determine a likely molecular formula for this compound and explain how you arrived

Reviews

Write a Review

Programming Languages Questions & Answers

  Program-dynamically check store-s inventory-central office

You are the outside consultant to large chain of grocery stores. Store's management would like to dynamically check store's inventory from central office.

  Write methods for calculating maximum value of array

Write down the methods for calculating maximum value, minimum value, and mean value of array. Use these methods to calculate and display minimum of array.

  Program to create three identical list

Write a program to create three identical list, list1, list2, and list3, of 5000 elements. The program then sorts list1using quick sort, list 2 using insertion sort.

  Design and develop a unix file sharing system

Design and develop a UNIX file sharing system. For this task you will be required to develop a simple application in C programming language.

  Program to output circle-s radius-diameter-circumference

Write a program to prompt the user to enter center and a point on circle. Program must then output circle's radius, diameter, circumference, and area.

  Find the maximum and minimum of a list of numbers

Write a prolog program to find the maximum and minimum of a list of numbers.

  Program using ten radio buttons to show five states

It is program using 10 Radio Buttons to show 5 States and 5 Capitals to user's interface. Also, there is text box to print "Correct" and "Incorrect" when Sate and the Capital is a correct match.

  Assembly language instructions into machine code

The assembly instructions are stored in a file. Each line of the file stores exactly oneinstruction. The name of the file should be provided to the program as a command line argument.

  Write down a program to input widths of both hallways

Write down a program which prompts user to input widths of both hallways. The program then outputs length of longest pipe.

  Write class to represent temperatures in degree-fahrenheit

Write Temperature class to represent temperatures in degrees in Celsius, Fahrenheit and Kelvin. Use floating-point number for temperature and a character (type char) for scale.

  Create algorithm and flowchart for amount to be doubled

Create the algorithm and the corresponding flowchart which print out after how many years will this amount be doubled.

  Design and write a payroll program

Design and write a payroll program that will prompt the user to enter an employee's hourly pay rate and the number of hours worked.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd