Coder Social home page Coder Social logo

shkartmaz / cellular-magma Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 28 KB

Visualizing crystallisation in a magma chamber using cellular automata & little to no actual thermodynamics

License: MIT License

Python 100.00%
cellular-automata petrology pygame

cellular-magma's People

Contributors

shkartmaz avatar

Watchers

 avatar

cellular-magma's Issues

Pygame can't handle the abuse

Every cell is re-created and re-drawn each time, which kinda ruins the whole point

Should dive a little bit deeper and find a way to avoid it. Probably by creating the cells once and then just updating their properties
BTW, that will also facilitate moving from two parallel data structures (1. cells 2. drawn cells) to one --> make everything easier. Composition will be stored in cell properties then

Pfft

Possible Future Features to Tackle (PFFT)

This list includes some features that are not in the "zone of proximal development" for now, and thus may never actually be implemented. Especially, given the nature of this project. However, they are cool and would theoretically make everything better

PFFT list:

  • in-built statistics & graphs 📈📊
  • csv/xml data input 📃
  • csv data output
  • performance upgrades, on/off/partial visuals⏱️
  • beautiful, stunning, sexy visuals 🤩
  • actual thermodynamics constants 🔥
  • actual thermodynamics equations🌡️
  • inverse problem solving 🔮😮
  • some sort of interaction with the big boys (COMAGMAT💪 etc)
  • different chamber shape than just a rectangle 🔷
  • 3D 👀
  • interaction with host rock beyond temperature 🌋
  • web version 🕸️

Implement sinking velocity

  • Maybe via number of cells travelled per step
  • But preferably via different probabilities to sink on any given step for different crystals

Move away from pyplot

matplotlib.pyplot colormap seem suboptimal for visualisation once ot becomes more complex.

Visualisation features reqiured:

  • Continious color for liquid phase with different temperatures, discrete colors for different phases --> at least two different data fields should influence the appearece of the cell
  • Maybe different symbols for different phases (dwarf-fortress style lol) --> customization beyond color required
  • Positively have no idea how to use an array of cell class with pyplot :(

Alternatives

  • PIL <-- can either save images or display using external software, not draw&update
  • plotly <-- easy animation, but requires all data before drawng
  • pygame <-- has in-built draw loop

Should support on-the-fly updates too

Better crystallization required

As of now:

  • Phase composition is not implemented.
  • The only crystalline phase is olivine.
  • Crystallization of a given cell is determined by probability

How it should be:

  • Liquid phase should have pre-determined composition (MgO, FeO, CaO, SiO2, Al2O3)
  • Multiple different crystal phases should be able to form depending on current liquid composition
  • Crystallization should turn liquid cell into crystal AND distribute unused components between the neighbors
  • Conservation of mass should apply
  • Instead of probability-based could be proximity-based: crystal always forms unless there already one forming nearby

Add statistics

Temperature, phases, their composition etc

The idea is logging everything for a given section (for example, along the vertical axis) and then dropping it to excel OR plotting graphs via plotly or pyplot
Already partially implemented for debug purposes

Add cooling

  • Magma should be cooled down by adjacent roof of chamber
  • Warmer magma should be cooled down by adjacent colder magma
  • Crystals should only form in sufficiently cool magma

Add proper color management

  • Either via a function color(phase, temperature) that takes a cell and returns an RGB tuple
  • Or maybe via Cell class and something like self.getColor

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.