-
Notifications
You must be signed in to change notification settings - Fork 1
Home
The wiki is still under construction (08/10/2025)

NTMpy is an open source code for the simulation of the 1D Two Temperature Model (TTM or 2TM) and 1D Three Temperature Model (TTM or 3TM). These models are often used in the physics of condensed matter, and in particular for experiments of ultrafast dynamics. The typical experiment consists in heating a material sample with a short laser pulse and measuring the reflectivity variation in the next few picoseconds using the pump-probe techniques. Detailed description of the physics underneath and the experimental method can be found in literature:
Considering the general case of a multi-layer material, the mathematical models are
for the two temperature model, and
for the three temperature model. In the above equations
-
$T_E(x,t)$ ,$T_L(x,t)$ , and$T_S(x,t)$ are temperature (subscripts recall Electron, Lattice, and Spin)
-
$\rho$ is the mass density in the$i$ -th layer of material (the material properties are piecewise homogeneous)
-
$C_{Ki}$ and$k_{Ki}$ are the specific heat and thermal conductivity of the system$K = E,L,S$ in the$i$ -th layer of material
-
$G_{KHi}$ is the thermal coupling coefficient between the system$K$ and$H$ (with$K,H\in \lbrace E,L,S\rbrace$ ) in the$i$ -th layer
-
$S(x,t)$ is the energy generation/energy source
The resolution of the TTM equations often requires numerical methods. While several tools are available online (either free or paid), they generally require the user a decent programming skills or a relatively long learning time. The purpose of NTMpy is to provide a free, lightweight, and easy-to-use tool to solve the TMM equations for experimental physicist in ultrafast dynamics.
The first page of the wiki gives a quick introduction with example to both the GUI and the Python package with some simple example.
The recommended workflow for the simulation is the following:
set material properties → set source properties → run simulation → visualize results → fit parameters (if necessary)
Each step is described in a separate page of the wiki. NTMpy can be used either with a Graphical User Interface (GUI) or as Python package, writing the code you need. Each page of the guide presents the instructions for both the GUI and the Python package.
Two extra pages are present:
- Other features include other available funcions, not usually needed for the experimentalist, available in the code
- Files organization describes the folder structure of the code, in case the user wants to retrieve some specific file or just explore the code
The GUI does not require any installation. You can download the files on the repository and run on launch.py with Python to initialize the GUI. The GUI requires eel and jinja2, which can be installed using the command pip install eel[jinja2].
The other dependencies required to run the solver and visualize the results are numpy, matplotlib, bspline and tqdm. Each of these packages can be installed with the command pip install followed by the package name.
A detailed description of NTMpy methods and validation is provided in the reference paper:
NTMpy: An open source package for solving coupled parabolic differential equations in the framework of the three-temperature model
Consider that the paper refers to the ufficial release, but the version developed on this repository has new features and some functions have different names, as described in this Wiki. In the next few subsections, the mathematical methods and validation, described in the paper, are briefly summarized.
NTMpy uses a combination of finite element method (FEM), for the space discretization, and explicit Euler (EE) method, for the time evolution. The FEM uses splines as basis functions and the collocation method, i.e. impose the differential equation to be satisfied in a given set of points. The time step for the EE method is generated automatically considering the fastest modes obtainable in a realistic range of temperatures.
NTMpy validation is described in the reference paper: the validation includes comparison with analytical results for the linear case, a comparison with matlab pdepe function for the solution of the 2 temperature heat equation and with COMSOL for the transfer matrix method. Finally, NTMpy is also tested in real experiments, as reported in the reference paper.
Please, cite the code using the reference paper:
@article{alber2020ntmpy,
title={NTMpy: An open source package for solving coupled parabolic differential equations in the framework of the three-temperature model},
author = {Lukas Alber and Valentino Scalera and Vivek Unikandanunni and Daniel Schick and Stefano Bonetti},
journal = {Computer Physics Communications},
year={2021},
volume = {265},
pages = {107990},
issn = {0010-4655},
doi = {https://doi.org/10.1016/j.cpc.2021.107990},
url = {https://www.sciencedirect.com/science/article/pii/S0010465521001028}
}