2D Density Calculator

71 views
Skip to first unread message

BOWEN AI

unread,
Aug 28, 2024, 5:18:48 AM8/28/24
to Tools from yuxiangwang321
Dear Professor:
       I read your article "Calculation of 1D and 2D densities in VMD: A flexible and easy-to-use code". In the second section, you used the command "dc all.psf all.dcd mass_xy 59 59 1 0 130 65 0 116 58 0 72 1 {water}" to calculate the two-dimensional mass density. Professor, this command only calculated the two-dimensional density distribution of the 59th frame. Can this tool calculate more frames and take the average value? In addition, when using the dc.tcl command to calculate the 2D mass density in the xz direction, I got many output files, which are different from your output results. When using the dc_20240617.tcl command to calculate, the y position and z position values ​​in the output results are the same value and have not changed. The code and model model.jpgI used is as follows:
       dc ../nw_silicon_sol_ions.psf ../nw_run.dcd mass_xz 4999 4999 1 -53 53 53 -53 53 53 -80 80 1 {water}
       I would be very grateful if you could kindly answer my questions.
       Yours sincerely.
Message has been deleted
Message has been deleted
Message has been deleted

Y. Wang

unread,
Sep 5, 2024, 9:45:59 AM9/5/24
to BOWEN AI, Tools from yuxiangwang321

Dear User,

Thank you for trying the code.

For your questions, here are my comments.

************************************************

In the second section, you used the command "dc all.psf all.dcd mass_xy 59 59 1 0 130 65 0 116 58 0 72 1 {water}" to calculate the two-dimensional mass density. Professor, this command only calculated the two-dimensional density distribution of the 59th frame. Can this tool calculate more frames and take the average value?

Comment: It is true, this command only calculates the density from frame 59, because the parameters “firstFrame lastFrame step” is “59 59 1”, it means it will calculate frame from frame 59 to 59 with a step of 1, see, the code only loads the 59th frame. The code does have the ability to calculate and average more frames, simply load more frames and set a proper step. For example, set “firstFrame lastFrame step” to “1 59 1”, it will average all frames from 1 to 59, also see section 4.4 in the paper for more details.

************************************************

In addition, when using the dc.tcl command to calculate the 2D mass density in the xz direction, I got many output files, which are different from your output results. When using the dc_20240617.tcl command to calculate, the y position and z position values in the output results are the same value and have not changed. The code and model I used is as follows

       dc ../nw_silicon_sol_ions.psf ../nw_run.dcd mass_xz 4999 4999 1 -53 53 53 -53 53 53 -80 80 1 {water}

Comment: Your command doesn’t calculate 2D density in xz plane since you used inconsistent parameters. When you choose “mass_xz”, please ensure that you slice x and z directions. But in your command, you sliced x by using {-53 53 53}, sliced y by {-53 53 53}, but keep z by using {-80 80 1}. So you actually didn’t slice z as you expected, instead, you sliced y. Please read section 2.2, you will know why the code generate many files, I guess you got 53 files since you slice y into 53 segments, and all the z values in all files should be the same since only one z segment, but y values should be different in different files (but same within one file).

Please try this command, it should give you the correct result.

dc ../nw_silicon_sol_ions.psf ../nw_run.dcd mass_xz 4999 4999 1 -53 53 53 -53 53 1 -80 80 80 {water}

Hope these comments help you. If you still have concerns, please feel free to response this reply. Thank you! 

Message has been deleted

BOWEN AI

unread,
Sep 11, 2024, 4:28:17 AM9/11/24
to Tools from yuxiangwang321
Thank you very much for your patient reply. According to your suggestion, I modified the calculation code and successfully obtained the two-dimensional mass density distribution in the xz direction. I would like to express my sincerest thanks to you.
Reply all
Reply to author
Forward
0 new messages