Intro To Chemical Adsorption
Intro To Chemical Adsorption
Intro To Chemical Adsorption
Programming paradigms
Architecture
Use Cases
Dragan Nikolić
1 December 2013
Outline
1 Intro
2 Programming paradigms
3 Architecture
4 Use Cases
Outline
1 Intro
General Info
Motivation
Main features
2 Programming paradigms
General
DSL vs. DAE Tools
3 Architecture
Overview
4 Use Cases
Use Case 1 - High level modelling language
Use Case 2 - Low level DAE solver
Use Case 3 - Embedded simulator (back end)
Simulation
Steady-State
Transient
Optimization
NLP problems: IPOPT, NLOPT, OpenOpt, scipy.optimize
MINLP problems: BONMIN
Parameter estimation: Levenberg–Marquardt algorithm
(scipy.optimize)
Advantages:
1 Hybrid approach betwen DSL and GPPL
2 Programmatical generation of models
3 Runtime modification of objcts/models (operating procedures)
4 Introperability with 3rd party software packages/libraries
5 Code generation/Model exchange capabilities
Object-oriented modelling
Code generation
Model Exchange
Model reports
Multi-domain
DAE Plotter
2D plots (Matplotlib)
Animated 2D plots
3D plots (Mayavi)
Solvers
Supported FE libraries:
deal.II (http://dealii.org)
Solvers
Supported LA solvers:
Sundials dense LU, Lapack
Trilinos Amesos (http://trilinos.sandia.gov/packages/amesos)
Trilinos AztecOO (http://trilinos.sandia.gov/packages/aztecoo)
SuperLU SuperLU-MT
(http://crd.lbl.gov/ xiaoye/SuperLU/index.html)
Umfpack (http://www.cise.ufl.edu/research/sparse/umfpack)
MUMPS (http://graal.ens-lyon.fr/MUMPS)
CUSP (http://code.google.com/p/cusp-library)
Intel Pardiso (http://software.intel.com/en-us/articles/intel-mkl)
Outline
1 Intro
General Info
Motivation
Main features
2 Programming paradigms
General
DSL vs. DAE Tools
3 Architecture
Overview
4 Use Cases
Use Case 1 - High level modelling language
Use Case 2 - Low level DAE solver
Use Case 3 - Embedded simulator (back end)
DAE Tools
The same
Dragan modelDAE
Nikolić in Tools
daetools
- Introduction
Intro
Programming paradigms General
Architecture DSL vs. DAE Tools
Use Cases
DSL/Modelling languages
Domain-specific languages allow solutions to be expressed in
the idiom and at the level of abstraction of the problem
domain (direct support for all modelling concepts by the
language syntax)
DAE Tools
Modelling concepts cannot be expressed directly in the
programming language and have to be emulated in the API or
in some other way
Verbosity
DSL/Modelling languages
Clean, concise, ellegant and natural way of building model
descriptions: the code can be self documenting
DAE Tools
The support for modelling concepts is much more verbose and
less elegant; however, DAE Tools can generate
XML+MathML based model reports that can be either
rendered in XHTML format using XSLT transformations
(representing the code documentation) or used as an
XML-based model exchange language
DSL/Modelling languages
Domain-specific languages could enhance quality, productivity,
reliability, maintainability and portability
DAE Tools
DSL/Modelling languages
DSLs could be and often are simulator independent making a
model exchange easier
DAE Tools
Programming language dependent; however, a large number
of scientific software libraries exposes its functionality to
Python via Python wrappers
DSL/Modelling languages
Cost of designing, implementing, and maintaining a
domain-specific language as well as the tools required to
develop with it (IDE): a compiler/lexical parser/interpreter
must be developed with all burden that comes with it (such as
error handling, grammar ambiguities, hidden bugs etc)
DAE Tools
A compiler/lexical parser/interpreter is an integral part of the
programming language (c++, Python) with a robust error
handling, universal grammar and massively tested
DSL/Modelling languages
Cost of learning a new language vs. its limited applicability:
users are required to master a new language (yet another
language grammar)
DAE Tools
No learning of a new language required (everything can get
done in a favourite programming language)
DSL/Modelling languages
Increased difficulty of integrating the DSL with other
components: calling external functions/libraries and
interaction with other software is limited by the existence of
wrappers around a simulator engine (for instance some
scripting languages like Python or javascript)
DAE Tools
Calling external functions/libraries is a natural and
straightforward Interaction with other software is natural and
straightforward
DSL/Modelling languages
Models usually cannot be created in the runtime/on the fly
(or at least not easily) and cannot be modified in the runtime
DAE Tools
Models can be created in the runtime/on the fly and easily
modified in the runtime
Simulation setup
DSL/Modelling languages
Setting up a simulation (ie. the values of parameters values,
initial conditions, initially active states) is embedded in the
language and it is typically difficult to do it on the fly or to
obtain the values from some other software (for example to
chain several software calls where outputs of previous calls
represent inputs to the subsequent ones)
DAE Tools
Setting up a simulation is done programmaticaly and the
initial values can be obtained from some other software in a
natural way (chaining several software calls is easy since a
large number of libraries make Python wrappers available)
Dragan Nikolić DAE Tools - Introduction
Intro
Programming paradigms General
Architecture DSL vs. DAE Tools
Use Cases
Operating procedures
DSL/Modelling languages
Simulation operating procedures are not flexible; manipulation
of model parameters, variables, equations, simulation results
etc is limited to only those operations provided by the
language
DAE Tools
Operating procedures are completely flexible (within the limits
of a programming language itself) and a manipulation of
model parameters, variables, equations, simulation results etc
can be done in any way which a user cosiders suitable for
his/her problem
Outputs
DSL/Modelling languages
Only the type of results provided by the language/simulator is
available; custom processing is usually not possible or if a
simulator does provide a way to build extensions it is limited
to the functionality made available to them
DAE Tools
The results processing can be done in any way which a user
considers suitable(again within the limits of a programming
language itself)
Outline
1 Intro
General Info
Motivation
Main features
2 Programming paradigms
General
DSL vs. DAE Tools
3 Architecture
Overview
4 Use Cases
Use Case 1 - High level modelling language
Use Case 2 - Low level DAE solver
Use Case 3 - Embedded simulator (back end)
Available modules
pyDAE:
pyCore (key modelling concepts)
pyActivity (simulation, optimization)
pyDataReporting (results handling)
pyIDAS (DAE solver)
pyUnits (unit and quantity concepts)
FE Solvers:
pyDealII
LA Solvers:
pySuperLU
pySuperLU MT
pyTrilinos (Amesos, AztecOO)
pyIntelPardiso
NLP/MINLP Solvers:
pyIPOPT
pyBONMIN
pyNLOPT
Available components
Model
Simulation
Optimization
DAE solver
LA solver
NLP solver
Log
Data reporter
Data receiver
Outline
1 Intro
General Info
Motivation
Main features
2 Programming paradigms
General
DSL vs. DAE Tools
3 Architecture
Overview
4 Use Cases
Use Case 1 - High level modelling language
Use Case 2 - Low level DAE solver
Use Case 3 - Embedded simulator (back end)