Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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_11 */ /* */ /* This program finds the real roots of a cubic polynomial */ /* using the Newton-Raphson method. */ #include //Required for cin, cout #include //Required for pow() using namespace std; int main() { // Declare objects. int iterations(0); double a0, a1, a2, a3, x, p, dp, tol; // Get user input. cout > a0 >> a1 >> a2 >> a3; cout > x; // Evaluate p at initial guess. p = a0*pow(x,3) + a1*x*x + a2*x + a3; // Determine tolerance. tol = fabs(p); while(tol > 0.001 && iterations

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

image text in transcribed

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

image text in transcribed

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:

image text in transcribed

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)

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_2

Step: 3

blur-text-image_3

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

Filing And Computer Database Projects

Authors: Jeffrey Stewart

2nd Edition

007822781X, 9780078227813

More Books

Students also viewed these Databases questions