simplified by zhangbochao99 | SimScale