FISH.

Click Here for Free Traffic!




Warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/virtwww/w_beloshenko-org-ua_e2c5fc46/http/topp.php on line 8

Warning: include(http://www.beloshenko.org.ua/panel.html) [function.include]: failed to open stream: no suitable wrapper could be found in /home/virtwww/w_beloshenko-org-ua_e2c5fc46/http/topp.php on line 8

Warning: include() [function.include]: Failed opening 'http://www.beloshenko.org.ua/panel.html' for inclusion (include_path='.:') in /home/virtwww/w_beloshenko-org-ua_e2c5fc46/http/topp.php on line 8







Lagrange interpolation.
Beloshenko + 2007
---------------------------------------------------------------------------------
Program source. (FORTRAN)
Lagr.for
---------------------------------------------------------------------------------
 
     program InterpLagrang
     real x(100),y(100),x1(100)
     real p,x_,L_
     integer i,j,k,N,M
     open(unit=1,file='lagr.dat',status='old')
     open(unit=2,file='lagr.res',status='new')
     read(1,*)N
     if(N.GE.100) goto 1
     read(1,*)(x(i),i=1,N)
     read(1,*)(y(i),i=1,N)
     read(1,*)M
     if(M.GE.100) goto 1
     read(1,*)(x1(i),i=1,M)
     write(2,*)M
     write(2,*)
     do 2 i=1,M
         x_=x1(i)
         L_=0
         do 3 j=1,N
              p=1
              do 4 k=1,j-1
                  p=p*(x_-x(k))/(x(j)-x(k))
4            continue
              do 5 k=j+1,N
                  p=p*(x_-x(k))/(x(j)-x(k))
5            continue
              L_=L_+y(j)*p
3       continue
         write(2,*)L_
2   continue
1   close(2)
     close(1)
     stop
     end

---------------------------------------------------------------------------------
Lagr.dat
---------------------------------------------------------------------------------

4
1 3 5 7
1 9 25 49
6
0 1 2 3 4 5

---------------------------------------------------------------------------------
Lagr.res
---------------------------------------------------------------------------------

6

0.000000
1.000000
4.000000
9.000000
16.00000
25.00000








Click Here for Free Traffic!

FISH.