Community Sites
Create your own community website and start earning today !
It's Free !
 
Communities Members BookmarksPolls Fresher Jobs Funny Pictures MCA Projects New Member FAQ  



My Profile
Active Members
TodayLast 7 Days more...



Awards & Gifts
Online Exams

Fresher Jobs


Our fresher job section is exclusively for fresh graduates! Find jobs for freshers in major Indian cities including Bangalore, Chennai, Hyderabad, Pune or Kochi

Resources


Find educational articles, blogs, discussion threads and other resources.

Colleges


Find details about any college in India or search for courses.

website counter




understanding interpolation using Fortran


Posted Date: 12 Mar 2008    Resource Type: Articles/Knowledge Sharing    Category: Computer & Technology

Posted By: ashish singh       Member Level: Diamond
Rating:     Points: 4



Interpolation


Interpolation is a technique to find the value of a dependent variable on the basis of a given set of data or both the variables. In other words on the basis of given set of date (xi,yi) for I=0,1,2,3 ………n, the tachnique to find y for any given value x is called interpolation or extrapolation. These two terms differ only in concept. If x0 A number of technique have been defined in Numerical Analysis for interpolation or extrapolation.


Fortran Program for Interpolation :


C PROGRAM FOR NEWTON FORMULA FOR INTERPOLATION
INTEGER N
REAL XP,FP,SUM,PI,X,F,A,D
DIMENSION X(10),F(10),A(10),D(10,10)
WRITE(*,*)'INPUT NUMBER OF DATA POINTS'
READ(*,*) N
WRITE(*,*)'INPUT VALUE OF X AND F(X) ONE SET ON EACH LINE'
DO 10 I=1,N
READ(*,*) X(I),F(I)
10 CONTINUE
C CONSTRUCT DIFFERENCE TABLE D
DO 20 I=1,N
D(I,1)=F(I)
20 CONTINUE
DO 40 J=2,N
DO 30 I=1,N-J+1
D(I,J)=(D(I+1,J-1)-D(I,J-1))/(X(I+J-1)-X(I))
30 CONTINUE
40 CONTINUE
C SET THE COEFFICIENT OF INTERPOLATING POLYNOMIAL
DO 50 J=1,N
A(J)=D(1,J)
50 CONTINUE

C COMPUTE INTERPOLATION VALUE
WRITE(*,*)'INPUT XP WHERE INTERPOLATION IS REQUIRED'
READ(*,*) XP
SUM=A(1)
DO 70 I=2,N
PI=1.0
DO 60 J=1,I-1
PI=PI*(XP-X(J))
60 CONTINUE
SUM=SUM+A(I)*PI
70 CONTINUE
FP=SUM

C WRITE RESULT
WRITE(*,*)
WRITE(*,*) 'NEWTON INTERPOLATION'
WRITE(*,*)
WRITE(*,*)'Interpolated Function Value'
WRITE(*,*) 'at X=',XP,'is',FP
WRITE(*,*)
STOP
END


OUTPUT:

INTERPOLATION
NEWTON FORMULA


D:\FORTRAN\BINB>NWTINT
INPUT NUMBER OF DATA POINTS
3
INPUT VALUE OF X AND F(X) ONE SET ON EACH LINE
2 1.4142
3 1.7321
4 2.0
INPUT XP WHERE INTERPOLATION IS REQUIRED
2.5

NEWTON INTERPOLATION

Interpolated Function Value
at X= 2.500000is 1.579400

Stop - Program terminated.




Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Solution of iterative method in Numerical Analysis using Fortran
Previous Resource: understanding Lagranges Interpolation in Numerical Analysis
Return to Discussion Resource Index
Post New Resource
Category: Computer & Technology


Post resources and earn money!
 
Related Resources

Watch TV Channels



Contact Us    Privacy Policy    Terms Of Use   

SpiderWorks Technologies Pvt Ltd. 2006 - 2007 All Rights Reserved.