Newton Raphson Method on Fortran90

Click For Summary

Discussion Overview

The discussion revolves around implementing the Newton-Raphson method in Fortran90 to compare its effectiveness with the bisection method for solving the equation x3−2x−2 = 0, which has a single root between x=−4 and x=2. Participants are seeking guidance on iteration processes within the method.

Discussion Character

  • Technical explanation, Homework-related

Main Points Raised

  • One participant outlines the task of comparing the bisection method and Newton's method for a specific equation and expresses uncertainty about how to perform iterations.
  • A code snippet for the Newton-Raphson method is provided, demonstrating the iteration process and error calculation.
  • Another participant confirms that the provided code represents the iteration process and encourages running it to verify the solution.

Areas of Agreement / Disagreement

Participants appear to agree that the provided code implements the iteration process, but there is no explicit consensus on the overall effectiveness of the methods being compared.

Contextual Notes

The discussion does not address potential limitations or assumptions related to the convergence of the Newton-Raphson method or the specific characteristics of the equation being solved.

Who May Find This Useful

Individuals interested in numerical methods, particularly those learning about root-finding algorithms and their implementation in programming languages like Fortran90.

jhosamelly
Messages
125
Reaction score
0
Here's what I need to do:

"Compare the effectiveness of the bisection method and Newton’s method for the
equation x^3−2x−2 = 0 which has a single root between x=−4 and x = 2."So far I've done
jsyq0z.jpg

ok. this is working but of course I need to do iteration which I don't know how. Can someone teach me please? I'm trying the Newton-Raphson Method first.

Thanks for the help in advance.EDITED: Sorry, I posted the wrong pic earlier. Here's the correct one.
 
Last edited:
Technology news on Phys.org
Code:
program nr
real:: x, xnew, err

write(*,*) "starting x?:"
read(*,*) x

do
    xnew = x - ( (x**3 - (2*x) - 2) / ( ( 3*(x**2) )-2) )
    err = 100*abs( (xnew-x)/x )
    x = xnew
    write(*,*) "x = ", xnew, "  error = ", err
    if (err < 0.000001) exit
end do

end program nr
 
thanks :))) Is that the iteration already?
 
Yes.

Isn't it? Run it and verify the solution
 

Similar threads

  • · Replies 16 ·
Replies
16
Views
5K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 16 ·
Replies
16
Views
3K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 3 ·
Replies
3
Views
5K