12 September 2017

DAE Tools 1.7.2 updates

New features:

  • DAE Tools Windows 64 bit is available (downloads).
  • Updated FMI code generator. Exported FMU files now contain win64 binaries Model description now contains the xslt transformation.
  • Python wrapper keep the references to the python objects so they do not get destroyed if they go out of scope in python.
  • Updated all data reporters. Now all file data reporters export Units, DomainNames, Domains, Times and Values for all variables. daeExcelFileDataReporter uses openpyxl used instead of xlwt library.
  • Intel Pardiso solver available on win32, win64 and GNU/Linux x86_64
  • Install script (setup.py) now uses setuptools (not distutils).

30 August 2017

DAE Tools 1.7.2

The new 1.7.2 version is available.

New features:

  • New class daeActivity with two static functions: simulate and optimize. Updated all tutorials with the new, simpler way of executing simulations.
  • Fixed FMI code generator, SimulationLoader and FMU_CS libraries:
    • FMU_CS library does not link cdaeConfig shared library anymore
    • Fixed resources['simulationFile'] value in fmi.py (it should be only the filename not the full path).
    • In Windows python/Lib and Python/DLLs directories are programmatically added to the PATH/PYTHONPATH (in the SimulationLoader library).
    • In GNU/Linux Python/lib directory needs to be manually added to the LD_LIBRARY_PATH (only for custom python installations and virtual environments; system python installations do not need this)
    • In GNU/Linux python shared library needs to be loaded using dlopen (despite it was already loaded by FMI_CS library). Otherwise the code does not work: for instance, numpy cowardly refuses to import.
    • Variables from the top-level model can be exported as 'local' or 'output' FMI variables.
    • Added function create_simulation_for_cosimulation to pyDAE/__init__.py that can be used as a default simulation instantiation/initialisation function in daetools_mex, daetools_s and daetools_fmi_cs. It accepts simulation class name and some optional arguments (i.e. relativeTolerance).
    • Additional files argument of the daeCodeGenerator_FMI.generateSimulation function is now a list of tuples: [('file_path', 'resources_dir_relative_path'), ...] i.e. in tutorial_dealii_1: [(mesh_file, 'meshes/step-49.msh')]
    • Added a new optional argument to the daeCodeGenerator_FMI.generateSimulation function: localsAsOutputs = False. If it is true, variables from the top-level model are added as output FMI variables; otherwise, they are added as local FMI variables.
    • Function daeModel::GetCoSimulationInterface now has a new argument std::vector<daeVariable_t*> ptrarrModelVariables filled with the variables from the top-level model (treated as locals in FMI).
    • Function daeModel::GetFMIInterface now also adds variables from the top-level model to the std::map<size_t, daeFMI2Object_t> map as FMI 'Local' variables.
    • Function daeSimulationLoader::GetFMIValue now also returns values for 'Local' FMI variables.
    • Fixed bug in getFolderFromURI function (handling of file:/// in Windows).
    • Added a new function: daeSimulationLoader::SetRelativeTolerance. It is used in the fmi2SetupExperiment function to handle the tolerance argument (if toleranceDefined argument is true).
    • Updated generate_fmus.py file. It generates the FMU files for selected tutorials and generates all files required for the FMI ComplianceChecker (i.e. scripts to run .fmu files with the ComplianceChecker, the reference solution from the exporting tool, the .opt options and ReadMe.txt files).
  • daetools.cfg config file is now properly located on all platforms.
  • New daeSimulation properties: StopAtModelDiscontinuity and ReportDataAroundDiscontinuities and new boolean options stopAtModelDiscontinuity and reportDataAroundDiscontinuities in daetools.activity section n daetools.cfg. The properties control the default behaviour of daeSimulation.Run function. If StopAtModelDiscontinuity=true the simulation will stop at every discontinuty. If ReportDataAroundDiscontinuities=true the data will be reported before and after the discontinuity.
  • Added a new daeCSVFileDataReporter (saves the results into a .csv file).
  • OpenMP assembly refactored into the OpenMP_WorkStream::run function.
  • Added OpenMP shared library (vcomp.dll) to the setup.py in Windows.
  • Fixed bug in daeVariable::GetType function.

17 August 2017

DAE Tools 1.7.1

The new 1.7.1 version is available.

New features:

  • Added a new section: Code Verification Tests (The Method of Exact Solutions and Method of Manufactured Solutions). The section contains 10 tests.
  • Added a new section: Sensitivity Analysis Examples. Sensitivity analysis can be performed using the local methods (derivative-based, using sensitivities calculated by IDAS solver) or global methods available in SALib python library: Elementary Effect (Morris) and Variance-based (FAST, Sobol).
  • The global Sensitivity Analysis methods (tutorial_sa_3.py) can use python multiprocessing module to calculate the outputs in parallel (i.e. using a pool of workers and the Pool.map function).
  • Implemented high-resolution cell-centered upwind scheme with flux limiter (daeHRUpwindScheme).
  • Equation residuals/Jacobian/sensitivity residuals can be evaluated in parallel using the OpenMP. Number of OpenMP threads (and other options) can be specified in the daetools.cfg file (section "daetools.core.equations").
  • Equations have a new boolean property: SimplifyExpressions. The default value (false) is specified in daetools.cfg file ("daetools.core.equations.simplifyExpressions").
  • eQuasySteadyState renamed to eQuasiSteadyState. eQuasiSteadyState initial condition mode applied to the simulation in the tutorial7.py
  • Finite Element systems can be assembled in parallel. There are three options: Sequential, OpenMP and TBB (deal.II WorkStream) which can be specified in the daetools.cfg file (section "daetools.deal_II.assembly"). Multithreded TBB is available only in GNU/Linux.
  • Expressions in deal.II mass/stiffness matrices and load vector are much simpler now by skipping addition of contributions that always evaluate to zero (tests performed by hasNonzeroValue() function).
  • Finite Element equations and surface/volume integrals expressions are simplified by default.
  • Significantly improved the adNode::SimplifyNode function.
  • dealiiFiniteElementDof<dim> constructor now also accepts the variable type (the default is no_t).
  • setFEInitialConditions function also accepts a callable with two arguments: variableIndex, overallIndex.
  • Two new deal.ii tutorials: 2D transient Stokes flow driven by the differences in buoyancy (tutorial_dealii_7.py) and a small parallel-plate reactor with an active surface (tutorial_dealii_8.py).
  • Updated dof_approximation, dof_gradient_approximation, vector_dof_approximation, vector_dof_gradient_approximation and dof_gradient_approximation functions. As the result, the created expressions are much simpler and require less memory and time to evaluate.
  • New FE functions: symmetric_gradient<dim>, feExpression<dim>::scalar_product and feExpression<dim>::double_contract.
  • New functions in dealiiFiniteElementSystem<dim>:
    • ClearAssembledData (clears the arrays/matrices allocated during the assembly phase)
    • GetBoundaryDOFs (returns a list of boolean flags indicating whether the specified DOF is on one of the given boundaries)
    • GetDOFSupportPoints (returns a list of Point<dim> objects for all DOFs, if there are supports points in the FiniteElement object)
  • WeakForm now accepts contributions as either a single feExpression<dim> object or or as the python list objects. The items in the list can be individual feExpression<dim> objects a tuple of feExpression<dim> objects (q_loop, i_loop, j_loop). Splitting of weak form expressions results in simpler expressions and a faster execution.
  • Added pickling/unpickling of daeDataReceiverProcess and related objects. Now the simulation data in the DAE Plotter can be saved/loaded from a file.
  • Fixed zoom problems in 2D plots.
  • Added a new type of 2D plots: variable 1 vs. variable 2.
  • Animated 2D plot can show more than one curve.
  • New property daeIDAS.IntegratorStats returns a dictionary with the stats from the solver.
  • A new class: daeNodeGaph that generates graphs based on equation expressions. The generated graphs can be saved as images.
  • Updated documentation: sensitivity analysis, numerical methods for PDE, logging, DAE solvers, LA solvers, optimisation, data reporting. deal.ii tutorials now show animated gifs with the results.
  • Fixed issue with minpack solver.

17 August 2017

New section: Code Verification Tests

Not sure that DAE Tools can perform the job?
A new section Code Verification Tests has been added. The section contains problems that use formal code verification methods such as the Method of Exact Solutions (MES) and the Method of Manufactured Solutions (MMS). The main advantage of the MMS method is that it tests the code capabilities in full generality and therefore results in a high degree of confidence that all coding mistakes which prevent the equations being solved correctly have been identified.

17 August 2017

New section: Sensitivity Analysis Examples

A new section Sensitivity Analysis Examples has been added to the documentation. The local (derivative-based) and the global Sensitivity Analysis methods such as Morris Elementary Effect, and FAST/Sobol variance-based methods are available via the Python SAlib library.

02 June 2017

DAE Tools 1.7.0

The new 1.7.0 version is available.

New features:

  • Updated User Guide with new sections (user-defines actions, external functions, simulation explorer, executing simulations/optimisations and performing sensitivity analysis).
  • Updated tutorials.
  • MacOS version is again available (only for 64 bit x86 architecture). XCode's clang does not work since openmp is not available. gcc 6.3 from HPC for Mac is used. -rpath issue resolved (using @rpath/... in shared libs and @loader_path/../../solibs/Darwin_x86_64/... in python extension modules).
  • Support for thermophysical property packages (tutorial 19).
  • Sensitivity matrices can be obtained using the daesolver.SensitivityMatrix property and saved to .mmx files in the user-specified directory using the simulation.SensitivityDataDirectory property (tutorial 20).
  • Sensitivity data can be reported using the simulation.ReportSensitivities boolean property. For instance, in this case the sensitivity of the variable with the canonical name "m1.m2.variable" per sensitivity parameter "p1" is reported as "m1.m2.sensitivities.d(variable)/d(p1)".
  • Two sensitivity analysis benchmarks are added:
    • tutorial21.py where the usage of DAESolver.SensitivityMatrix is illustrated and where numerical sensitivities are compared to analytical ones for the constant coefficient first order differential equations.
    • tutorial_che_9.py where numerical sensitivities are compared to the literature data for the Dow Chemicals Company reaction network problem described in Caracotsios and Stewart (1985).
  • Time derivatives can be reported using the simulation.ReportTimeDerivatives boolean property. Here, the time derivative of the variable with the canonical name "m1.m2.variable" is reported as "m1.m2.time_derivatives.d(variable)/dt".
  • Variables have BlockIndexes ndarray properties with the block indexes for all points in the variable. If the variable is not distributed on domains then the BlockIndexes returns an integer.
  • Functions __call__, array, dt_array, d_array and d2_array in daeParameter and daeVariable can use -1 as an argument. Similar to python/numpy arrays, -1 selects the last point from the corresponding domain.
  • Operators __bool__ and __nonzero__ added to adouble and adouble_array classes. They raise not-implemented exceptions preventing inadvertent calls to Python's built-in operators not, and, or.
  • Standard mathematical functions also added to adouble_array class.
  • The script install_python_dependencies.sh updated to enable python versions.
  • Fixed daetools.cfg detection using boost::filesystem::canonical() function.

16 March 2017

DAE Tools 1.6.1

The new 1.6.1 version is available.

This is an update to DAE Tools v1.6.0 with some improvements. New features:

  • Python versions supported: 2.7, 3.4, 3.5 and 3.6.
  • All GUI features switched to PyQt5.
  • DAE Toools Examples now shows tutorials' description in html.
  • This version provides a native support for MSVC++ compiler
  • The latest boost and solver libraries:
    • boost: 1.52.0 -> 1.62.0
    • idas: 1.1.0 -> 1.3.0
    • superlu: 4.1 -> 5.2.1
    • superlu_mt: 2.0 -> 3.1
    • trilinos: 10.8.0 -> 12.10.1
    • nlopt: 2.4.1 -> 2.4.2
    • bonmin: 1.8.4
    • deal.ii: 8.4.1
  • The bonmin version for windows uses an old 1.4.1.
  • Superlu_MT now uses OpenMP (not pthreads).
  • compile_libraries_linux.sh and compile_linux.sh renamed to compile_libraries.sh and compile.sh (since they perform build for all three platforms).

1 March 2017

DAE Tools 1.6.0

The new 1.6.0 version is available.

New features:

  • Updated documentation.
  • daeSimulation.SetContinuousOptimizationVariable also accepts quantity arguments (not only plain floats).
    daeDomain.CreateStructuredGrid also accepts quantity arguments (not only plain floats).
  • IPOPT solver has the scaling parameters.
  • daeFunctionWithGradients and daeOptimizationVariable have scaling parameters (the defaults is 1.0).
  • DAESolver now has the SetTimeHorizon function to prevent the solver to integrate past the specified time horizon (internally it uses SetStopTime).
  • Config files under Windows are now located properly.
    Created a new shared library daeConfig-pyMM. Now, the config is shared among modules (before, every module had its own instance of it) and changes will be reflected on all modules. Config files have the global daeSetConfigFile(configFilePath) function to set user-specified daetools.cfg file.
  • Updated support for optimisation problems and optimisation solvers.
  • A new Chemical Engineering Optimisation Examples section has been added with 5 COPS optimisation, optimal control and parameter estimation tests.
  • Updated the global functions d(), d2() and dt(). Now they accept all types of expressions/functions from math.h (except min, max, erf, floor, and ceil).
  • Old tutorials split into 4 sections:
    • Basic
    • Advanced
    • Finite Element
    • Optimisation

    and a new section Chemical Engineering Examples is added to the documentation.

    It contains the following models:

    • CSTR
    • Plug Flow Reactor
    • Binary distillation column
    • Batch crystalliser
    • Discretised Population Balance equations solved using high-resoluton upwind scheme with flux limiter (2x)
    • Li-ion battery (porous electrode theory by J.Newman and coworkers)
    • Porous membrane model employing Generalised Maxwell-Stefan equations

    Tutorials 16, 18, 20 and 23 are moved to the advanced section and became tutorial_adv_1,2,3,4.

    Tutorial 19 is now 16, and tutorial 21 is now 18.

    The deal.II tutorials now include:

    • Transient heat conduction
    • Transient heat convection
    • Cahn-Hilliard equation
    • Flow through the porous media
    • Steady-state diffusion and first-order reaction in an irregular catalyst shape

    All tutorials has been updated with the more detailed descriptions, equations and plots of the results.

    Updated sphinx documentation with the new theme (bootstrap, bootswatch_theme: readable) and its options.

  • Windows port updates:

    • No installers are provided anymore. The installation process is the same for all platforms: python setup.py install
    • Added daeplotter.bat and daeexamples.bat files so the DAE Plotter and DAEExamples can be started from the command line.
    • Only win32 architecture left (win64 were causing errors when using 32 bit daetools on 64 bit Windows). Changes made to setup.py and daetools/__init__.py
  • A major revision of the support for Finite Elements (through deal.II library)

    • Multi-scalar FE systems work well now. Vector systems need to be tested (still not ready).
    • Weak form expressions can contain adouble objects that is the expressions with daeVariable and daeParameter objects. Consequently, the non-linear finite elements are automatically supported.
    • The weak form now consists of the following contributions:
      1. Aij - cell contribution to the system stiffness matrix.
      2. Mij - cell contribution to the mass stiffness matrix.
      3. Fi - cell contribution to the load vector.
      4. boundaryFaceAij - boundary face contribution to the system stiffness matrix.
      5. boundaryFaceFi - boundary face contribution to the load vector
      6. innerCellFaceAij - inner cell face contribution to the system stiffness matrix.
      7. innerCellFaceFi - inner cell face contribution to the load vector
      8. functionsDirichletBC - Dirichlet boundary conditions
      9. surfaceIntegrals - surface integrals
      10. volumeIntegrals - volume integrals
    • The list of functions for building weak form expressions:
      • phi (variableName, shapeFunction, quadraturePoint): corresponds to shape_value in deal.II
      • dphi (variableName, shapeFunction, quadraturePoint): corresponds to shape_grad in deal.II
      • d2phi (variableName, shapeFunction, quadraturePoint): corresponds to shape_hessian in deal.II
      • phi_vector (variableName, shapeFunction, quadraturePoint): corresponds to shape_value of vector dofs in deal.II
      • dphi_vector (variableName, shapeFunction, quadraturePoint): corresponds to shape_grad of vector dofs in deal.II
      • d2phi_vector (variableName, shapeFunction, quadraturePoint): corresponds to shape_hessian of vector dofs in deal.II
      • div_phi (variableName, shapeFunction, quadraturePoint): corresponds to divergence in deal.II
      • JxW (quadraturePoint): corresponds to the mapped quadrature weight in deal.II
      • xyz (quadraturePoint): returns the point for the specified quadrature point in deal.II
      • normal (quadraturePoint): corresponds to the normal_vector in deal.II
      • function_value (functionName, function, point, component): wraps Function<dim> object that returns a value
      • function_gradient (functionName, function, point, component): wraps Function<dim> object that returns a gradient
      • function_adouble_value (functionName, function, point, component): wraps Function<dim> object that returns adouble value
      • function_adouble_gradient (functionName, function, point, component): wraps Function<dim> object that returns adouble gradient
      • dof (variableName, shapeFunction): returns daetools variable at the given index (adouble object)
      • dof_approximation (variableName, shapeFunction): returns FE approximation of a quantity as a daetools variable (adouble object)
      • dof_gradient_approximation (variableName, shapeFunction): returns FE gradient approximation of a quantity as a daetools variable (adouble object)
      • dof_hessian_approximation (variableName, shapeFunction): returns FE hessian approximation of a quantity as a daetools variable (adouble object)
      • vector_dof_approximation (variableName, shapeFunction): returns FE approximation of a vector quantity as a daetools variable (adouble object)
      • vector_dof_gradient_approximation (variableName, shapeFunction): returns FE approximation of a vector quantity as a daetools variable (adouble object)
      • adouble (ad): wraps any daetools expression to be used in matrix assembly
      • tensor1 (t): wraps deal.II Tensor<rank=1>
      • tensor2 (t): wraps deal.II Tensor<rank=2>
      • tensor2 (t): wraps deal.II Tensor<rank=3>
    • Supported almost all FiniteElement classes from deal.II:
      • FE_Q, FE_Bernstein
      • FE_ABF, FE_BDM, FE_Nedelec, FE_RaviartThomas
      • FE_DGP, FE_DGQ, FE_DGBDM, FE_DGNedelec, FE_DGRaviartThomas
    • Supported almost all quadrature rules: QGauss, QGaussLobatto, QMidpoint, QSimpson, QTrapez, QMilne, QWeddle, QGaussLog, QGaussLogR, QGaussOneOverR, QGaussChebyshev, QGaussLobattoChebyshev
    • Added support for surface/volume integrals over boundaries.
    • Initial conditions are now set using the function setFEInitialConditions().
  • New VTK data reporter (daeVTKDataReporter).

  • The macro CLONE_NODE, the copy constructor and operator = do not deep copy adNode-derived objects anymore but just take the source node smart pointer. The memory used is lower now.

  • Added a new boolean option daetools.core.checkForInfiniteNumbers to daetools.cfg and a function to the daeDataProxy class CheckForInfiniteNumbers(). This options can be used while calculating residuals, Jacobian and sensitivity residuals to check if a value/derivative is a finite number (that is not +inf, -inf, nan). By the default it is disabled (for performance reasons).

  • Added try/catch statements in Residual/Jacobian/SensitivityResiduals calculation to be able to track equations which are the source of errors. Exceptions are re-thrown so the simulation will still fail but this time with the name of the equation and the reason of the failure. Useful when sqrt or logarithm functions are called for negative basis, for instance.

  • Added diagnostics in adNode-derived runtime classes that checks values for nan, -inf, +inf

  • DAE solver now also reports data after a failure in SolveInitial() and Reinitalize() functions.

  • adSetupVariableNode and adRuntimeVariableNode objects are stored in std::map<overall_index,node*> to reduce the memory requirements.

  • Modified model reports .xslt and .css files.

  • Fixed bug with the propagation of the global execution context. It has been propagated only from the current level model downwards. Now, it is always propagated from the top level model.

  • Small bug fix in unit::toLatex() function.

  • Fixed bug in quantity::operator /(double, adouble).

  • Fixed small bug when saving 2D plot templates (domainIndexes are reset by the ChooseVariable dialog) causing the empty list in the json template.

  • Equations and EquationExecutionInfos are not exported into MathML but Latex instead. The file size of the runtime reports is shrank from tens of mb to 100 kb. MathJax used to render Latex into html+css.

  • Equations now do not save the residual node in xml (Expression tag) since it was not used anywhere and required huge files.

  • Greek html symbols (i.e. &lambda;) are converted into the Latex (i.e. lambda).

  • Other small updates/fixes.

13 December 2016

DAE Tools 1.6.0-beta4

The new 1.6.0-beta4 version is available. Some of the new examples will only work with the latest 1.6.0-b4 version.

New features since beta3:

  • Updated support for optimisation problems and optimisation solvers.
  • A new Chemical Engineering Optimisation Examples section has been added with 5 COPS optimisation, optimal control and parameter estimation tests.

26 November 2016

DAE Tools 1.6.0-beta3

The new 1.6.0-beta3 version is available. Additional features:

  • Updated the global functions d(), d2() and dt(). Now they accept all types of expressions/functions from math.h (except min, max, erf, floor, and ceil).
  • Old tutorials split into 4 sections:
    • Basic
    • Advanced
    • Finite Element
    • Optimisation

    and a new section Chemical Engineering Examples is added to the documentation.

    It contains the following models:

    • CSTR
    • Plug Flow Reactor
    • Binary distillation column
    • Batch crystalliser
    • Discretised Population Balance equations solved using high-resoluton upwind scheme with flux limiter (2x)
    • Li-ion battery (porous electrode theory by J.Newman and coworkers)
    • Porous membrane model employing Generalised Maxwell-Stefan equations

    Tutorials 16, 18, 20 and 23 are moved to the advanced section and became tutorial_adv_1,2,3,4.

    Tutorial 19 is now 16, and tutorial 21 is now 18.

    The deal.II tutorials now include:

    • Transient heat conduction
    • Transient heat convection
    • Cahn-Hilliard equation
    • Flow through the porous media
    • Steady-state diffusion and first-order reaction in an irregular catalyst shape

    All tutorials has been updated with the more detailed descriptions, equations and plots of the results.

    Updated sphinx documentation with the new theme (bootstrap, bootswatch_theme: readable) and its options.

  • Windows port updates:

    • No installers are provided anymore. The installation process is the same for all platforms: python setup.py install
    • Added daeplotter.bat and daeexamples.bat files so the DAE Plotter and DAEExamples can be started from the command line.
    • Only win32 architecture left (win64 were causing errors when using 32 bit daetools on 64 bit Windows). Changes made to setup.py and daetools/__init__.py
  • A major revision of the support for Finite Elements (through deal.II library)

    • Multi-scalar FE systems work well now. Vector systems need to be tested (still not ready).
    • Weak form expressions can contain adouble objects that is the expressions with daeVariable and daeParameter objects. Consequently, the non-linear finite elements are automatically supported.
    • The weak form now consists of the following contributions:
      1. Aij - cell contribution to the system stiffness matrix.
      2. Mij - cell contribution to the mass stiffness matrix.
      3. Fi - cell contribution to the load vector.
      4. boundaryFaceAij - boundary face contribution to the system stiffness matrix.
      5. boundaryFaceFi - boundary face contribution to the load vector
      6. innerCellFaceAij - inner cell face contribution to the system stiffness matrix.
      7. innerCellFaceFi - inner cell face contribution to the load vector
      8. functionsDirichletBC - Dirichlet boundary conditions
      9. surfaceIntegrals - surface integrals
      10. volumeIntegrals - volume integrals
    • The list of functions for building weak form expressions:
      • phi (variableName, shapeFunction, quadraturePoint): corresponds to shape_value in deal.II
      • dphi (variableName, shapeFunction, quadraturePoint): corresponds to shape_grad in deal.II
      • d2phi (variableName, shapeFunction, quadraturePoint): corresponds to shape_hessian in deal.II
      • phi_vector (variableName, shapeFunction, quadraturePoint): corresponds to shape_value of vector dofs in deal.II
      • dphi_vector (variableName, shapeFunction, quadraturePoint): corresponds to shape_grad of vector dofs in deal.II
      • d2phi_vector (variableName, shapeFunction, quadraturePoint): corresponds to shape_hessian of vector dofs in deal.II
      • div_phi (variableName, shapeFunction, quadraturePoint): corresponds to divergence in deal.II
      • JxW (quadraturePoint): corresponds to the mapped quadrature weight in deal.II
      • xyz (quadraturePoint): returns the point for the specified quadrature point in deal.II
      • normal (quadraturePoint): corresponds to the normal_vector in deal.II
      • function_value (functionName, function, point, component): wraps Function<dim> object that returns a value
      • function_gradient (functionName, function, point, component): wraps Function<dim> object that returns a gradient
      • function_adouble_value (functionName, function, point, component): wraps Function<dim> object that returns adouble value
      • function_adouble_gradient (functionName, function, point, component): wraps Function<dim> object that returns adouble gradient
      • dof (variableName, shapeFunction): returns daetools variable at the given index (adouble object)
      • dof_approximation (variableName, shapeFunction): returns FE approximation of a quantity as a daetools variable (adouble object)
      • dof_gradient_approximation (variableName, shapeFunction): returns FE gradient approximation of a quantity as a daetools variable (adouble object)
      • dof_hessian_approximation (variableName, shapeFunction): returns FE hessian approximation of a quantity as a daetools variable (adouble object)
      • vector_dof_approximation (variableName, shapeFunction): returns FE approximation of a vector quantity as a daetools variable (adouble object)
      • vector_dof_gradient_approximation (variableName, shapeFunction): returns FE approximation of a vector quantity as a daetools variable (adouble object)
      • adouble (ad): wraps any daetools expression to be used in matrix assembly
      • tensor1 (t): wraps deal.II Tensor<rank=1>
      • tensor2 (t): wraps deal.II Tensor<rank=2>
      • tensor2 (t): wraps deal.II Tensor<rank=3>
    • Supported almost all FiniteElement classes from deal.II:
      • FE_Q, FE_Bernstein
      • FE_ABF, FE_BDM, FE_Nedelec, FE_RaviartThomas
      • FE_DGP, FE_DGQ, FE_DGBDM, FE_DGNedelec, FE_DGRaviartThomas
    • Supported almost all quadrature rules: QGauss, QGaussLobatto, QMidpoint, QSimpson, QTrapez, QMilne, QWeddle, QGaussLog, QGaussLogR, QGaussOneOverR, QGaussChebyshev, QGaussLobattoChebyshev
    • Added support for surface/volume integrals over boundaries.
    • Initial conditions are now set using the function setFEInitialConditions().
  • New VTK data reporter (daeVTKDataReporter).

  • The macro CLONE_NODE, the copy constructor and operator = do not deep copy adNode-derived objects anymore but just take the source node smart pointer. The memory used is lower now.

  • Added a new boolean option daetools.core.checkForInfiniteNumbers to daetools.cfg and a function to the daeDataProxy class CheckForInfiniteNumbers(). This options can be used while calculating residuals, Jacobian and sensitivity residuals to check if a value/derivative is a finite number (that is not +inf, -inf, nan). By the default it is disabled (for performance reasons).

  • Added try/catch statements in Residual/Jacobian/SensitivityResiduals calculation to be able to track equations which are the source of errors. Exceptions are re-thrown so the simulation will still fail but this time with the name of the equation and the reason of the failure. Useful when sqrt or logarithm functions are called for negative basis, for instance.

  • Added diagnostics in adNode-derived runtime classes that checks values for nan, -inf, +inf

  • DAE solver now also reports data after a failure in SolveInitial() and Reinitalize() functions.

  • adSetupVariableNode and adRuntimeVariableNode objects are stored in std::map<overall_index,node*> to reduce the memory requirements.

  • Modified model reports .xslt and .css files.

  • Fixed bug with the propagation of the global execution context. It has been propagated only from the current level model downwards. Now, it is always propagated from the top level model.

  • Small bug fix in unit::toLatex() function.

  • Fixed bug in quantity::operator /(double, adouble).

  • Fixed small bug when saving 2D plot templates (domainIndexes are reset by the ChooseVariable dialog) causing the empty list in the json template.

  • Equations and EquationExecutionInfos are not exported into MathML but Latex instead. The file size of the runtime reports is shrank from tens of mb to 100 kb. MathJax used to render Latex into html+css.

  • Equations now do not save the residual node in xml (Expression tag) since it was not used anywhere and required huge files.

  • Greek html symbols (i.e. &lambda;) are converted into the Latex (i.e. lambda).

  • Other small updates/fixes.

23 November 2016

New: Chemical Engineering Examples

Added a new section Chemical Engineering Examples to the documentation:

  • CSTR
  • Plug Flow Reactor
  • Binary distillation column
  • Batch crystalliser
  • Discretised Population Balance equations solved using high-resoluton upwind scheme with flux limiter
  • Li-ion battery (porous electrode theory by J.Newman and coworkers)
  • Porous membrane model employing Generalised Maxwell-Stefan equations
  • More details: Chemical Engineering Examples.

16 November 2016

Updated tutorials

All tutorials has been updated with the more detailed descriptions, equations and plots of the results.

2 November 2016

New website

The project switched to a new website format.

21 October 2016

DAE Tools 1.6.0-beta2

The new 1.6.0-beta2 version is available. New features:

  • A major revision of the support for the Finite Elements Method (through the deal.II library).
  • New VTK data reporter (daeVTKDataReporter).
  • New boolean option in daetools.cfg: daetools.core.CheckForInfiniteNumbers. If it is on the software checks all residuals, Jacobian items and sensitivity residuals values if they are +inf, -inf or NaN.
  • adSetupVariableNode and adRuntimeVariableNode objects are stored in std::map<overall_index,node*> to reduce the memory requirements.
  • Other small updates/fixes.

29 June 2016

DAE Tools 1.5.0

The new 1.5.0 version has been released.

  • The new c++/MPI code generator. It can generate the c++ source code that contains the exported simulation, data partitioning and interprocess communication using MPI. At the moment it is in the prrof of the concept stage.
  • Updated other code generators. FMI code generator tested using the available tests.
  • New types of plots in the DAE Plotter: animated 2D plot (including the video export), user-defined plots (through user-specified python source code) and plotting of user specified data.
  • Fixed bugs in calculation of initial conditions in daeSimulation.SolveInitial() and daeSimulation.Reinitialize() functions.
  • Added global dt, d, d2, dt_array, d_array and d2_array functions that calculate time/partial derivatives.
  • Fixed LastSatisfiedCondition (was not always set)
  • boost thread uses win32 threadapi
  • All tutorials updated to work with python 3
  • Config files (daetools.cfg and bonmin.cfg) are located in daetools root directory. However, the user-defined files can be specified in the directories with the following search order: 1) $HOME/.daetools, 2) application folder, and 3) daetools folder in the python install.
  • Installation into the python virtual environments is supported. in addition, daetools can be used just by adding the daetools folder to python root.
  • All shared libraries are now in daetools/solibs directory and python extension modules use -rpath to locate them relative to the $ORIGIN.
  • Added units to data reporters/receivers and to the DAE Plotter plots.
  • Added new types of variables.
  • ChooseVariable dialog now keeps the current position in the tree for easier plotting of multiple variables.
  • install_dependencies_linux does not install python modules anymore. A new script has been added for that purpose (install_python_dependencies_linux.sh).
  • Fixed some module imports to work with both python 2 and 3.
  • Fixed bug in daeReceiverVariable.Times
  • daeSimulation.Pause() and daeSimulation.Resume() fixed.
  • daeVariable.d_array/d2_array are now deprecated.
  • A number of other small fixes and updates

8 April 2016

DAE Tools journal article

The first article on DAE Tools has been published in PeerJ Computer Science: Nikolić DD. (2016) DAE Tools: equation-based object-oriented modelling, simulation and optimisation software. PeerJ Computer Science 2:e54. doi:10.7717/peerj-cs.54.

28 December 2014

DAE Tools 1.4.0

  • Code generators for Modelica, gPROMS and c99. They can be found in daetools/code_generators. Almost all features available in daetools are supported except event ports, user defined actions, external functions and finite element objects whose equations need to be updated during a simulation.
  • Support for simulation in other simulators using standard interfaces for Co-Simulation: Functional Mockup Interface (FMI), Matlab MEX-functions and Simulink S-functions.
  • Added SimulationLoader project with c and c++ interface that can load a simulation from a python file and perform all other available operations on it. It is used by daetools_mex (Matlab MEX wrapper), daetools_s (Simulink S-function wrapper) and daetools_fmi_cs (FMI for Co-Simulation wrapper).
  • DAE Tools objects such as adouble can be used as NumPy native data type. The most of the NumPy and SciPy functions are supported.
  • New data reporters that export the simulation results to various file formats (MS Excel, hdf5, xml, json) and to Pandas data sets.
  • Added new math functions: Sinh, Cosh, Tanh, ASinh, ACosh, ATanh, ATan2, Erf and Erf to adouble/adouble_array.
  • Added Pardiso linear solver.
  • Added SimulationExplorer GUI that lists all domains, parameters, initial conditions, degrees of freedom and state transition networks.
  • Simulations can export the initialization values to JSON format (daeSimulationExplorer.generateJSONSettings, daeSimulationExplorer.saveJSOnSettings) and initialize using a JSON string (auxiliary.InitializeSimulation function). daeSimulation.Initialize accepts an optional argument jsonRuntimeSettings. daetools.cfg config file is now in JSON format.
  • Condition nodes can be exported to Latex.
  • All node classes have NodeAsPlainText and NodeAsLatex functions.
  • Added new function dictVariableValues that returns a tuple (values:ndarray, times:ndarray, domains:list).
  • Domains and parameters can now be propagated through the whole model hierarchy (daeModel.PropagateDomain() and daeModel.PropagateParameter()). All domains/parameters with the same name will have identical properties.
  • daeVariable functions SetValues, SetInitialConditions, AssignValues etc. accept NumPy arrays as arguments. Now, values and initial conditions can be set using numpy float or quantity arrays.
  • Runtime model reports show completely expanded equations now. Consequently, many adRuntimeNode-classes are deleted.
  • Functions that operate on adouble_array objects always generate setup nodes and never perform any calculations
  • All data reporters have ConnectString and ProcessName attributes.
  • Fixed bug in unit class (one day has 83400 seconds).
  • All equation can generate Jacobian expressions by setting daeEquation.BuildJacobianExpressions to True. This is useful when an expression is huge and contains a large number of variables. Calculation of a Jacobian for such equation would take a very long time. Generation of Jacobian expressions will increase the memory requirements but may tremendously decrease the computational time. They are stored in daeEquationExecutionInfo.JacobianExpressions and the equation execution infos are stored in daeEquation.EquationExecutionInfos.
  • daeConfig first looks for config files in /etc/daetools and then in HOME/.daetools directory. If it can’t find any config file it remains empty and consequently the defaults are used.
  • Added operator ~ (logical NOT) to adouble class.
  • Fixed bug in unit::toString function.
  • Other small improvements and minor bugs fixes

1 October 2014

DAE Tools 1.3.0-beta3

  • Fixed bug in 3D plot
  • Functions Sum, Product, Average, Min, Max, d, dt moved to the global namespace
  • adouble_array objects can be manipulated from python now. Two new static functions are added to adouble_array: FromList and FromNumpyArray which take as an argument a list/ndarray of double objects and return adouble_array. Several new functions were added: __len__, __getitem__, __setitem__, items
  • Functions GetNumpyArray from daeVariable, daeParameter and daeDomain replaced with npyValues attribute.
  • Added new function to daeVariable: GetDomainsIndexesMap
  • Added new attributes to daeVariable: npyIDs, npyValues, npyTimeDerivatives
  • operator() in daeDomain does the same as operator[]
  • Equations have EquationType attribute
  • daeModel has GetModelType function that returns one of: eSteadyState, eDynamic, eODE
  • Added operators +=, -+, *= and /+ to adouble
  • Added new constructors to adouble and adouble_array
  • All python wrapper classes have updated __str__ and __repr__ functions
  • New documentation in Sphinx
  • Removed daeStateTransition class from pyCore Added a new class daeOnConditionActions
  • Changed ON_CONDITION function and now accepts a list of tuples (STN_Name, State_Name). This way an unlimited number of active states can be set
  • Added some unit tests
  • Folders daePlotter and daeSimulator renamed to dae_plotter and dae_simulator Many other files renamed to lower case names
  • Fixed bug with nested STNs and IFs
  • Updated daetools.xslt and daetools-rt.xslt files
  • Added LastSatisfiedCondition to daeSimulation class that returns the condition that caused a discontinuity
  • daeDataReporterProcess renamed to daeDataReceiverProcess. Added new attributes: dictDomains and dictVariables to enable access to the results through dictionary like interface. The same attributes added to daeDataReporterLocal
  • Implemented daeTCPIPLog and daeTCPIPLogServer
  • Added daeDelegateLog with the same functionality as daeDelegateDataReporter
  • Added new tutorials and optimization tutorials
  • Fixed bugs in SaveAsMathML functions for some nodes
  • Added function array to daeDomain
  • Fixed bug in units for constraints and objective function. Now they have the same units as their residual function
  • New functions in daeOptimization: StartIterationRun and EndIterationRun
  • Added a new argument ‘name’ to daeEquation.DistributeOnDomain function. Now distribution domains can have a user-defined names
  • Options for IDA solver can be set through daetools.cfg config file
  • Fixed bug in the eQuasySteadyState initialization mode in daeSimulation
  • Function DeclareEquations must be called from derived-classes’ DeclareEquations function
  • Unit consistency test can be switched on or off for individual equations through CheckUnitConsistency attribute in daeEquation class
  • Added functions to daeIDAS DAE solver: OnCalculateResiduals, OnCalculateJacobian, OnCalculateConditions, OnCalculateSensitivityResiduals, and new attributes: Values, TimeDerivatives, Residuals, Jacobian, SensitivityResiduals
  • Fixed but in initialization of the DAE system where discontinuities were not properly handled
  • Fixed bug in daeSimulation.Reinitialize function where the root functions were not being updated
  • Fixed bug with taking the variables’ indexes from quations located in STN or IF blocks, causing the Jacobian matrix to be invalid in certain cases
  • Fixed bug in daeExternalFunction_t related to processing of adouble_array type of arguments
  • Added new node class: adSetupCustomNodeArray and new static functions to adouble_array: FromNumpyArray and FromList that create adouble_array object from the given list/ndarray of adoubles with setup nodes. Useful when using daetools array functions on arrays of adoubles that are a product of numpy operations.
  • Implemented daeVectorExternalFunction
  • Added EstLocalErrors and ErrWeights functions to daeIDAS dae solver
  • IDAS solver now takes abs. tolerances from the daetools.cfg config file
  • Fixed memory leaks with smart pointers (in boost::intrusive_ptr)
  • Fixed but with the reset of DAE solver during optimization
  • Now before every optimization iteration the initialization file is loaded
  • Added daeFiniteElementModel and daeFiniteElementEquation classes
  • Added pyDealII FE solver
  • Added daeSimulationExplorer
  • Other small improvements and minor bugs fixes

11 October 2012

Bug fixes

  • 3D plot bug fix when detecting free domains (by Caleb Huttingh)

14 June 2012

DAE Tools 1.2.1

List of changes/new features:

  • Integration speed improvements (more than an order of magnitude, in some cases); no need for a memory copy from/to the DAE solver, a better integration step control and an option to avoid sparse matrix re-creations after a discontinuity
  • A new option added to the daetools.cfg config. file: resetLAMatrixAfterDiscontinuity; it applies only to sparse matrix LA solvers; if true LA solvers will recreate sparse matrix each time a discontinuity is detected (since the sparsity pattern might be changed); if false the DAE solver will create a single sparse matrix that includes a sparsity pattern from all states so that there is no need to recreate matrix each time a discontinuity is located; this obviously introduces higher memory requirements but brings significant integration speed improvements
  • SuperLU LA solver can choose between two modes of reusing the factorization information from the previous steps: SamePattern and SamePattern_SameRowPerm (for more info see the superlu documentation); a new option added to the daetools.cfg config. file: factorizationMethod which can have one of the values above
  • SuperLU LA solver can be instructed to create all the memory it needs at the beginning of simulation; this can be controlled in the daetools.cfg file by setting the useUserSuppliedWorkSpace option to true and adjusting the workspaceSizeMultiplier and workspaceMemoryIncrement options (for more info see the superlu ocumentation)
  • Added support for units; variables, parameters, domains must have a numerical value in terms of a unit of measurement (quantity) and units-consistency is strictly enforced (although it can be switched off in the daetools.cfg config file); added three new classes: base_unit, unit and quantity and a new module: pyUnits
  • A new option added to the daetools.cfg config. file: checkUnitsConsistency; if true the system will perform units-consistency tests for equations and logical expressions during the initialization phase
  • Functions (Re)SetInitialCondition, SetInitialGuess, (Re)AssignValue in daeVariable and SetValue in daeParameter accept both floating point values and quantities; in the former case it is assumed that the value is in the units of the parameter/variable while in the later the numerical values is first converted to the parameter/variable units
  • C++ tutorials and the python modules reorganized; now c++ tutorials are in the folder cxx-tutorials while the completely new folder tree has been created for python modules: all files are in the daetools-package folder
  • Added platform specific folders for python extension modules
  • Added support for python dist-utils (the file setup.py in the daetools-package folder)
  • New functions in daeVariable: (Re)SetInitialConditions, SetInitialGuesses, (Re)AssignValues that set init. conditions, init. guesses or assign values of all points in a distributed variable
  • All constants in equations must be dimensional and assigned units; two new functions (Constant and Array) are added that create single or an array of dimensional quantities
  • Added new node class: adVectorNodeArray.
  • The functions Time and Constant moved from the daeModel class to the global namespace
  • A basic support for external functions (daeScalarExternalFunction and daeVectorExternalFunction) that can handle and evaluate functions existing in external libraries; in the future versions of daetool certain software components such as thermodynamic property packages will be supported
  • A new type of 2D plots: Animated2D plot
  • Trilinos family of LA solvers have also cDAE version
  • Added a new function to daeSimulation: CleanUpData; in case of very large systems a lot of memory can be freed and made available to the system after the initialization; this is still an experimental option
  • Array_xxx functions in daeVariable/daeParameter accept python lists and slices
  • Equations can have an optional scaling; added two new functions: GetScaling/SetScaling (the property Scaling in pyDAE)
  • Improved data reporting speed
  • Parameters values can also be reported
  • Changes in data reporting during an optimization (now all iterations are reported independently)
  • A new data reporter class: daeNoOpDataReporter; it just collects the reported values and does not do any processing (useful for building custom data reporters)
  • OnEvent function can also accept events from outlet ports
  • Enabled the option for the Lapack LA solver in Sundials IDAS
  • Mac OSX port
  • c++ (cDAE) tutorials
  • Added several new functions to the daeLog_t and a progress bar to the daeSimulator; the new functions are GetProgress/SetProgress (property Progress), GetEnabled/SetEnabled (property Enabled), GetPrintProgress/SetPrintProgress (property PrintProgress), GetPercentageDone/SetPercentageDone (property PercentageDone) and GetETA (read-only property ETA)
  • daeStdOutLog and daePythonStdOutLog print the progress information to the console
  • Fixed bug in all versions of LA solvers in cDAE (a responsibility to destroy objects and to free memory was done automatically by a DAE solver: now it is users responsibility)
  • SuperLU and SuperLU_MT now statically linked
  • Removed dependence on the system version of the boost libraries; all platforms now use the same version of the custom built boost libs (1.49.0)
  • Fixed bug in python wrappers (“pure virtual function called”) that was related to the sequence of datareporter and simulation objects instantiation
  • Updated stylesheets and xsl transformation files for model reports
  • Other small improvements and minor bugs fixes

29 September 2011

DAE Tools 1.1.2

List of new features:

  • daeObjectiveFunction, daeOptimizationVariable, and daeOptimizationConstraint classes have two new attributes (Value and Gradients). daeSimulation::Initialize function accepts an additional argument bCalculateGradients (default is false) which instructs simulation object to calculate gradients of the objective function and optimization variables specified in daeSimulation::SetUpSensitivityAnalysis overloaded function. These changes allow much easier coupling of daetools with some external software (as given in optimization tutorials 4 and 5).
  • New type of ports: event ports (daeEventPort class). Event ports allow sending of messages (events) between two units (models). Events can be triggered manually or as a result of a state transition in a model. The main difference between event and ordinary ports is that the former allow a discrete communication between units while latter allow a continuous exchange of information. A single outlet event port can be connected to unlimited number of inlet event ports. Messages contain a floating point value that can be used by a recipient; that value might be a simple number or an expression involving model variables/parameters.
  • A new function ON_EVENT in the daeModel class that specifies how the incoming events on a specific event port are handled (that is the actions to be undertaken when the event is received; class: daeAction). ON_EVENT handlers can be specified in models and in states so that the actions executed when the event is trigerred can differ subject to the current active state. Four different types of actions can be specified:
    • Change the active state in the specified state transition network
    • Trigger an event on the specified outlet event port
    • Reassign or reinitialize a value of the specified variable
    • Execute the user-defined action (users should derive a new class from daeAction and overload the function Execute)
  • A new way of handling state transitions: the function ON_CONDITION in daeModel that specifies actions to be undertaken when the logical condition is satisfied. The same types of actions as in the function ON_EVENT are supported. The old function SWITCH_TO is still supported but the new one should be used for it is much flexible.
  • Non-linear least square minimization with daeMinpackLeastSq (scipy wrapper of Levenberg-Marquardt algorithm from Minpack)
  • Examples of DAE Tools and Scipy interoperabilty (scipy.optimize.fmin, scipy.optimize.leastsq)
  • Fixed sensitivity calculation in steady-state models. There was no bug in the previous versions, but if the objective function or constraint did not explicitly depend on some of the optimization variables the calculated sensitivity for these variables was zero.
  • Developed shell scripts to compile third party libraries (Sundials IDAS, SuperLU/SuperLU_MT, Trilinos, Bonmin, and NLopt), DAE Tools core libraries and boost.python extension modules (compile_libraries_linux.sh, compile_linux.sh).
  • The new function time in daeModel class; it returns adouble object with the current time elapsed in the simulation that can be used in define equations’ residuals.
  • The new property ‘ReportingTimes’ in daeSimulation class that returns time points when data should be reported.
  • Fixed bug in daePlotter when there was a variable and a port with the same name within the model. Now a port and a variable can have the same name.
  • Some of the tutorials are available in c++ (cDAE) too.
  • Because of the way how the standard c++ library handles the ‘’std::vector’ internal memory storage the memory requiremens could possibly grow rather high for large models. That is fixed now and vectors will not demand more memory than required for elements storage; that is achieved by explicitly allocating memory for all elements and comes with some penalties (small speed loss during the creation of the system, approximately 1%; however, the system creation time is very low and there is no overall performance degradation).
  • Added __true_div__ and __floor_div__ functions to adouble.
  • Some API polishing

17 June 2011

DAE Tools 1.1.1

List of new features:

  • The main focus was to find and adapt a free multithreaded sparse direct solver for use with DAE Tools and it turned out that the best candidate is SuperLU_MT. As of DAE Tools v1.1.1 SuperLU (singlethreaded) and SuperLU_MT (multithreaded) are recommended linear equation solvers. All the other (Trilinos group of solvers, Intel Pardiso, ...) will remain there but with less support.
  • A set of Krylov iterative solvers has been added. Trilinos AztecOO solver with IFPACK, ML or built-in preconditioners is available. However, iterative solvers are not fully working yet and these solvers are still in an early/experimental phase.
  • As the GPGPUs become more and more attractive an effort is made to try to offload computation of the most demanding tasks to GPU. The starting point is obviously a linear equation solver and two options are offered:
    • CUSP
    • SuperLU_CUDA (OpenMP version of SuperLU_MT modifed to work on CUDA GPU devices). The solver is still in the early development phase and the brief description is given in SuperLU_CUDA. Few issues still remain unsolved and a help from CUDA experienced developers is welcomed!
  • The new NLP solver has been added (NLOPT from the Massachusetts Institute of Technology). More information about NLOPT and available solvers can be found on NLOPT wiki pages.
  • To separate NLP from MINLP problems the IPOPT is now a standalone solver.
  • All linear solvers are located in daetools/solvers directory.
  • Now all linear solvers support exporting sparse/dense matrices in .xpm image and matrix market file formats.
  • Models and ports now can be exported into some other modelling language. At the moment, models can be exported into pyDAE (python) and cDAE (c++) but other languages will be supported in the future (such as OpenModelica, EMSO, perhaps some proprietary etc...).
  • New data reporter (daeMatlabMATDataReporter) has been added that allows user to export the result into the Matlab MAT file format.
  • Operators + and - for daeDistributedEquationDomainInfo (daeDEDI) class which enable getting values/derivatives in distributed equations that are not equal to the index of the current iterator (see distillation column example for usage).
  • daeParameter/daeVariable constructors accept a list of domains (analogous to calling DistributeOnDomain for each domain).
  • Now all constraints are specified in the following way:
    • Inequality constraints: g(i) <= 0
    • Equality constraints: h(i) = 0
  • DAE Tools source code has been checked by Valgrind and no memory leaks has been detected.
  • Development of some useful models has been started. The models are located in model_library directory.
  • A set of standard variable types has been developed. Variable types are located in daeVariableTypes.py file.
  • Several minor bug fixes.