{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

lab8(1705Koffke)

# lab8(1705Koffke) - To Prof William C Koffke P.E From...

This preview shows pages 1–2. Sign up to view the full content.

) ( ' ) ( 1 i i i i X f X f X X - = + To: Prof. William C Koffke P.E. From:, Section #005 Date: 03-12-2008 Subject: Report for Lab 08 1.0 Objective The purpose of this lab is to create an M-Script and a “while” loop structure to use the Newton-Raphson iteration method find the roots of an equation. 2.1 Problem Definition Given: Equation: X e X X f - + - = 2 ) ( Newton-Raphson iteration method: Find: the single root of the equation 2.2 Outline of Matlab code In the Newton-Raphson Method, the program is doing the following procedure: ESTIMATE EQUATION ROOTS BY NEWTON-RAPHSON METHOD INTEGER COUNT REAL XGUESS, XNEW, XOLD C*** DOCUMENTATION OF VARIABLES APPEARS HERE OPEN(11,FILE='LAB06.OUT',STATUS='UNKNOWN') WRITE(11,*)'YOUR NAME' WRITE(11,*)'LAB 06 – YOUR SECTION' WRITE(11,*)'DATE' WRITE(11,*)'APPROXIMATION OF ROOTS' PRINT *, 'INITIAL GUESS (NONZERO)?' READ *, XGUESS WRITE(11,*)'INITIAL GUESS: ', XGUESS COUNT = 0 XNEW = XGUESS XOLD = 0.0 DO WHILE (ABS(XNEW-XOLD) .GE. 5.0E-6) COUNT = COUNT + 1 XOLD = XNEW XNEW = XOLD–(XOLD-EXP(-XOLD))/(1+EXP(-XOLD)) WRITE(11,*) 'NEXT ITERATION: ',XNEW END DO

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}