# Optimizing md run for a 10 to 50 ns simulation

**URL:** <https://gromacs.bioexcel.eu/t/optimizing-md-run-for-a-10-to-50-ns-simulation/1367>\
**Category:** User discussions\
**Created:** [January 1, 2021, 11:05am UTC](https://gromacs.bioexcel.eu/t/optimizing-md-run-for-a-10-to-50-ns-simulation/1367 "2021-01-01T11:05:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![UrvashiS](https://avatars.discourse-cdn.com/v4/letter/u/e47c2d/32.png) [@UrvashiS](https://gromacs.bioexcel.eu/u/UrvashiS)\
**Post date:** [January 1, 2021, 11:05am UTC](https://gromacs.bioexcel.eu/t/optimizing-md-run-for-a-10-to-50-ns-simulation/1367/1 "2021-01-01T11:05:44Z")

</div>

GROMACS version:2020.4  
GROMACS modification: Yes/No  
Here post your question

hello,  
I need advice from expert users.  
How should we optimize the md run parameters for a biomolecular protein-ligand complex \>400000 atoms to carry out final md run for 10 to 50 ns. The steps are enclosed herewith for a 10 ns simulation which has worked well but rmsd analysis after md run is in range of 5.0 Angstrom

dt=0.002  
nsteps=5000000  
nstxtcout=5000  
nstvout=5000  
nstfout=5000  
nstcalcenergy=100  
nstenergy=1000  
nstlog=1000  
and a verlett cutoff was applied.  
Your inputs are much appreciated to save the computational time and space.  
is it possible to do 10, 20 and 50 ns simulation is steps? continuing from previous steps as input?

many thanks for your advice in advance

---

<div class="post-metadata">

**Author:** ![alevilla](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/alevilla/32/439_2.png) [@alevilla](https://gromacs.bioexcel.eu/u/alevilla)\
**Post date:** [January 4, 2021, 9:36am UTC](https://gromacs.bioexcel.eu/t/optimizing-md-run-for-a-10-to-50-ns-simulation/1367/2 "2021-01-04T09:36:23Z")

</div>

Hi,

to extend a simulation run, one can generate a new tpr file using gmx convert-tpr (with options `-extend` , `-until` or `-nsteps`), and restart the simulation in the same working directory, gmx mdun will read the starting point using the checkpoint files ( .cpt).  
(look also at other posts on “restrarting” a simulation  
Best regards  
Alessandra

---

<div class="post-metadata">

**Author:** ![UrvashiS](https://avatars.discourse-cdn.com/v4/letter/u/e47c2d/32.png) [@UrvashiS](https://gromacs.bioexcel.eu/u/UrvashiS)\
**Post date:** [January 4, 2021, 11:05am UTC](https://gromacs.bioexcel.eu/t/optimizing-md-run-for-a-10-to-50-ns-simulation/1367/3 "2021-01-04T11:05:28Z")

</div>

I was wondering if I can modify the script to run it as 1 commnd?  
set cnt=1  
set cntmax=10

while ({cnt} \<= {cntmax})

if ( ${cnt} == 1 ) then

gmx grompp -f step5\_production.mdp -o step5\_${cnt}.tpr -c step4.1\_equilibration.gro -p [topol.top](http://topol.top/)

gmx mdrun -v -deffnm step5\_${cnt}

else

@ pcnt = ${cnt} - 1

@ new\_step = ${cnt} \* 1000000

sed -e “s/1000000/{new\_step}/g” step5\_production.mdp \> step5\_production\_{cnt}.mdp

gmx grompp -f step5\_production\_{cnt}.mdp -o step5\_{cnt}.tpr -c step5\_${pcnt}.gro -p [topol.top](http://topol.top/)

gmx mdrun -v -deffnm step5\_${cnt}

endif

@ cnt += 1

end
