- Posts: 2
- Thank you received: 0
kMC Simulation Transition and Timing Discrepancy
- pkomen
- Topic Author
- Offline
- User
Less
More
2 weeks 3 days ago #27
by pkomen
kMC Simulation Transition and Timing Discrepancy was created by pkomen
Dear Admin,
I am setting up a kinetic Monte Carlo (kMC) simulation using Zacros and require assistance with transitioning from the equilibration phase to the production run. Specifically, I would like to equilibrate the system for 20,000 seconds and then continue with a production run for an additional 1,000 seconds to analyze surface coverage and calculate the turnover frequency (TOF).Based on the manual, one method I encountered is using the
file, which allows Zacros to read the final configuration from the equilibration phase and use it as the starting point for the production run. Could you confirm if this is the correct approach?I attempted an alternative by specifying a stop criterion at 20,000 seconds and allowing Zacros to write a
file. I then adjusted the simulation input for the production run to 1,000 seconds and ran it in the directory containing the
file. However, the simulation did not continue and instead returned the error: "Attempted to restart already finished simulation."Are there any alternative methods within Zacros for handling the transition from equilibration to production, or is using the
file the most effective solution?Another question I have is regarding the calculation time: Is it normal to observe significant differences (e.g., 1-3 days) in computation time when using different random seeds, even for the same system setup?
Thank you.
I am setting up a kinetic Monte Carlo (kMC) simulation using Zacros and require assistance with transitioning from the equilibration phase to the production run. Specifically, I would like to equilibrate the system for 20,000 seconds and then continue with a production run for an additional 1,000 seconds to analyze surface coverage and calculate the turnover frequency (TOF).Based on the manual, one method I encountered is using the
Code:
state_input.dat
Code:
restart.inf
Code:
restart.inf
Code:
state_input.dat
Thank you.
Please Log in or Create an account to join the conversation.
- hprats
- Offline
- Admin
Less
More
- Posts: 4
- Thank you received: 1
1 week 6 days ago - 1 week 6 days ago #28
by hprats
Replied by hprats on topic kMC Simulation Transition and Timing Discrepancy
You don't need to run two separate simulations for equilibration and production. If you want to consider that the first 20,000 seconds correspond to equilibration, and the next 1,000 seconds correspond to production, you can simply run a single simulation with a stopping criteria of 21,000 seconds. Then, when computing the coverages and TOFs, you can ignore the data corresponding to the first 20,000 seconds.
Your restart attempt probably failed because in the 'production' run you specified a stopping criteria of 1,000 seconds, but the current KMC time was 20,000 seconds (i.e. higher than the stopping criteria), so Zacros thinks that the simulation has finished.
Note that you can not control how long the equilibration phase will take, so always check that the system has reached quasi-steady-state before computing any average. One way to do that is to check that the lattice energy fluctuates over a certain value with time and that the simulation time increases linearly with the number of KMC steps performed. In your case, if the system has reached quasi-steady-state after e.g. 5,000 seconds, then it is better to compute the averages for the last 16,000 seconds (21,000 - 5,000) rather than only from the last 1,000, to have more sampling.
Finally, to compute the TOF and averages you can use ZacrosTools, a Python library to work with Zacros ( zacrostools.readthedocs.io/en/latest/ ). With ZacrosTools, you can read the output of your simulation and extract the data for any time window, e.g.
Your restart attempt probably failed because in the 'production' run you specified a stopping criteria of 1,000 seconds, but the current KMC time was 20,000 seconds (i.e. higher than the stopping criteria), so Zacros thinks that the simulation has finished.
Note that you can not control how long the equilibration phase will take, so always check that the system has reached quasi-steady-state before computing any average. One way to do that is to check that the lattice energy fluctuates over a certain value with time and that the simulation time increases linearly with the number of KMC steps performed. In your case, if the system has reached quasi-steady-state after e.g. 5,000 seconds, then it is better to compute the averages for the last 16,000 seconds (21,000 - 5,000) rather than only from the last 1,000, to have more sampling.
Finally, to compute the TOF and averages you can use ZacrosTools, a Python library to work with Zacros ( zacrostools.readthedocs.io/en/latest/ ). With ZacrosTools, you can read the output of your simulation and extract the data for any time window, e.g.
Code:
from zacrostools.kmc_output import KMCOutput
kmc_output = KMCOutput(path='.', window_percent=[20000/21000*100, 100], window_type='time')
Last edit: 1 week 6 days ago by hprats.
The following user(s) said Thank You: pkomen
Please Log in or Create an account to join the conversation.
- Admin
- Offline
- Admin
Less
More
- Posts: 9
- Thank you received: 2
1 week 5 days ago - 1 week 5 days ago #29
by Admin
Replied by Admin on topic kMC Simulation Transition and Timing Discrepancy
Following up on hprats's response, it's worth highlighting that, if a restart.inf file exists in the directory, Zacros will read data from this file only, and will disregard any information in the other input files (*_input.dat). Thus, you are not supposed to modify any of the input files if you are resuming a simulation.
However, you can override the final simulation time from the command line (see section "Command-Line Arguments" in the manual), with the option: --max_time, for example:
In this case, you should see the following line written in general_output.txt:
The simulation will proceed up to the specified time (or until the maximum steps, or walltime specified in simulation_input.dat has been reached).
However, you can override the final simulation time from the command line (see section "Command-Line Arguments" in the manual), with the option: --max_time, for example:
Code:
C:\KMC\Zacros.exe --max_time=21000
In this case, you should see the following line written in general_output.txt:
Code:
Max simulated time overwritten from commandline: 21000.000000000000
The simulation will proceed up to the specified time (or until the maximum steps, or walltime specified in simulation_input.dat has been reached).
Last edit: 1 week 5 days ago by Admin.
The following user(s) said Thank You: pkomen
Please Log in or Create an account to join the conversation.
- pkomen
- Topic Author
- Offline
- User
Less
More
- Posts: 2
- Thank you received: 0
3 days 1 hour ago #30
by pkomen
Replied by pkomen on topic kMC Simulation Transition and Timing Discrepancy
Thank you so much for your suggestions earlier. Now, I am encountering an issue related to lattice energy trends in my independent simulations using different random seeds. In some simulations, the lattice energy fluctuates as expected over time. However, in others, I observe a steady increase in lattice energy, even though the system and parameters remain the same. Please see the attached PNG file belowI am trying to understand whether this behavior is indicative of a potential problem with the simulation, such as:
- Insufficient equilibration time
- Numerical instabilities
- Possible seed-specific artifacts
Please Log in or Create an account to join the conversation.
- hprats
- Offline
- Admin
Less
More
- Posts: 4
- Thank you received: 1
3 days 31 minutes ago - 3 days 30 minutes ago #31
by hprats
Replied by hprats on topic kMC Simulation Transition and Timing Discrepancy
The time (or KMC steps) needed for equilibration can vary from one seed to another. However, in this case it seems that the top simulation is trapped in a configuration with a normalised energy of approx -0.392 (units?), while the bottom simulation reaches this configuration but then escapes and seems to transition to another one with a normalised energy of about -0.378 (presumably). Could you share the simulation files to have a closer look at this issue? In any case, it would be worth running additional replicas and for longer times.
Last edit: 3 days 30 minutes ago by hprats.
Please Log in or Create an account to join the conversation.
Time to create page: 0.570 seconds