Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fortran Assignment, in need of help please!!

Status
Not open for further replies.

qwerty9143

Technical User
Oct 8, 2014
4
US

The Newton method is used to determine the value of x that makes |f(x)| < t0≈0. The value of x is determined from the following formula, where x0 is the initial guess:
xn+1 = xn - (f(xn)/f'(xn)) n=0,1,2,...

In this equation, the prime denotes the derivative with respect to x.The value of n is a function of the tolerance, which is a very small value, and the choice of x0. Write a FORTRAN script that obtains the value of x when
f(x)=cos(x) + sin(x)
f'(x)= -sin(x) + cos(x)

and when x0=1.5 and t0<10-8. Have the output of the program displayed to the Console the various quantities as shown below.

At x = 2.35619450,f(x)= 6.0407994966881623E-009 after 4 iterations

 
What have you done so far and what are you stuck at?
 
Honestly, I have not started this one. I really do not know how to implement what was given and such. I do understand that a do while loop is required such as:

do while (abs(x)<0) ... something like that.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top