GithubHelp home page GithubHelp logo

ljmodel's Introduction

Lennard-Jones N Body System

Cara LYNCH Marina RUIZ SANCHEZ-ORO

2017

Overview

This program describes N-body systems interacting through the Lennard-Jones pair potential. It can be used to simulate a Lennard-Jones solid, fluid and gas.

Notes on class used

Instead of using the Particle3D class, we created a ParticleSyst class which deals with the whole system with arrays in an attempt to make the simulation more efficient. We therefore do not use our Particle3D class, but our ParticleSyst class is very similar, just deals with a whole system of particles instead of 1 particle.

A ParticleSyst instance has the following properties:

  • name: name of system as a string
  • label: labels of particles as an (N,1) Numpy array of strings (where the label of the nth particle is at label[n,0]
  • N: number of particles in the system as an integer
  • position: positions of the particles as an (N,3) Numpy array of floats (where the position of the nth particle is in position[n])
  • velocity: velocities of the particles as an (N,3) Numpy array of floats (where the velocity of the nth particle is in velocity[n])
  • mass: mass of the particles in the system (all having equal mass) as a float. The code can be modified by making this an (N,1) array and changing force calculations etc

Running the simulation

NBodySyst.py must be run using Python 3 [1]. It requires the input of a file name, which it will prompt from the user. The mass of the particles and simulation timestep are set to 1.0 and 0.01.

Input

Input format

The input file must be in the following format:

[name of system] [number of particles] [temperature] [density]

[cutoff radius] [number of steps]

All data is in reduced units.

Input files

There are 3 input files contained in our submission:

  • solid.in
  • fluid.in
  • gas.in

Output

NBodySim creates output files and plots, all in reduced units. These all have the name of system, followed by the data contained in the file, as their names.

Output files and format

  • [name of system]msd.out - file of mean squared displacement data where each line is: [timestep number] [MSD of system]
  • [name of system]rdf.out - file of radial distribution data where each line is: [radial distance of a particle from the reference particle at a certain time]
  • [name of system]energy.out - file of energy data where each line is: [timestep number] [kinetic energy of system] [potential energy of system] [total energy of system]
  • [name of system]VMD.xyz - trajectory file for plotting the system using VMD
  • [name of system]Energyevolution.png - graph of energy evolution (KE, PE and total E) of system vs timestep number
  • [name of system]Histogram.png - radial distribution function of system as a histogram, with frequency density vs radial distance from reference particle r
  • [name of system]MSD.png - graph of mean squared displacement of system vs timestep number

Output included in package

We have included 3 sets of data, all with dt=0.01 and numstep=1000:

  • Fluid
  • Solid
  • Gas

We have included 3 sets of trajectory data, rdf, msd and energy graphs, all with dt=0.01 and numstep=1000:

  • Fluid
  • Solid
  • Gas

We have additionally included trajectory data for a 10000 step fluid simulation, called Fluid10000VMD.xyz

[1] Python 3 is used instead of 2.7 as there are issues with the Python 2.7 numpy.histogram package installed in the computer lab

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.