{"id":15047595,"url":"https://github.com/datavorous/gray-scott-reaction-diffusion-model","last_synced_at":"2025-04-10T00:51:11.839Z","repository":{"id":248984944,"uuid":"829539129","full_name":"datavorous/Gray-Scott-Reaction-Diffusion-Model","owner":"datavorous","description":"Reaction-Diffusion simulation using the Gray-Scott model, available in both C and web versions. It visualizes various patterns that emerge from the interaction of two virtual chemicals in a 2D grid.","archived":true,"fork":false,"pushed_at":"2025-02-22T07:40:21.000Z","size":7499,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-10T00:51:03.342Z","etag":null,"topics":["cpp17","differential-equations","graphics","open-source","opensource","raylib","simulation"],"latest_commit_sha":null,"homepage":"https://datavorous.github.io/Gray-Scott-Reaction-Diffusion-Model/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/datavorous.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-16T16:25:21.000Z","updated_at":"2025-03-28T14:35:27.000Z","dependencies_parsed_at":"2024-09-24T21:01:09.031Z","dependency_job_id":"5ee0b08e-12f0-4f8c-ab39-b96652fca6d7","html_url":"https://github.com/datavorous/Gray-Scott-Reaction-Diffusion-Model","commit_stats":null,"previous_names":["datavorous/gray-scott-reaction-diffusion-model"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datavorous%2FGray-Scott-Reaction-Diffusion-Model","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datavorous%2FGray-Scott-Reaction-Diffusion-Model/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datavorous%2FGray-Scott-Reaction-Diffusion-Model/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datavorous%2FGray-Scott-Reaction-Diffusion-Model/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/datavorous","download_url":"https://codeload.github.com/datavorous/Gray-Scott-Reaction-Diffusion-Model/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248137997,"owners_count":21053775,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp17","differential-equations","graphics","open-source","opensource","raylib","simulation"],"created_at":"2024-09-24T21:01:01.547Z","updated_at":"2025-04-10T00:51:11.816Z","avatar_url":"https://github.com/datavorous.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Reaction-Diffusion Simulation\n\nThis project implements a Reaction-Diffusion simulation using the Gray-Scott model, available in both C and web versions. It visualizes various patterns that emerge from the interaction of two virtual chemicals in a 2D grid.\n\n## Visual Demonstrations\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd width=\"33%\"\u003e\n      \u003cimg src=\"imgs/mitosis.gif\" alt=\"Mitosis Pattern\" width=\"100%\"\u003e\n      \u003cp align=\"center\"\u003e\u003cem\u003eMitosis (Animated)\u003c/em\u003e\u003c/p\u003e\n    \u003c/td\u003e\n    \u003ctd width=\"33%\"\u003e\n      \u003cimg src=\"imgs/mitosis.png\" alt=\"Mitosis Pattern\" width=\"100%\"\u003e\n      \u003cp align=\"center\"\u003e\u003cem\u003eMitosis (Static)\u003c/em\u003e\u003c/p\u003e\n    \u003c/td\u003e\n    \u003ctd width=\"33%\"\u003e\n      \u003cimg src=\"imgs/corals.gif\" alt=\"Coral Growth Pattern\" width=\"100%\"\u003e\n      \u003cp align=\"center\"\u003e\u003cem\u003eCoral Growth (Animated)\u003c/em\u003e\u003c/p\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd width=\"33%\"\u003e\n      \u003cimg src=\"imgs/coral_img.png\" alt=\"Coral Pattern\" width=\"100%\"\u003e\n      \u003cp align=\"center\"\u003e\u003cem\u003eCoral Pattern (Static)\u003c/em\u003e\u003c/p\u003e\n    \u003c/td\u003e\n    \u003ctd width=\"33%\"\u003e\n      \u003cimg src=\"imgs/spiral_2.png\" alt=\"Spiral Pattern\" width=\"100%\"\u003e\n      \u003cp align=\"center\"\u003e\u003cem\u003eSpiral Pattern 1\u003c/em\u003e\u003c/p\u003e\n    \u003c/td\u003e\n    \u003ctd width=\"33%\"\u003e\n      \u003cimg src=\"imgs/spiral_img.png\" alt=\"Spiral Pattern\" width=\"100%\"\u003e\n      \u003cp align=\"center\"\u003e\u003cem\u003eSpiral Pattern 2\u003c/em\u003e\u003c/p\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n## Table of Contents\n\n- [Introduction](#introduction)\n- [Features](#features)\n- [Versions](#versions)\n  - [C Version](#c-version)\n  - [Web Version](#web-version)\n- [Mathematical Model](#mathematical-model)\n- [Getting Started](#getting-started)\n  - [Prerequisites](#prerequisites)\n  - [Installation](#installation)\n- [Usage](#usage)\n  - [Running the Simulation](#running-the-simulation)\n  - [Controls](#controls)\n  - [Changing Patterns](#changing-patterns)\n- [Project Structure](#project-structure)\n- [Building and Running](#building-and-running)\n- [Contributing](#contributing)\n- [Possible Improvements](#possible-improvements)\n- [FAQ](#faq)\n- [References](#references)\n- [License](#license)\n\n## Introduction\n\n[Reaction-Diffusion systems](#mathematical-model) are mathematical models that describe how the concentration of substances changes in space over time due to local chemical reactions and diffusion. These systems can produce a wide variety of patterns, including spots, stripes, and more complex structures, making them useful for modeling various biological and chemical phenomena.\n\n## Features\n\n- Real-time simulation of the Reaction-Diffusion process\n- Multiple pre-defined patterns (see [Changing Patterns](#changing-patterns))\n- Interactive controls (see [Controls](#controls))\n- Cross-platform support (C and Web versions)\n- Easy-to-use build system\n\n## Versions\n\n### C Version\n\nThe C version provides a decent-performance simulation using the [Raylib](https://www.raylib.com/) graphics library. It offers:\n\n- Decently fast, real-time rendering\n- Platform-native window and controls\n- Easy compilation and execution via batch file\n\n[Jump to C installation instructions](#installation)\n\n### Web Version\n\nThe web version allows for easy access and sharing of the simulation. Features include:\n\n- Browser-based simulation (no installation required)\n- Interactive UI for pattern selection and parameter adjustment\n- Responsive design for various screen sizes\n\n[Try the web version now](https://datavorous.github.io/Gray-Scott-Reaction-Diffusion-Model/)\n\n## Mathematical Model\n\nThis simulation uses the [Gray-Scott model](#references), defined by the following partial differential equations:\n\n```\n∂A/∂t = D_A ∇²A - AB² + f(1-A)\n∂B/∂t = D_B ∇²B + AB² - (k+f)B\n```\n\nWhere:\n- A and B are the concentrations of two chemicals\n- D_A and D_B are the diffusion rates of A and B\n- f is the feed rate\n- k is the kill rate\n- ∇² is the Laplace operator\n\n## Getting Started\n\n### Prerequisites\n\n- For C version:\n  - C compiler \n  - [Raylib](https://www.raylib.com/) graphics library\n- For Web version:\n  - Modern web browser with JavaScript enabled\n\n### Installation\n\n1. Clone the repository:\n   ```\n   git clone https://github.com/datavorous/Gray-Scott-Reaction-Diffusion-Model.git\n   ```\n\n2. For C version, install Raylib following the instructions on their [website](https://www.raylib.com/).\n\n3. The web version requires no additional installation.\n\n## Usage\n\n### Running the Simulation\n\n#### C Version\nNavigate and run the `build.bat` file, after placing the `libraylib.a` file inside the `lib/` folder. This will compile and run the simulation.\n\n#### Web Version\nOpen the `index.html` file in your web browser, or visit the [online demo](https://datavorous.github.io/Gray-Scott-Reaction-Diffusion-Model/).\n\n### Controls\n\n- Left-click: Add chemical B to the simulation\n- Spacebar: Pause/unpause the simulation\n- Enter key: Reset the grid\n\n### Changing Patterns\n\nTo change patterns in the C version, modify the `f` and `k` values in the `main.cpp` file according to this table:\n\n| Pattern        | f       | k       |\n|----------------|---------|---------|\n| Mitosis        | 0.0367  | 0.0649  |\n| Coral Growth   | 0.0545  | 0.062   |\n| Fingerprint    | 0.055   | 0.062   |\n| ... (and so on) |         |         |\n\nIn the web version, use the dropdown menu to select different patterns.\n\n## Project Structure\n\n```\nreaction-diffusion-simulation/\n├── bin/\n│   └── Makefile\n├── include/\n├── lib/\n├── src/\n│   └── main.cpp\n├── build.bat\n├── index.html\n└── README.md\n```\n\n## Building and Running\n\n1. Navigate to the `bin` folder\n2. Double-click `build.bat` or run it from the command line\n3. The script will compile the code and launch the simulation\n\n## Contributing\n\nWe welcome contributions to the Reaction-Diffusion Simulation project! Here's how you can help:\n\n### Quick Start\n\n1. Fork the repo and create your branch from `main`.\n2. Make your changes, adhering to the best practises.\n3. Ensure your code passes all tests.\n4. Submit a pull request.\n\n### Reporting Issues\n\n- Check existing issues before creating a new one.\n- Provide detailed information: version, OS, steps to reproduce, expected vs. actual behavior.\n\n### Coding Standards\n\n- Use the accepted and standard procedure for a given language.\n- Use 4 spaces for indentation.\n- Write clear, well-commented code.\n\n### Commit Messages\n\nFollow the [Conventional Commits](https://www.conventionalcommits.org/) specification:\n\n```\ntype(scope): brief description\n\nLonger description if necessary\n\nCloses #123\n```\n\n### Testing\n\n- Write unit tests for new features or bug fixes.\n- Ensure all tests pass before submitting a PR.\n\n### Documentation\n\n- Update README.md and comments for significant changes.\n\n## Possible Improvements\n\n1. Implement real-time parameter adjustment in C version\n2. Add option to switch between different models\n3. More liquids?\n4. Optimize for larger grids using GPU acceleration\n5. Implement more complex reaction-diffusion systems\n\n## FAQ\n\nQ: Why does the simulation slow down with larger grids?\nA: The computational complexity increases with grid size. Consider lowering the resolution or using a more powerful machine.\n\n## References\n\n1. [Pearson, J. E. (1993). Complex Patterns in a Simple System. Science, 261(5118), 189-192.](https://science.sciencemag.org/content/261/5118/189)\n2. [Turing, A. M. (1952). The Chemical Basis of Morphogenesis. Philosophical Transactions of the Royal Society B, 237(641), 37-72.](https://royalsocietypublishing.org/doi/10.1098/rstb.1952.0012)\n\n## License\n\nThis project is licensed under the GNU General Public License v3.0 - see the [LICENSE](LICENSE) file for details.\n\n---\n\n**Note**: This project is for educational purposes only. It does not claim to accurately represent real-world chemical or biological processes.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatavorous%2Fgray-scott-reaction-diffusion-model","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatavorous%2Fgray-scott-reaction-diffusion-model","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatavorous%2Fgray-scott-reaction-diffusion-model/lists"}