Question: Write a program that implements the secant method for root finding. Your program is a variant of the Newton-Raphson method, so you should be able

Write a program that implements the secant method for root finding. Your program is a variant of the Newton-Raphson method, so you should be able to modify the Chapter 6_11 code from Etter & Ingber.

Here is the code to modify:

/*----------------------------------------------------*/ /* Program chapter6_9 */ /* */ /* This program estimates the real roots of a */ /* polynomial function using incremental search. */ #include //Required for cin, cout #include //Required for cell() using namespace std; // Function Prototypes void check_roots(double left, double right, double a0, double a1, double a2, double a3); double poly(double x, double a0, double a1, double a2, double a3); int main() { // Declare objects and function prototypes. int n; double a0, a1, a2, a3, a, b, step, left, right; // Get user input. cout > a0 >> a1 >> a2 >> a3; cout > a >> b; cout > step; //Check subintervals for roots. n = ceil((b - a)/step); for (int k=0; k

Use your programs for the following physics problem:

Modern Physics: The black body radiation curve has a peak that can be determined by maximizing the Planck radiation formula in frequency form with respect to frequency. The Planck radiation formula is:

Write a program that implements the secant method for root finding. Your

If we take the derivative of the equation above and set it equal to zero and then substitute x = (hn/kT) we get an expression that reduces to:

program is a variant of the Newton-Raphson method, so you should be

Solve for the roots of this equation to determine the constant for Wiens law. Use the bisection method and the Newton Raphson method. You will need to replace the function in each program with equation 1 above.

From your value of x determine the constant in Wiens law:

able to modify the Chapter 6_11 code from Etter & Ingber. Here

Add a few lines of code to each program to (a) calculate the value of the constant and (b) compare your results to the standard constant (i.e. take a % error) from a your textbook.

I (v, T) 8 pi ka T 3 c -1) e AT

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!