Computer Algebra in Simulation Code Development

Computer Algebra in Simulation Code Development

From: AAAI Technical Report FS-92-01. Copyright © 1992, AAAI (www.aaai.org). All rights reserved. Computer Algebra in Simulation Code Development Richard Liska Faculty of Nuclear Sciences and Physical Engineering, Czech Technical University in Prague Biehovg 7, 115 19 Prague 1, Czechoslovakia tjerl~cspuni12.bitnet, [email protected] Abstract lems. Rather we want to design tools which can help The majority of large-scale scientific computation prob- and assist a user during the solver development. The lems fall into the area of numerical simulations of real user is expected to understand and control the develop- world systems. Such systems are usually described by ment process. The control remains in user’s hands while a mathematical model in the form of a system of par- a computer performs mechanical tasks necessary during tial differential equations (PDEs) which are solvable only the development. The other interesting approach can be numerically. The productivity of particular numerical a "grey box" PDEs solvers development system which PDEssolver development can be increased by using spe- can be closed for beginners in PDEs solving and open cial program tools. Such tools are usually implemented for experts in PDEs solving. Such system working in in a computer algebra system. The FIDE package in- the closed (black box) modecould be controlled by the cludes several tools performing such tasks as PDEsdis- decision strategy implemented by artificial intelligence cretization, analysis of difference schemes and generation methods and containing a large amount of knowledge of numerical code for difference schemes solving. Capa- about numerical PDEs solving. bihty of using the package for a real hard simulation Very simply the numerical simulation can be divided problemis illustrated. Possibilities to enlarge the abili- into four tasks: ties of such tools and to incorporate artificial intelligence 1. designing the mathematical model of a real world methods in the presented methodology are discussed. problem 2. developing a numerical code solving the mathematical Introduction model The greatest part of scientific computation is covered 3. numerical testing of the code by simulation problems. In the simulation problem we have a real world system and want to knowhow this sys- 4. actual calculation and results post-processing tem will behave under certain conditions. The system is These tasks are not performed purely sequentially. Find- usually described by the set of equations, the so called ing an inappropriate behavior of a task one usually re- mathematical model, in which characteristic quantities turns to one of the previous tasks and modifies it. We of the system appear. The mathematical model of a will consider here the second task, which on the base of a real world problem cannot be usually solved directly an- mathematical model (here PDEs) develops a numerical alytically and has to be solved numerically. Wewill re- algorithm solving the model and implements the algo- strict only to numerical simulation problems. The ma- rithm in a numerical program. The questions of grid jority of large-scale numerical simulation problems is de- generation and grid adjusting belonging to this task do scribed by the mathematical model in the form of a sys- not fall into the scope of this paper. During the algo- tem of partial differential equations (PDEs) or integro- rithm and code development a considerable amount of differential equations. So we will further restrict to such analytical calculations has to be done. This analytical mathematical models. calculations can be performed by a computer algebra There exist several general numerical PDEssolvers. system (CAS). The paper concentrates mainly on this Howeverthe experience shows that such solvers are not aspect of using computer algebra during designing an capable to solve the real world problems. Even more algorithm and a numerical code for PDEs solving. This any new real world PDEs problem requires developing methodology increases the productivity of the develop- of its ownnumerical solver. The construction of general ment process. The productivity boost is more significant PDEssolvers suitable for broad classes of equations is if a mathematical model or the geometry of a problem not possible for real world problems. Thus the develop- is complicated. ment of simulation code for the specific real problem has Fromthe artificial intelligence point of view CASsare a crucial importance for scientific computation. knowledge systems intercepting a large amount of math- It is necessary to stress out that our aim is not to ematical knowledge. When the knowledge of numerical construct a black box PDEs solvers development system PDEs solving is added the resulted program tools can which should result in limited class of solvable prob- save time and effort of a developer. 74 From: AAAI Technical Report FS-92-01. Copyright © 1992, AAAI (www.aaai.org). All rights reserved. The paper concentrates on description of the FIDE in a PDEscan be discretized in every coordinate on the package implemented in the REDUCE(Hearn 1991) original grid or on the second one. Every equation of computer algebra system to assist users during devel- the system can be integrated over the cell of the orig- opment of numerical code for solving PDEs. The nu- inal grid or of the second one. The decision on which merical programming language FORTRANis used in grids the individual quantities (looked for functions of the methodology presented. The package uses the finite coordinates) are to be defined and over which grid cells difference method for PDEs solving. The FIDE package the individual equations are to be integrated is made so consists of the following modules that have been built, as to minimize the number of interpolations used during tested, and documented: integrating the whole PDEs. Such a decision is really EXPRESfor transforming PDES into any orthogonal not easy, especially for large systems. coordinate system. The IIMET module for discretization by the integro- interpolation method accomplishes this decision by ei- IIMETfor discretization of PDEsby the integro-inter- ther heuristically driven, or full search and from in- polation method. put PDEs the module produces the system of difference GILIDOPfor discretization of PDEs by the support- equations. The discretization of individual basic types operators method. of terms appearing in PDEscan be defined, and the dis- cretization can be controlled in several manners, so that APPROXfor determining the truncation error of dif- almost any discretization, according to the user’s wish, ference schemes. can be achieved by this module. Input PDEs can also CHARPOLfor calculating the amplification matrix include vector or tensor equations, in which case these and characteristic polynomial of difference schemes, equations are converted into scalar ones by the EXPRES which are needed in the Fourier stability analysis. module before the discretization begins. HURWPfor locating polynomial roots necessary in Support-Operators Method verifying the yon Neumannstability condition. The support-operators method (Samarski et al. 1981) LINBAND for generating the block of FORTRAN is a special method for PDEs discretization on non- code, which solves a system of linear algebraic equa- orthogonal meshes. According to this method the differ- tions with band matrix appearing frequently in differ- ence scheme for a system of differential equations, which ence schemes. are written in the terms of first order invariant differen- The FIDE package has been included into the REDUCE tial operators, is built so that the difference analogues network library available on <reduce-netlib~rand.org> of chosen integral relations between the operators hold. where the full code, documentation and test files can be Oneof these relations for the first order invariant differ- found. For more detailed description of the package see ential operators div, grad is (Liska & Drska 1990). fv udiv I’rg d V + fv(l~,grad u) d V = Sov U (l~, ff) Discretization (1) Discretization is the transformation of PDEsinto a sys- Considering a problem with zero boundary condition on tem of algebraic difference equations, so called differ- the surface OVwe can from (1) derive that grad = -div* ence scheme. The discretization can become a tedious where the star denotes the adjoint operator with re- task especially in cases of complicated PDEs, compli- spect to the functional scalar product (f, g) fvfg d V. cated geometry and higher dimensions. For example in Having a suitable defined difference operator DIV and 2D problem on rectangle one has to treat at least 9 dif- the difference approximation of the integral relation (1) ference schemes, one inside, 4 on the different boundary the support-operators method construct a difference op- lines and 4 on the boundary corners. In 3D the num- erator GRADnamely from the operator DIV and the ber of different difference schemes on cube becomes even approximation. 27. The amount of analytical transformations involved The method can be automated on logically rectan- in such tasks is really large and well suited for treating gular meshes. The formalization of the method, which by CAS. is necessary for algorithms development, is based on the concept of grid function spaces. The scalar or vector grid Integro-Interpolation Method function is a function defined in the grid nodes (or cells) The FIDE package includes the IIMET module which and has unique symbolic values (depending on multi- performs the discretization of PDEson orthogonal grids index which corresponds to the node) on logically rect- by integro-interpolation method. This method was cho- angular subsets of the grid. Grid operators are linear op- sen because it is quite universal, it can be applied to non- erators acting from one grid function space to another. linear PDEs,and in linear cases it produces conservative The grid operator has again unique values on logically difference schemes. In every coordinate the second grid rectangular subsets of the grid. On every grid function with grid points halfway between the original ones is de- space A two scalar products are defined.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    6 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us