Font Size: a A A

Comparison Of Computational Efficiency Of Three Programming Languages In N-body Simulation

Posted on:2022-06-11Degree:MasterType:Thesis
Country:ChinaCandidate:J N PanFull Text:PDF
GTID:2480306485956159Subject:Electronics and Communications Engineering
Abstract/Summary:PDF Full Text Request
The problem of the motion of N particles in space under the action of universal gravitation is called N-body problem,which is one of the most basic problems in astrophysics,hydrodynamics and molecular dynamics and also an important field of big data simulation.N-body simulation is the solution of N-body problem by numerical simulation.It is not only a main method to study the evolution of the universe and the composition of celestial bodies,but also an effective way to study molecular dynamics.In addition,N-body simulation is a way to explore the universe.It can simulate some experiments in astronomy that can not be operated in practice,and also test the computer ability.Therefore,it has high research value.This paper uses three programming languages to simulate N-body processes,and compares the computational efficiency of different programming languages.The purpose is to find a suitable programming language for N-body simulation,so as to improve the research efficiency of the problem,promote the N-body simulation research,increase the research population of N-body problems,and promote the research of N-body problems.The traditional N-body simulation calculation method is more complex,and it needs to master programming skills and reserve a lot of astrophysical knowledge,which leads to the immobilization of people and the slow progress of N-body simulation research.Therefore,in order to promote N-body simulation efficiently,simply and cheaply the codes,this project adopts PP algorithm.This simplifies the N-body simulation program without affecting the calculation efficiency and accuracy.For the simulation of N-body problem,there are many optional programming languages.This work takes into account the research field,users,language characteristics,programming advantages and other factors.Finally,three programming languages FORTRAN,C,python are chosen to carry out the comparative experiment of N-body simulation.Firstly,this paper summarizes several common N-body simulation algorithms,and introduces the basic principle of PP algorithm.Secondly,in order to integrate the N-body simulation effectively,this paper designs the fourth-order force polynomial by referring to the difference scheme,independent time step,neighborhood algorithm and K-S regularization,to balance the efficiency and accuracy of the algorithm.In this paper,through the N-body simulation experiments of three programming languages,the experimental results are obtained and analyzed.The potential of these three languages for N-body simulation researches are then evaluated.In order to ensure the accuracy and authenticity of the experiment,this study selects two groups of particle samples with different numbers to carry out the experiment.By comparing the calculation time,the efficiency of the calculation is analyzed.The CPU utilization of the three languages is also analyzed.It is concluded that FORTRAN is the most suitable language for the researches of N-body simulation,and Python is more suitable for working on high-performance computers.
Keywords/Search Tags:N-body simulation, numerical calculation, Particle-Particle(PP)algorithm, FORTRAN, C, Python
PDF Full Text Request
Related items