skip to main content
OSTI.GOV title logo U.S. Department of Energy
Office of Scientific and Technical Information

Title: Automatic code generation in SPARK: Applications of computer algebra and compiler-compilers

Technical Report ·
DOI:https://doi.org/10.2172/7368555· OSTI ID:7368555

We show how computer algebra and compiler-compilers are used for automatic code generation in the Simulation Problem Analysis and Research Kernel (SPARK), an object oriented environment for modeling complex physical systems that can be described by differential-algebraic equations. After a brief overview of SPARK, we describe the use of computer algebra in SPARK's symbolic interface, which generates solution code for equations that are entered in symbolic form. We also describe how the Lex/Yacc compiler-compiler is used to achieve important extensions to the SPARK simulation language, including parametrized macro objects and steady-state resetting of a dynamic simulation. The application of these methods to solving the partial differential equations for two-dimensional heat flow is illustrated.

Research Organization:
Lawrence Berkeley National Lab. (LBNL), Berkeley, CA (United States)
Sponsoring Organization:
USDOE; USDOE, Washington, DC (United States)
DOE Contract Number:
AC03-76SF00098
OSTI ID:
7368555
Report Number(s):
LBL-32815; ON: DE93015232
Country of Publication:
United States
Language:
English