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

  Write a recursive method nmbdigits

Design and implement meanIter, the iterative version of the method - Write a recursive method nmbDigits which takes an integer value as parameter and returns the number of digits of the parameter value

  Program to compute perimeter and area of rectangle

Write a program that asks for length L and the width W of a rectangle, then compute perimeter and area of the rectangle.

  Write program to prompt for and accept current salary

Write a program that will prompt for and accept the current salary for each of the faculty members, then calculate and display their individual pay increases.

  Write the code required to analyse and display

Engineer for a materials manufacturing research lab and have been asked to provide an automated solution to analyse data.

  Write stored function that takes in zipcode as parameters

Write a stored function called zip_exist that takes in a zipcode.zip%Type parameter and returns a Boolean. The function will return TRUE if the zipcode passed into it exists.

  Program to display words in a list box sorted by number

Write a program to display the words in a list box sorted by the number of different vowels(a,e,i,o,u) in the word.

  Write pseudocode to show positive and negative numbers

Write down pseudocode which will accept 25 integers and show the number of positive and negative numbers. Mention whether pseudocode utilizes a finite or indefinite loop.

  Sequence of statements to find first comma in string line

Write a sequence of statements that finds first comma in String line , and assigns to variable clause portion of line up to, but not including the comma.

  Write specifications for method of pre- and post-conditions

Write down specifications for method which advances any given date by one day. Write down statement of purpose, pre- and post-conditions, and description of parameters.

  Design a benefits election system

Individual project for this course is in form of Service Request from Huffman Trucking. It is essential for student to access Service Request: SR-ht-001. Design a Benefits Election System.

  Create project to compute checking account balance

Create a project to compute your checking account balance. Form: Include radio buttons to indicate the type of transaction: deposit, check, or service charge.

  Create application program to declare two circles

Create an application program that declares two circles set radius of one manually but allow the other to use default value supplied by constructor then display each circles values.

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