ENGN 38

Lab Programming Assignment #6

 

 

You are to solve two simultaneous equations using the Newton-Raphson Method.

Three problem options are listed below. 

The option you are to use is determined by X, where

    X = (Your Student Class Number)  %  3

 

Instructions:

  1. Determine the solution equation for your problem option. 
                                 

  2. Write C++ code using the Newton-Raphson method of equation solution to solve your equation.
    (A code template for equation solution using the Newton-Raphson method can be found in the course notes.) 
                             

  3. Your output should display columns showing each iteration of the process.
    The column headings should include the current value of x, f(x), f'(x), the error and the next better guess.
                         

  4. Display the final correct solution with appropriate message.
                                             

  5. Construct a graph of the two equations and the solution equation.
    Graphically show the progress of your algorithm for at least two iterations of the process.
    Use appropriate software such as Microsoft Excel to do this. 
             

  6. Print out your graph, the source code and program output making sure that the formatting is up to C++ standards and professional in appearance.  If this does not fit on one page, delete enough so that it does. (Please do not make font size less than 10 points.) What to delete? What to keep? Make sure that you at least have the header as shown in Lab#1 (your student number, your name, the class identifier, the lab number) and the output from your program. As space permits, include any other essentials as you deem appropriate. Make sure that everything is clearly labeled and easy to read and follow. Have this one page ready to turn in by the due date. 


       
             

 

Problem Options:

                         

               X                     Two Simultaneous Equations


               0                      f1(x)  = x2 + 3x -10

                                       f2(x)  = 2/3x -1

 


               1                      f1(x)  =  - x2  -3x  +  10

                                       f2(x)  =  -1/2 x  + 1

 


               2                     f1(x)  =  x2  +  7x  +  10

                                      f2(x)  =  1/3 x  + 5