Skip to content

CoolWorlds/panspermia

 
 

Repository files navigation

This project attempts to model the influence panspermia has on life within a multi-planet system. Using this, we can determine cases unique to systems with panspermia, showing that system has been influenced by panspermia when detected. This project uses a Poisson distribution to simulate whether an abiogenesis, panspermia, extinction event has occurred. The likelihood of each event occurring can be modified by changing tau, the average time for an event to occur once. 

Although the programs can be run without any installations, using MPI (message passing interface) is recommended for efficiency.

The DistributionFunction contains the functions to model the system of planets. Using probability functions for abiogenesis, panspermia, and extinction, it counts the number of planets inhabited at the end of each time step over the duration of the trial, then repeats the trials the number of times requested. At the end of all trials, it returns a distribution of the number of planets inhabited at a given time. The required inputs are tau for each event, number of planets, number of trials, duration of each trial, and length of each timestep.

The DistributionSimulator, with or without MPI, is the code that uses the DistributionFunction and records the results converted into probabilities. It also generates a bar chart comparing the results with and without panspermia, the blue being the case with panspermia and red without.

The parameters for the simulation can be set at the top of the DistributionSimulator code, under "variables." The array "exp" contains the exponents of the tau of each event that will be simulated. "num" is the number of planets in the system, "trials" is the number of trials FOR EACH CORE, "years" is the length of the simulation and "t_step" is length of each time step, both in Gyr. "cores" is the number of cores that will run the program.

For example, to simulate a 3-planet system over a typical planetary lifetime of 5 Gyr, evaluated every 1 Myr for tau of 0.5, 5, and 50 for each of the three events, open the DistributionWrapper, find the "variables" at the top of the page, and set "num" = 3, "years" = 5, "t_step" = 10**-3, "exp" = [-1,0,1]. To simulate 1000 trials using 2 cores (500 trials for each core), set "cores" = 2 and "trials" = 500, also under "variables." To run without MPI, use DistributionWrapperNoMPI and do the same, except there is no option for "cores" and the number of "trials" will all be run on one core.

Initiate the program by "mpiexec -n N python DistributionWrapper.py," where N is the number of cores being used, if using MPI, and by "python DistributionWrapperNoMPI.py" if NOT using MPI. 

The LinearInterpolation program uses scipy.interpolate.LinearNDInterpolate to interpolate the results of the simulations from  DistributionSimulator. The required inputs are at the top of the code, under "range." "ran" is the largest tau exponent used in the simulation (the exponents need to be symmetric, for instance if "ran" = 2, the simulations should contain tau exponent of 2 as well as -2), and "numvals" is simply 2 * "ran" + 1, the total number of exponents. The number in front of the "j" in ex,ey should also be changed to the same number as "numvals."
For example, to interpolate a set of simulations of exp = [-2,-1,0,1,2], "ran" = 2 and "numvals" = 5.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%