CE 311K Lab8

# CE 311K Lab8 - Lab 8 Bracketing and Open methods for root...

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

Sheet1 Page 1 ! Lab 8. Bracketing and Open methods for root calculation ! CE311K Introduction to Computer Methods ! Spring 2008 ! Program Lab8 implicit none ! Declaration of variables Double precision A1,A2,K1,K2 Double precision root,pres,min_error integer iter,max_iter A1=1.5 A2=1.5 K1=1.2e-6 K2=5e-6 Open (unit=6, file='output.txt', status='unknown') O Call bisection(A1, A2, K1, K2, max_iter, pres, root) Call n_Rhapson(A1, A2, K1, K2, max_iter, pres, root) End E !---------------------------------------------------------------------------------------- Subroutine bisection(A1, A2, K1, K2, max_iter, pres, root) !---------------------------------------------------------------------------------------- implicit none double precision A1,A2,K1,K2 double precision tl, tr,tmid,told,t,k double precision y, pres,root,ea integer iter, max_iter !Statement Function that calculates Function y(t)=-0.3-A1*exp(-t/K1)+A2*exp(-t/K2) !Set initial conditions for iterations, approximation error, and tmid iter=0

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.

## This note was uploaded on 07/17/2008 for the course CE 311K taught by Professor Liljestrand during the Spring '08 term at University of Texas.

### Page1 / 6

CE 311K Lab8 - Lab 8 Bracketing and Open methods for root...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online