All posts by admin

Put plots by Matplotlib to your standard

This post provide the modification for python script for plotting using matplotlib.

plt.rcParams[''] = 'Myriad Pro'
plt.rcParams['font.serif'] = 'Myriad Pro'
plt.rcParams['font.monospace'] = 'PragmataPro Mono Liga'
plt.rcParams['font.size'] = 12
plt.rcParams['axes.labelsize'] = 12
plt.rcParams['axes.labelweight'] = 'bold'
plt.rcParams['axes.titlesize'] = 10
plt.rcParams['xtick.labelsize'] = 10
plt.rcParams['ytick.labelsize'] = 10
plt.rcParams['legend.fontsize'] = 10
plt.rcParams['figure.titlesize'] = 12

Lost Desktop icons after uninstalling Komorebi on Linux Mint

Komorebi is an application that enables animations for desktop wallpapers. When uninstall Komorebi, there is a possibility that desktop will become unresponsive: desklets are still displaying but no icons, right click doesn’t show anything. To fix it, run this code in Terminal:

gsettings set org.nemo.desktop show-desktop-icons true

Thing should be fine after this.

Best way to install Node.js and NPM

I’m writing this post as I need to install node.js and npm to install packages for reveal.js, I’m on Ubuntu 18.04 Bionic.

Normally we can install node.js via terminal by

sudo apt install nodejs

But this is not the best way since the version is outdated and some dependencies won’t meet. The best way to install the latest node.js and npm is via nvm.

curl -o- | bash

Note that the version number can be checked by going directly to the website and see. The above script will download all the package and put nvm into the Linux alias (so we can use the nvm command globally). After this, log out and log in to activate the alias.

Once you log in, run below script

nvm install node

To update:

nvm install node
nvm alias default nodenvm install node
nvm alias default node

From this answer:

Math Tools

“Mathematicians do not recognize their discipline in such descriptions. We see arithmetic and algebra as tools used in doing mathematics, just as hammers and handsaws are tools used in carpentry. For professionals, mathematics is about curiosity, imagination, and solving problems. There are questions that are instinctive and natural for mathematicians that rarely occur to those looking in from the outside. There is such a thing as a mathematical view of the world. Sadly, it is a view that is too often hidden from those struggling to learn the subject.”
From the book Taking Sudoku seriously

Import mô hình 3D từ Blender vào YADE

Blender là phần mềm thiết kế 3D nguồn mở.

YADE là phần mềm mô hình phần tử rời rạc, cũng nguồn mở.

YADE có thể tạo một khối hình học 3D và hỗ trợ tương đối khiêm tốn: hình hộp, hình cầu, xi-lanh….

Tuy nhiên, những hỗ trợ căn bản của YADE nhiều lúc không phục vụ được nhu cầu thực tế của xây dựng dân dụng. Đặc biệt khi người dùng cần fill particles vào trong một khối có hình dạng ngẫu nhiên. Rất may là YADE có hỗ trợ định dạng GTS và có một công cụ giúp chuyển đổi file từ STL (một dạng file 3D thông dụng từ blender) sang GTS, đó là stl2gts. Câu lệnh để dùng rất đơn giản: ví dụ có một file cube.stl và bạn muốn đổi nó thành cube.gts, cú pháp cần gõ trong terminal như sau:

”’ stl2gts < cube.slt > cube.gts ”’

Thường thì quá trình convert diễn ra khá nhanh. Ngay khi có file gts bạn có thể import vào trong YADE bình thường vì YADE có hỗ trợ python-gts.

Some FEM-DEM coupling attempts

FEM and DEM are well-known for studying structural analysis and behavior of granular materials, respectively. There are some special cases that we wish to combine the two methods to profit all the strong points from both methods. Here  are a list of what I’ve found till the writing time of this blog post.


YADE is pretty well-known in Europe as an open-source DEM tool, written in C++ and PYTHON, and OOFEM is a FEM tool (latest version is 2017).


Also from YADE document page, the link between FEM-DEM has been made using these two tools.

Very basic at the moment, lacks some serious development.


From version 2018, EDEM shows some supports for porting to ABAQUS. To some academic members, ABAQUS is their favorite numerical tool to do structural analysis.


There is a module developed by University of Ottawa, Canada to couple FEM-DEM using YADE and COMSOL based on JAVA linking.