You will certainly agree on the fact that numerical simulations have already changed the industrial daily life. Actually, it significantly decreases computational costs and delay in industrial design processes. But systems are more and more complex and contrary to what you may think, Moores’s law on increasing calculation power is false. Murphy was right, not Moore … With today’s methods, real-time applications such as test benches virtualization or training simulators are usually hard to set up. That is why new methods have appeared for modeling strongly nonlinear dynamical systems.

APHR[LowQual]Example of model reduction (method APHR)

Model reduction aims at providing a lighter surrogate model, properly describing system behaviour on a domain. From a finite element model, it consists in reducing the dimensionnality of the solution space thus allowing faster simulation. Reduction can be performed a posteriori driven by first simulation data, or a priori using specific technical experience. Visit MECASIF (french research project) website for more info here and let’s see how to do model reduction with Scilab.

Thermal model in 2D transient regime

Scilab is particularly attached to specific example. Call it … “corporate culture”. This time we will studied the example of a thermal expert and present you the cooling phase of a ceramic slab after an electrofusion process (see image below). You will find the code here. This tutorial is not about going more in technical Scilab details but to introduce you to new powerful tools and see how to move from theory to practice with Scilab. With this aim in mind, we will explain how theory is implemented through the different Scilab macros.


Note: At any moment, you can run the all script by running main.sce.

Mesh generation

In order to create the mesh, CGLAB toolbox and plotting library are required. Thus you will be able to generate mesh following a Delaunay triangulation.

[PosNoeud, Lbord, n, tri, ech] = get_mesh (nx, ny, Lx, Ly)

This function generates a nx x ny mesh of a Lx x Ly slab. It returns absolute position of each node (PosNoeud), nodes on the edges (Lbord) and the number of nodes (n). Delaunay triangulation finaly generates the following mesh (tri).


Slab modeling following a Delaunay triangulation – 100 nodes

Implementation of finite elements modeling

Let’s first see a classic implementation of heat transfer modeled by finite elements. h is the convection heat transfer coefficient and Text is the outside temperature.

[Q_dof, K, M] = thermique_transitoire (mu, n tri, PosNoeuds, Lbord, ech)

So, we wil look for the slab temperature verifying the following continuous model:

3Considering a convective heat transfer on the edges,


This allows us to determine the following finite element model


  • Mass matrix
  • Stiffness matrix
  • Forces vector

The following function’s goal is to build those matrix for every nodes.

[K, M] =assemblage (n, tri, PosNoeuds, k_th, rho, C_th)

But to do so, you will need to build your finite elements basis Ni (NEF in the code) first and compute the related Jacobian Matric ∇Nj (GEF in the code).

[we, NEF, GEF] = elemtr3dp (PosABC)

The computation is then based on an Euler implicit scheme where q(n) is the temperature at nth iteration.



This computation loop gives you the temperature evolution in the ceramic slab (see animation below) and lasts a mean time of 96ms (evaluated on 100 iterations thanks to thermique_transitoire_chrono.sci).

animationSlab cooling computated thanks to a classic finite elements method

Model Reduction – POD method

POD stands for Proper Orthogonal Decomposition or as you may know in statistics by the name Principal components analysis. This method is a linear procedure that consists in creating a reduced basis for solutions built with orthogonal normal modes. Those modes, that are significant for most probable outcomes, are chosen among others thanks to a first simulation (a posteriori method).

[V_POD, erreur_POD] = POD (Q, epsilon_POD)

In the first part of this tutorial we got the temperature evolution on the whole slab over the time. A simple computation of the eigenvalues will give you the normal modes and the change of basis matrix V_POD. In order to light the model, we will keep only the significant modes defined by the epsilon_POD parameter.

In our case, with epsilon_POD equal to 1e-3, we get 5 modes. Solutions basis is then reduced from 100 to 5 vectors with accuracy in range of 5,8e-4.


5 modes significant for the temperature evolution

[] = thermiPOD (K, M, P, tri, PosNoeuds, Lbord)

The computation is the same as you have seen previously, using the same Euler implicit Scheme transposed in reduced basis:


With Tr the temperatue in the reduced basis and P the change of basis matrix:



This computation loop gives you a pretty accurate approximation of the temperature evolution in the ceramic slab (see animation below) and lasts a mean time of 3ms (evaluated on 100 iterations thanks to thermiquePOD_chrono.sci). It is 30 times faster than a classic finite elements solving.

animationPODSlab cooling computated thanks to a reduced model (POD)


Even for such a little mesh (100 nodes), computation delay optimization is significant. Setting an efficient Design Of Experiment (DOE) may reduce a 10.000 times computation time for a posteriori methods.

Thank you to David Ryckelynck (Mines Paristech) for his significant contribution to this paper