作者归档:Rocket Mao

Nature 投稿记录

虽然投nature 被拒了,但是这里也记录一下时间线,按照nature 投稿系统的排序结构,这里时间上由近到远。

Decision sent to author (Rejected) 20th September 21

Manuscript under consideration 09th Sept 21

All Reviewers Assigned 25th Aug 21

这之后editor会给corresponding author发邮件问confirmation form,顺便通知准备送审。

Editor Decision Started 26th July 21

Manuscript under consideration 23rd July 21

Editor assigned 23rd July 21

Manuscript received 22nd July 21

Manuscript under submission 22nd July 21

How to Run Matlab with Visual Studio Code (vs code)

visual studio code 与matlab的配置方法

In order to have a more decent program editor for windows, I try to use vs code to write the m file for Matlab, however, I cannot run it in vs code. Then I start to search for a way to run Matlab script in vs code. Because of the updates of the vs code and related plugins, it takes me about one hour to figure out how to do this. I have read a Chinese tutorial, which is helpful but not enough. Here, I try to list the key steps for the configuration in vs code.

First, install plugins: Code runner (publisher:”Jun Han”), Matlab (publisher:”Xavier Hahn”), Matlab-formatter (publisher:”AffenWiesel”). Just choose the most popular one. Here, matlab-formatter is not necessary.

Second, modify the settings.json of vs code. the file of the setting.json is located in “C:\Users\Rocket\AppData\Roaming\Code\User\settings.json” if you install the vs code in the default directory. The modification parts are highlighted below. You may install Matlab in other folders that you need to change the related path as well.

    "python.pythonPath": "C:\\Program Files\\WindowsApps\\PythonSoftwareFoundation.Python.3.9_3.9.1776.0_x64__qbz5n2kfra8p0\\python3.9.exe",
    "editor.renderControlCharacters": true,
    "workbench.editorAssociations": {
        "*.ipynb": "jupyter-notebook",
        "*.m": "default"
    "python.languageServer": "Pylance",
    "auto-build.defaultEnv.name": "STM32F103RET6_creality",
    "security.workspace.trust.untrustedFiles": "open",
    "python.defaultInterpreterPath": "C:\\Program Files\\Python39\\python.exe",
    "diffEditor.renderSideBySide": false,
    "matlab.matlabpath": "C:\\Program Files\\MATLAB\\R2021a\\bin\\matlab.exe",
    "matlab.mlintpath": "C:\\Program Files\\MATLAB\\R2021a\\bin\\win64\\mlint.exe",
    "matlab.linterEncoding": "utf8",
    "code-runner.runInTerminal": true,
    "code-runner.executorMapByFileExtension": {
        ".m" :"cd $dir && matlab -nosplash -nodesktop -r $fileNameWithoutExt",
        ".vb": "cd $dir && vbc /nologo $fileName && $dir$fileNameWithoutExt",
        ".vbs": "cscript //Nologo",
        ".scala": "scala",
        ".jl": "julia",
        ".cr": "crystal",
        ".ml": "ocaml",
        ".exs": "elixir",
        ".hx": "haxe --cwd $dirWithoutTrailingSlash --run $fileNameWithoutExt",
        ".rkt": "racket",
        ".scm": "csi -script",
        ".ahk": "autohotkey",
        ".au3": "autoit3",
        ".kt": "cd $dir && kotlinc $fileName -include-runtime -d $fileNameWithoutExt.jar && java -jar $fileNameWithoutExt.jar",
        ".kts": "kotlinc -script",
        ".dart": "dart",
        ".pas": "cd $dir && fpc $fileName && $dir$fileNameWithoutExt",
        ".pp": "cd $dir && fpc $fileName && $dir$fileNameWithoutExt",
        ".d": "cd $dir && dmd $fileName && $dir$fileNameWithoutExt",
        ".hs": "runhaskell",
        ".nim": "nim compile --verbosity:0 --hints:off --run",
        ".csproj": "dotnet run --project",
        ".fsproj": "dotnet run --project",
        ".lisp": "sbcl --script",
        ".kit": "kitc --run",
        ".v": "v run",
        ".vsh": "v run",
        ".sass": "sass --style expanded",
        ".cu": "cd $dir && nvcc $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt"

The third step, save the JSON files and try to run the Matlab file in vs code.

To use matlab-formatter, you need to right-click the open m file and choose the command ” format document”.

the running window is as follows:

The drawback of this method is that the running result will show up in a new window rather than in the terminal of vs code. And also be careful of the name of the running script, the program (Matlab ) may run the script with the same name but in a different folder.

after using this several times, it is not convenient. it is better to editor the script with vs code but run the script in Matlab GUI, then no need to close the pop-up windows. The MathWorks company should do something, even the live script is developed, but not convenient to use.

A review of 3d printer, Ender5 pro from Creality 3D

Recently buy the Ender5 pro, a very cheap version, and only 299 euros from 3Djake.at. The frame of the 3D printer is very solid, no complaints.

Do a simple modification of the 3D printer and update the printer with a BLTouch sensor and use a Raspberry Pi (with Octoprinter) to control it.

Because the motherboard is V4.2.2 which is special and it costs some time to figure out how to connect the BLtouch with the 3D printer. We change the firmware with Marlin. Before this mode, I also install the BLtouch with CR-10S which is simpler. And be careful of the compatibility between the Marlin Version and the build environment. For the Ender 5 pro, you need to use PlatformIO. I suggest using Microsoft visual studio code with the Marlin plugin (quite easy to modify).

Marlin Version Platform(s)Instructions

1.1.x or 2.x8-bit AVRInstall Marlin with Arduino IDE

1.1.9 or 2.x8-bit AVR, 32-bit ARMInstall Marlin with PlatformIO

2.0LPC1768 (Re-Arm)Install Marlin on Re-ARM


The print bed is very nice, easy to clean, and also easy to remove the printed parts. however, because of the open-frame design, sometimes the 3D printer will have trouble reaching a high temperature, especially for the bed. One suggestion is not to turn the side cooling fan on if the temperature of the printing head is higher than 250 degrees.

The bearings for the z-axis threaded rod are low quality which generates a lot of high-frequency noise. By lubricate with some oil, the noise is released. a similar problem can be found in https://forums.creality3dofficial.com/community/ender-55pro/ender-5-pro-noisy-bearings/.

One bad thing for this printer is once there is an error from the printer, for example when the bed loses too much heat, the printer will shut down and generate an extremely loud warning sound also the connection between the Octoprinter is cut off. A full restart is required to reboot the 3D printer meanwhile the raspberry Pi needs disconnecting from the 3D printer. After the 3D printer works again, then plug the raspberry Pi into the 3D printer and reconnect the printer with the Octoprinter. A little bit sad about this design and don’t want to change it at this moment by myself. with the older CR-10s, when there is an error, the printer will restart by itself and just need to reconnect the Octoprinter with the 3D printer in the browser by clicking a button.

For the printing head, we have tried both 0.4 mm and 0.2 mm nozzles. Quality is fine. 0.1 mm nozzle is not support.


没想到在外国,护照竟然过期了,还得从LINZ去WIEN 维也纳更换护照。


换护照的地点是Neulinggasse 29, 1030 Wien, 坐电梯上三楼。因为网上预约的只是一个时间段,早上或者下午。先取号,再办理业务。不得不说,中国领事馆内的时候有点吵,开放空间,三个窗口,自带喇叭,略像小型菜市场。不过工作人员都挺有耐心的。


  6、在奥地利出生、无国内户籍的中国籍未成年人因更名申请换照者,还需提供奥地利相关的市政府(Magistrat)和户籍部门(Standesamt)出具的使用新名的相关证明文件(Meldesbestaetigung und Geburtsurkunde);申请人父母出具的协商同意为子女更名的书面证明。

7. 除此之外,还需要: 回邮服务申请表,贴有邮票的信封。具体参见末尾的回邮服务。


驻奥地利大使馆关于提供护照、旅行证回邮服务的通知2018/10/02  为进一步便利在奥中国公民申领护照、旅行证,提高领事证件服务水平,中国驻奥地利大使馆拟于2018年10月1日起(以递交申请日期为准)提供护照旅行证回邮服务。现将回邮服务有关事项通知如下:
  Maße: 120x210mm
  Standard-Umschlagformat:B/00;(信封大一点没关系,要求是能投入邮筒。A4纸大小 都是可以的)

Link intel Fortran with Abaqus 2018

配置 ABAQUS的用户子程序

My platform is listed as below

Windows 10 Pro 21H1
Device name DESKTOP-KO7EL1P
Processor AMD Ryzen 9 3950X 16-Core Processor 3.50 GHz
Installed RAM 64.0 GB
System type 64-bit operating system, x64-based processor

Software platform:
Visual studio community 2015
Intel parallel studio XE 2016 Update 1 Cluster Edition

The steps to install the software, 1. visual studo, 2 intel, 3 ABAQUS
when installing intel, please make sure that installing all the components, especially intel 64. Generally, the intel stdio will connect the visual studio during installment (you can even specify the version of studio to link during the installment)

After installing all the software, change the file (abq2018.bat) in the fold(: C:\SIMULIA\Commands as follows:

@call "C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.1.146\windows\bin\ifortvars.bat" intel64 vs2015
@echo off
set ABA_COMMAND=%~nx0
"C:\SIMULIA\CAE\2018\win_b64\code\bin\ABQLauncher.exe" %*

The subroutine in ABAQUS should work now.

Simulation of dielectric elastomer with ABAQUS


Finite element for the dielectric elastomer. 

When I studied the dielectric elastic, there are not so many ways to simulate the dielectric elastomer. The only way to do it is using a UMAT[1] which is written by Xuanhe Zhao [1]. However, it is not easy to reprogram it, especially since the hyperelastic model is complex, for example, the Gent model. Of course, there is a lot of ways to solve this problem. But it is so difficult for entry-level research who is not familiar with the numerical program. In 2014, I started to know the problem: wrinkle of dielectric elastomer. I have tried with Xuanhe’s UMAT, but it does not work well. I also reprogram it with the Mooney-Rivlin model, but still not work well with my wrinkle problem. I think it is because of the large strain of the dielectric elastomer. And As in the UMAT, I need to build the Jacobian matrix (DDSDDE) which is very difficult.

Then Wei hong introduces a method using a new subroutine called UANISOHYPER_INV, which is very easy to program and can be easily programmed with different hyperelastic models, also using the build-in function of ABAQUS. All the theoretical background is provided in our paper [3]. In the paper, we did not show the details, here, I would describe a little bit how to use this method.

1. Create a material, but don’t add anything

2. Model-\textgreater Edit Keywords
Find the material you just defined. “Add After” *Material, name=…
Add the following 2 lines:



The second line defines two material parameters, the modulus, and the nominal electric field (voltage/original thickness). This example is for gent model that shear modulus=20.62e3, permittivity= 3.983e-11, stretch limit (J), 220

3. Create a section, a part … and all regular stuff

4. Model-\textgreater Edit Keywords Find the part of EAP, Add the following 3 lines before *Element, type=…


1, 0, 0, 1, 1, 0


0, 0, 1

This defines a local coordinate system: x in the 100 direction, y in the 010 direction, and 0 rotation (second line)
The last line means the electric field is applied in the z-direction of the local system.
for cylindric system we should define the z-axis


0, 0, 0, 0, 1, 0


0, 0, 1

5. Find the section you created, add the following keyword to the same line of *Solid Section, …
This would assign the direction defined in step 4 to this section

6. Create a job and add the Fortran file as the user subroutine


Please cite our paper [3], if you would like to use this method.

1. UMAT is a subroutine in ABAQUS
2. Zhao, X., and Suo, Z., 2008, “Method to analyze programmable deformation of dielectric elastomer layers,” Applied Physics Letters, 93(25), p. 251902.
3. Mao, G., Hong, W., Kaltenbrunner, M., and Qu, S. (May 19, 2021). “A numerical approach based on finite element method for the wrinkling analysis of dielectric elastomer membranes.” ASME. J. Appl. Mech. doi: https://doi.org/10.1115/1.4051212

code: the first zip file is the subroutine (UANISOHYPER_INV) for the Mooney-Rivlin model, also an input file is added as an example. The second zip file is the subroutine (UANISOHYPER_INV ) for the Gent model and the neo_Hookean model.