{"id":18686218,"url":"https://github.com/mateuszk098/argon-molecular-dynamics","last_synced_at":"2025-11-07T23:30:34.175Z","repository":{"id":143199742,"uuid":"504131408","full_name":"mateuszk098/argon-molecular-dynamics","owner":"mateuszk098","description":"Simulation of molecular dynamics for the argon gas.","archived":false,"fork":false,"pushed_at":"2022-10-25T15:14:39.000Z","size":11171,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-28T00:42:43.382Z","etag":null,"topics":["cpp","molecular-dynamics","physics-simulation","simulation","visualisation"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mateuszk098.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-16T11:38:10.000Z","updated_at":"2023-12-10T15:09:26.000Z","dependencies_parsed_at":"2023-06-03T18:45:36.484Z","dependency_job_id":null,"html_url":"https://github.com/mateuszk098/argon-molecular-dynamics","commit_stats":null,"previous_names":["mateuszk098/argon-molecular-dynamics"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mateuszk098%2Fargon-molecular-dynamics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mateuszk098%2Fargon-molecular-dynamics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mateuszk098%2Fargon-molecular-dynamics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mateuszk098%2Fargon-molecular-dynamics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mateuszk098","download_url":"https://codeload.github.com/mateuszk098/argon-molecular-dynamics/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239541851,"owners_count":19656102,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","molecular-dynamics","physics-simulation","simulation","visualisation"],"created_at":"2024-11-07T10:26:39.081Z","updated_at":"2025-11-07T23:30:34.140Z","avatar_url":"https://github.com/mateuszk098.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# **Argon Molecular Dynamics**\n\n![GitHub last commit](https://img.shields.io/github/last-commit/mateuszk098/Argon-Molecular-Dynamics)\n\n**That is a simple molecular dynamics simulation for one type of atom (especially Argon) interacting with van der Waals' forces. One may observe the solid \u0026rarr; gas phase transition and investigate thermodynamical properties that characterise the gas state.**\n\n## **What is Molecular Dynamics?**\n**Referring to Wikipedia:**\n\n_**\"Molecular dynamics (MD) is a computer simulation method for analyzing the physical movements of atoms and molecules. The atoms and molecules are allowed to interact for a fixed period of time, giving a view of the dynamic \"evolution\" of the system. In the most common version, the trajectories of atoms and molecules are determined by numerically solving Newton's equations of motion for a system of interacting particles, where forces between the particles and their potential energies are often calculated using interatomic potentials or molecular mechanics force fields.\"**_\n\n**More about [Molecular Dynamics](https://en.wikipedia.org/wiki/Molecular_dynamics#:~:text=Molecular%20dynamics%20(MD)%20is%20a,%22evolution%22%20of%20the%20system.).**\n\n\n## **What this offers?**\n- **Simulation of dynamics for an any ideal gas which satisfies the ideal gas law and the Maxwell-Boltzmann distribution.**\n- **Simulation of melting the crystals.**\n- **Calculations of fundamental properties of the system.**\n- **Observations of simulations may be provided by an open-source viewer [Jmol](http://jmol.sourceforge.net/).**\n\n**More about [Maxwell-Boltzmann Distribution](https://en.wikipedia.org/wiki/Maxwell%E2%80%93Boltzmann_distribution) and [Ideal Gas Law](https://en.wikipedia.org/wiki/Ideal_gas_law).**\n\n## **Units used in the system:**\n- **Length: 1 nm (10\u003csup\u003e-9\u003c/sup\u003e m).**\n- **Time: 1 ps (10\u003csup\u003e-12\u003c/sup\u003e s).**\n- **Mass: 1 u (1.66 x 10\u003csup\u003e-27\u003c/sup\u003e kg).**\n- **Temperature: 1 K.**\n\n## **How to use?**\n**The primary program control is done by setting the system parameters.**\n**Parameters to set in program:**\n\n- **n - Number of atoms along the crystal edge (default 6).**\n- **m - Atomic mass (default 40.0 - Argon).**\n- **e - Minimum of the potential (default 1.0).**\n- **R - Interatomic distance for which occurs minimum of the potential (default 0.38).**\n- **k - Boltzmann constant (default 8.31e-3).**\n- **f - Elastic coefficient of sphere which confines molecules (default 1e4).**\n- **L - Radius of sphere which confines atoms (default 6.0).**\n- **a - Interatomic distance (default 0.38).**\n- **T0  - Initial temperature (default 1e4).**\n- **tau - Simulation time step (default 1e-3).**\n- **So - Initial number of steps for thermalization of the system (default 5000).**\n- **Sd - Number of steps for mainly simulation (default 50000).**\n- **Sout - Interval with which information about the system are saved (default 500).**\n- **Sxyz - Interval with which positions of the molecules are saved (default 500).**\n---\n\n**C++ code to set in main file:**\n```c++\n// Usage: ./main \u003c1\u003e \u003c2\u003e \u003c3\u003e \u003c4\u003e \u003c5\u003e \u003c6\u003e \u003c7\u003e\n// Where:\n// \u003c1\u003e - input file with parameters in `Config` folder e.g. parameters.txt\n// \u003c2\u003e - output file with initial positions to save in `Out` folder e.g. r0_init.txt\n// \u003c3\u003e - output file with initial H, T, P to save in `Out` folder e.g. htp_init.txt\n// \u003c4\u003e - output file with initial momenta to save in `Out` folder e.g. p0_init.txt\n// \u003c5\u003e - output file with positions from the whole simulation to save in `Out` folder e.g. rt_sim.txt\n// \u003c6\u003e - output file with H, T and P from the whole simulation to save in `Out` folder e.g. htp_sim.txt\n// \u003c7\u003e - output file with initial momentum histogram to save in `Out` folder e.g. hist.txt\n\n// Create object first.\nArgon *A = new Argon;\n\n// Call function `setParameters()` is optional.\n// If you do not give file with own parameters, then simulation suppose default values.\nA-\u003esetParameters(argv[1]);\n\n// Call function `checkParameters()` is optional.\n// It is only to information if system is properly set.\nA-\u003echeckParameters();\n\n// Call function `initialState()` is required if you want to get to simulation.\nA-\u003einitialState(argv[2], argv[3], argv[4]);\n\n// Get absolute values of momenta, its size and calculated temperature\n// is required if you want to calculate statistics.\n// You may call this function after `initialState()` or after `simulateDynamics()`.\nusint N;\ndouble *pAbs, T, k, m;\nstd::tie(pAbs, N, T, k, m) = A-\u003egetMomentumAbs();\n\n// Call function `simulateDynamics()` is optional.\n// But obviously it is the core of entertainment and playing with the system.\n// That At the end of the simulation, the program checks if the ideal gas law is \n// fulfilled (It is if the value is around 1). Moreover, while the whole simulation,\n// the total energy should be constant.\nA-\u003esimulateDynamics(argv[5], argv[6]);\n\n// Do not forget to release memory\ndelete A;\n\n// Calculate statistics from Maxwell-Boltzmann distribution is optional.\n// That provides calculation of most probable momentum, mean momentum,\n// mean square momentum and kinetic energy. \nStats *S = new Stats;\nS-\u003esetInputFromArgon(pAbs, N, T, k, m);\nS-\u003eevaluateHist(argv[7]);\ndelete S;\n```\n\n## **Example results:**\n\n**Dynamics of 216 molecules at temperature 10\u003csup\u003e4\u003c/sup\u003e K:** | **Crystal of 15625 molecules at temperature 10\u003csup\u003e2\u003c/sup\u003e K:**\n:-------------------------------------------------:|:-------------------------------------------------:\n\u003cimg src=\"https://github.com/mateuszk098/Argon-Molecular-Dynamics/blob/master/Images/argon_gas_state.gif\" width=\"387\"/\u003e | \u003cimg src=\"https://github.com/mateuszk098/Argon-Molecular-Dynamics/blob/master/Images/argon_crystal_state.png\" width=\"387\"/\u003e\n\n\n**Momentum distribution fulfils Maxwell distribution:**\n\n\n![](https://github.com/mateuszk098/Argon-Molecular-Dynamics/blob/master/Images/15625molecules_hist.png)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmateuszk098%2Fargon-molecular-dynamics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmateuszk098%2Fargon-molecular-dynamics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmateuszk098%2Fargon-molecular-dynamics/lists"}