fide.tex 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. \chapter[FIDE: Finite differences for PDEs]%
  2. {FIDE: Finite difference method for partial differential equations}
  3. \label{FIDE}
  4. \typeout{[FIDE: Finite differences for PDEs]}
  5. {\footnotesize
  6. \begin{center}
  7. Richard Liska \\
  8. Faculty of Nuclear Science and Physical Engineering \\
  9. Technical University of Prague \\
  10. Brehova 7, 115 19 Prague 1, Czech Republic \\[0.05in]
  11. e--mail: tjerl@aci.cvut.cz
  12. \end{center}
  13. }
  14. \ttindex{FIDE}
  15. The FIDE package performs automation of the process of numerical
  16. solving partial differential equations systems (PDES) by generating
  17. finite difference methods. In the process one can find several stages
  18. in which computer algebra can be used for performing routine
  19. analytical calculations, namely: transforming differential equations
  20. into different coordinate systems, discretisation of differential
  21. equations, analysis of difference schemes and generation of numerical
  22. programs. The FIDE package consists of the following modules:
  23. \begin{description}
  24. \item[EXPRES] for transforming PDES into any orthogonal coordinate system.
  25. \item[IIMET] for discretisation of PDES by integro-interpolation method.
  26. \item[APPROX] for determining the order of approximation of
  27. difference scheme.
  28. \item[CHARPOL] for calculation of amplification matrix and
  29. characteristic polynomial of difference scheme, which are needed in
  30. Fourier stability analysis.\
  31. \item[HURWP] for polynomial roots locating necessary in verifying the
  32. von Neumann stability condition.
  33. \item[LINBAND] for generating the block of FORTRAN code, which solves
  34. a system of linear algebraic equations with band matrix appearing
  35. quite often in difference schemes.
  36. \end{description}
  37. For more details on this package are given in the FIDE documentation,
  38. and in the examples. A flavour of its capabilities can be seen from
  39. the following simple example.
  40. \begin{verbatim}
  41. off exp;
  42. factor diff;
  43. on rat,eqfu;
  44. % Declare which indexes will be given to coordinates
  45. coordinates x,t into j,m;
  46. % Declares uniform grid in x coordinate
  47. grid uniform,x;
  48. % Declares dependencies of functions on coordinates
  49. dependence eta(t,x),v(t,x),eps(t,x),p(t,x);
  50. % Declares p as known function
  51. given p;
  52. same eta,v,p;
  53. iim a, eta,diff(eta,t)-eta*diff(v,x)=0,
  54. v,diff(v,t)+eta/ro*diff(p,x)=0,
  55. eps,diff(eps,t)+eta*p/ro*diff(v,x)=0;
  56. *****************************
  57. ***** Program ***** IIMET Ver 1.1.2
  58. *****************************
  59. Partial Differential Equations
  60. ==============================
  61. diff(eta,t) - diff(v,x)*eta = 0
  62. diff(p,x)*eta
  63. --------------- + diff(v,t) = 0
  64. ro
  65. diff(v,x)*eta*p
  66. diff(eps,t) + ----------------- = 0
  67. ro
  68. Backtracking needed in grid optimalization
  69. 0 interpolations are needed in x coordinate
  70. Equation for eta variable is integrated in half grid point
  71. Equation for v variable is integrated in half grid point
  72. Equation for eps variable is integrated in half grid point
  73. 0 interpolations are needed in t coordinate
  74. Equation for eta variable is integrated in half grid point
  75. Equation for v variable is integrated in half grid point
  76. Equation for eps variable is integrated in half grid point
  77. Equations after Discretization Using IIM :
  78. ==========================================
  79. (4*(eta(j,m + 1) - eta(j,m) - eta(j + 1,m)
  80. + eta(j + 1,m + 1))*hx - (
  81. (eta(j + 1,m + 1) + eta(j,m + 1))
  82. *(v(j + 1,m + 1) - v(j,m + 1))
  83. + (eta(j + 1,m) + eta(j,m))*(v(j + 1,m) - v(j,m)))
  84. *(ht(m + 1) + ht(m)))/(4*(ht(m + 1) + ht(m))*hx) = 0
  85. (4*(v(j,m + 1) - v(j,m) - v(j + 1,m) + v(j + 1,m + 1))*hx*ro
  86. + ((eta(j + 1,m + 1) + eta(j,m + 1))
  87. *(p(j + 1,m + 1) - p(j,m + 1))
  88. + (eta(j + 1,m) + eta(j,m))*(p(j + 1,m) - p(j,m)))
  89. *(ht(m + 1) + ht(m)))/(4*(ht(m + 1) + ht(m))*hx*ro) = 0
  90. (4*(eps(j,m + 1) - eps(j,m) - eps(j + 1,m)
  91. + eps(j + 1,m + 1))*hx*ro + ((
  92. eta(j + 1,m + 1)*p(j + 1,m + 1)
  93. + eta(j,m + 1)*p(j,m + 1))
  94. *(v(j + 1,m + 1) - v(j,m + 1)) +
  95. (eta(j + 1,m)*p(j + 1,m) + eta(j,m)*p(j,m))
  96. *(v(j + 1,m) - v(j,m)))*(ht(m + 1) + ht(m)))/(4
  97. *(ht(m + 1) + ht(m))*hx*ro) = 0
  98. clear a;
  99. clearsame;
  100. cleargiven;
  101. \end{verbatim}