softmaterialslab / nanoconfinement-md

This code allows users to simulate ions confined between material surfaces that are nanometers apart, and extract the associated ionic structure.
Apache License 2.0
5 stars 13 forks source link

Updated Files #111

Closed nasimanousheh closed 5 years ago

nasimanousheh commented 5 years ago

@jadhao and @kadupitiya

jadhao commented 5 years ago

@nasimanousheh the freq default in inhouse is 100. in lammps it is 0.001 times the total number of steps = 5000 steps? So lammps sample frequency is very different than inhouse frequency. Can you make them the same? It is hard to believe that lammps is less noisy with these settings. I suggest you make them both such that the sampling frequency for density binning is 1000 steps.

nasimanousheh commented 5 years ago

@jadhao I updated the example file for inhouse code with sampling frequency 1000. - in lammps it is 0.001 times the total number of steps = 5000 steps? The fequency sampling for Lammps must be 1000. (0.001 time step)* (the total number of steps 1000000) = 1000.

jadhao commented 5 years ago

@nasimanousheh this does fix the inhouse sampling frequency. But if you say 0.001 * total number of steps, then you get 1000 only for 1 million steps. For 5 million you will get 5000, in which case the comparison between the two approaches will not be reasonable. So you should have it static to 1000 just like the freq variable in inhouse code. Instead of passing the movie freq variable to lammps, you should pass the freq variable as the lammps movie frequency input. Then your sampling is the same no matter what steps are chosen. When you fixed the inhouse to 1000, did the comparison become more reasonable -- it should lead to comparable errorbars?

nasimanousheh commented 5 years ago

Now, the error bars (for both lammps and inhouse) are comparable. Both are in order of ~0.01. The result of inhouse with frequency sample =100 had much smaller error bars (order of ~0.001).

Instead of passing the movie freq variable to lammps, you should pass the freq variable as the lammps movie frequency input I see! in in.lammps.template, in dump setting, instead of USERINPUT_MOVIE_FRQ I should pass USERINPUT_SAMPLE_FRQ. Should I do it or @kadupitiya will do it?

kadupitiya commented 5 years ago

IMO, USERINPUT_MOVIE_FRQ is also important to pass right. We can create an additional parameter pass. Let's say USERINPUT_SAMPLE_FRQ. What about the timestep parameter?

jadhao commented 5 years ago

@nasimanousheh @kadupitiya No need to create a new variable. The key is to note that for lammps your movie freq is really the sampling freq based on how nasim has coded the script. It produces the movie which is fine, but its primary goal is to make the density profile. So the change is just: generateLammpsInputfile(ein, mdremote.freq, mdremote.hiteqm, (mdremote.steps - mdremote.hiteqm)); that is I replace passing mdremote.moviefreq with mdremote.freq @nasimanousheh should do the change as she is comparing the 2 methods. and she would know if this is the only place the change needs to be or more places. @kadupitiya can oversee if this makes sense.

for timestep, that could be hard coded in both approaches for now. @nasimanousheh should confirm if 0.001 is a good choice for all the parameter choices. We know 0.0005 works as this has been tested. Does 0.001 work for 3:1 system? If unsure, revert and default to 0.0005, otherwise 0.001 is fine.

kadupitiya commented 5 years ago

@jadhao: Yeah that makes sense. But apart from this issue, we do need to pass the time step as well right?

jadhao commented 5 years ago

@kadupitiya I reverted back to 0.0005 as dt. It is default in inhouse and also in lammps. Dont think we need to pass this. Assuming this is not changed in the simulation outside of its initial setting, we should be good to go. I will request an install this afternoon.

kadupitiya commented 5 years ago

@jadhao: Please wait until I send a PR with an updated notebook. This would be for walltime issue. Thank you.