GithubHelp home page GithubHelp logo

aninatimmermann / eccoplanets Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 1.0 55.71 MB

Python code to simulate the formation of rocky planets in chemical equilibrium (based on Gibbs energy minimisation) and analysis of planet compositions.

License: MIT License

Python 100.00%
chemical-equilibrium planet-formation planet-composition rocky-planets

eccoplanets's Introduction

ECCOplanets

We provide a python code to simulate the formation of rocky planets in chemical equilibrium (based on a Gibbs free energy minimisation). We also provide tools for the analysis of the simulated planet. The code includes a database of thermochemical data and a database of stellar abundance patterns.

Prerequisites

The code is built in python and uses the common packages pandas, numpy and matplotlib. The samples are written to be read, used and adapted in an IDE like spyder.

required:

python
pandas
numpy
matplotlib

recommended IDE, like:

spyder

Repository Contents

The repository includes the core python files of our ECCOplanets code:

abundance_converter.py
classes.py
condensation.py
data.py
pltStyle.py
simulation.py

If you just want to use the code to run condensation simulations and analyse the results, you don't have to look at any of these files. Quick overview:

  • abundance_converter.py: includes functions to convert between different stellar elemental abundance formats (used in s4adding_data.py)

  • classes.py contains all information about the three classes used in the code: -- the molecule class: functions to explore the thermochemical databases (mostly shown in sample s0moleculeDB.py) -- the simulation class: functions to analyse the condensation simulation (mostly shown in sample s2analyses.py) -- the planet class: functions to analyse the simulated rocky planets (mostly shown in sample s3planet_composition.py This document is most helpful if you want to check the available functions and how to use them.

  • condensation.py this is a dummy file, just containing the header necessary to integrate the components of the code. You can use it as a starting point for projects with the ECCOplanets code. But we recommend starting with the sample files instead.

  • data.py this code only reads the .pkl files containing all relevant data into python

  • pltStyle.py here, we define properties of the pyplot figures. If you don't like our colour scheme, change it here!

  • simulation.py this is the backbone of our condensation simulation. It contains the mathematical and thermochemical formulation of our code and the parameters of the optimisation procedure. If you want to change the scientific assumption of the condensation simulation, do it here!

We also have some folders:

data
samples
simulations
  • data: contains the databases for the thermochemical data and the stellar abundance data
  • samples: contains commented code snippets to show how to use the code (look below at "Getting started")
  • simulations: these include some already run simulations you can check out -- el_amounts: this subfolder contains some already simulated rocky planets

Getting Started

The best way to get to know the functions of the code is by using the samples provided in the "samples" folder.

s0moleculeDB.py

This is probably not the most interesting sample to explore the code. Only look at this sample if you are interested in thermochemical data we use in the code. In the sample, you create an instance of the molecule class and explore the functionalities of the class. You will also look at our different types of data, i.e. tabulated thermochemical data and fitted Shomate data. Finally, you will plot some thermochemical information of a molecule.

s1simulation.py

This might be a good place to start! In this sample we introduce the parameters of the condensation simulation, i.e. the temperature range and resolution, the molecule selection, and the elemental abundance pattern.

s2analyses.py

This is the natural second step, after running a simulation. You load a simulation, retrieve its basic parameters, and analyse the simulation results. This includes

  • producing different lines plots, for the development of the amount of molecules as a function of temperature
  • analysing the condensation of molecules and elements
  • and improving the simulation result by recomputing a section, removing numerical glitches, and smoothing the curve

s3planet_composition.py

You can also skip s1 and s2 and start at s3. This sample takes you from running a simulation, over improving the result (cropping the gas phase and recomputing a section), to computing the composition of rocky planets as a function of temperature and analysing these planets, with regard to the condensation temperature of elements, bulk composition and devolatilisation relative to the star.

s4adding_data.py

It is, what it says on the tin. This sample shows you how to expand the thermochemical databases and the stellar abundance database.

Prospects

The idea of this code is to provide a very simplified starting point to get an approximate idea of the variety of planetary compositions based on the variety of stellar compositions. This first release only includes abundance data of F, G, and K stars from the Brewer+2016 database. There is absolutely no reason, though, not to include data of other stellar types, just be sure to consider uncertainty. Also you might need to think about the sensibility of running simulations on very incomplete abundance data sets (e.g. if Al, Ca, Mg, Si, or O data is not reported). We only consider pure minerals at the moment, but there are plans to add solid solutions at a later point.

Authors

  • Anina Timmermann - Initial work - AninaTimmermann Please report any problems to me!

License

This project is licensed under the MIT License - see the LICENSE.txt file for details

Acknowledgments

The code was part of my PhD project at the Georg-August-University in Göttingen, Germany. Many thanks to my supervisors Ansgar Reiners, Andreas Pack, and Yutong Shan!

eccoplanets's People

Contributors

aninatimmermann avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

astro-seanwhy

eccoplanets's Issues

The path issue within 'data.py'

Hi Anina,

I've recently visited and test your ECCOplanets code, which looks great!

I noticed a small issue related to the path setup within 'data.py', which has caused some path errors. And it seems that using a (forward) slash, instead of a backslash, would solve the issue in your path designations for 'molecules', 'abundance', 'shomate', 'nist', 'atom_wt', and then subsequently '.to_pickle'. Not sure if this is because that i didn't use your recommended IDE (spyder).

Best,
Haiyang

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.