Solving Fredholm Equation: Step-by-Step Guide

  • Thread starter Thread starter huyhohoang
  • Start date Start date
Click For Summary
SUMMARY

The discussion focuses on the subroutine 'fred2' used to solve Fredholm integral equations. The key aspect is the initialization of the array 'omk(i,j)', which starts as an identity matrix and is subsequently modified to represent the equation OMK = I - AK*W, where 'AK' is a function of the input arrays 't' and 'w'. The subroutine utilizes numerical methods and external functions such as 'gauleg', 'ludcmp', and 'lubksb' to perform calculations efficiently. The repurposing of the 'omk' matrix is a space-saving strategy employed by the author.

PREREQUISITES
  • Understanding of Fredholm integral equations
  • Familiarity with Fortran programming language
  • Knowledge of numerical methods, specifically Gaussian quadrature
  • Experience with matrix operations and linear algebra
NEXT STEPS
  • Study the implementation of Gaussian quadrature in 'gauleg'
  • Explore the 'ludcmp' and 'lubksb' subroutines for matrix decomposition and back substitution
  • Learn about the theory and applications of Fredholm equations
  • Investigate memory management techniques in Fortran for optimizing performance
USEFUL FOR

Mathematicians, numerical analysts, and software developers working on computational methods for solving integral equations, particularly those using Fortran.

huyhohoang
Messages
12
Reaction score
0
Hi! I am now building a program to solve integral equation. I have understood the numerical method to solve it as well as others subroutines gauleg, ludcmp, lubksb but when I read this subroutine fred2 below, I don't know exactly the purpose of the author when putting the array omk(i,j) in the code. Can anyone give me some advice or instruction please?
Many thanks.
Fortran:
      SUBROUTINE fred2(n,a,b,t,f,w,g,ak)
      INTEGER n,NMAX
      REAL a,b,f(n),t(n),w(n),g,ak
      EXTERNAL ak,g
      PARAMETER (NMAX=200)
CU    USES ak,g,gauleg,lubksb,ludcmp
      INTEGER i,j,indx(NMAX)
      REAL d,omk(NMAX,NMAX)
      if(n.gt.NMAX) pause 'increase NMAX in fred2'
      call gauleg(a,b,t,w,n)
      do 12 i=1,n
        do 11 j=1,n
          if(i.eq.j)then
            omk(i,j)=1.
          else
            omk(i,j)=0.
          endif
          omk(i,j)=omk(i,j)-ak(t(i),t(j))*w(j)
11      continue
        f(i)=g(t(i))
12    continue
      call ludcmp(omk,n,NMAX,indx,d)
      call lubksb(omk,n,NMAX,indx,f)
      return
      END
 
Technology news on Phys.org
I'm not sure what the code is supposed to do but the omk array is setup basically like an identity matrix

and the line omk(i,j)-ak(t(i),t(j))*w(j) looks like the matrix equation OMK = I - AK*W

where I and AK are matrices and W is a vector.

OMK starts out in the code as the identity matrix and then its reused to hold the result of I - AK*W

so I guess the author was trying to save space by repurposing the OMK matrix memory.
 
Thanks. Now I understand the purpose of the authors.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
Replies
1
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 20 ·
Replies
20
Views
2K
  • · Replies 12 ·
Replies
12
Views
4K
Replies
6
Views
4K
Replies
1
Views
2K
  • · Replies 6 ·
Replies
6
Views
5K
  • · Replies 2 ·
Replies
2
Views
2K