You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

209 lines
12 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<title>Exochemistry Cookbook</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="og:title" property="og:title" content="Exophysics">
<meta name="description" content='Explore the physics of other universes'>
<link rel="stylesheet" href="style.css" type="text/css" />
<link rel="shortcut icon" type="image/png" href="favicon.png">
</head>
<body>
<nav>
<a href="index.html">Home</a>
<a href="exhibition.html">Exhibition</a>
<a href="manual.html">Manual</a>
<a href="cookbook.html" class="active">Cookbook</a>
<a href="https://codeberg.org/exophysics/exophysics/src/branch/master/index.html">Code</a>
</nav>
<article>
<h1><span id="e">E</span><span id="x">x</span><span id="o">o</span>chemistry Cookbook</h1>
<div id="toc"></div>
<p>
<i>Click <a href="https://codeberg.org/exophysics/pages/src/branch/master/cookbook.html">here</a> to improve this text.</i>
</p>
<h2>Introduction</h2>
<p>
On the home planet of the author, the word "<i>Chemistry</i>"
describes the study of emergent properties of atoms.
"<i>Exochemistry</i>" is, on the other hand, the study of
emergent properties of particles in other universes, obeying
different laws of physics.
</p>
<p>
Let this document be your guide to the emerging field of
Exochemistry.
</p>
<h2>Emergence</h2>
<p>
<a href="https://en.wikipedia.org/wiki/Emergence">Emergence</a>
occurs in a complex system when objects (like exophysics
particles) interact in ways that gives rise to phenomena that
are not found within the individual objects themselves.
</p>
<p>
One proton, neutron or electron alone will never have any
properties like temperature, pressure, shape, color, taste, or
intelligence. But if you take a very very big pile of them,
apply the laws of physics, and let them interact for about
14,000,000,000 years, a smooth-skinned, smelly, intelligent
creature emerges, staring at a screen and reading this text.
</p>
<p>
There are various resources on the topic of emergence on the
human-era "internet". If you happen to be within the realms of
the humans, with access to this "internet", you could benefit
from the following hyperlinks:
</p>
<ol>
<li>YouTube/Kurzgesagt: <a href="https://www.youtube.com/watch?v=16W7c0mb-rE">Emergence - How Stupid Things Become Smart Together</a></li>
<li>YouTube/PBS Space Time: <a href="https://www.youtube.com/watch?v=XNK5oahmw3I">Could Life Evolve Inside Stars?</a></li>
<li>Wikipedia: <a href="https://en.wikipedia.org/wiki/Emergence">Emergence</a></li>
</ol>
<h2>Cookbook</h2>
<p>
Not every universe is a host to emergence and exochemistry. In
fact, creating one with beautiful emergent properties is the
ultimate art form. But how do you even start?
</p>
<p>
There are two necessary ingredients for emergence:
</p>
<ol>
<li><a href="#Diversity">Diversity</a> in the types of objects</li>
<li>Balanced <a href="#Interactions">interactions</a> between those objects</li>
</ol>
<h3>Diversity</h3>
<p>
Diversity among particles unlocks new kinds of interactions.
Let's take the simple exophysics universe
<a href="exhibition.html#dorilia">[EPILEPSY WARNING]: Dorilia</a>
as an example. It's home to the following exochemical
properties:
</p>
<ol>
<li>Red and blue particles can join each other to combine a sort of stationary "atom"</li>
<li>Two atoms can join each other to form a chemical bond. A peculiar molecule emerges, that moves along perpendicular to the axis of the chemical bond.</li>
<li>Three particles of non-identical colors can form a stable, fast-moving atom under rare conditions</li>
<li>Under high pressure (when too many particles occupy the same space), a chaotic plasma cloud forms, destroys molecules, and moves at even higher speed. When it reaches a space with less density, it recombines into individual particles, atoms or molecules.</li>
<li>And more...</li>
</ol>
<br />
<span class="warning-wrapper">
<a href="exhibit/dorilia.html" class="exhibitlink"><img src="exhibit/dorilia.png" /></a>
</span>
<p>
Here, each particle has the following properties that differentiates them from each other:
</p>
<ol>
<li><code>state.x</code>: The location along the first spatial dimension</li>
<li><code>state.y</code>: The location along the second spatial dimension</li>
<li><code>state.z</code>: The "health" of a particle. If it drops to zero, the particle decays.</li>
<ol>
<li>When the particle is in the top half of the screen, it gains energy, and in the bottom half it slowly loses energy.</li>
<li>This is just a little thing to make things more interesting, but doesn't contribute much to emergence.</li>
</ol>
<li><code>state.w</code>: The "flavor" or "charge" of the particle. This is similar to <a href="https://en.wikipedia.org/wiki/Electric_charge">"positive" and "negative" electric charge</a> in the home universe of the author.</li>
<ol>
<li>state.w is randomly assigned to be between 0.0 and 1.0.</li>
<li>If the value is below 0.5, the flavor is defined to be 1, and the particle becomes red.</li>
<li>If the value is above or equal to 0.5, the flavor is defined to be -1, and the particle becomes blue.</li>
</ol>
<li><code>oldV.x</code>: The velocity of the particle along the first spatial dimension</li>
<li><code>oldV.y</code>: The velocity of the particle along the second spatial dimension</li>
</ol>
<p>
These properties contribute in different ways towards emergence:
</p>
<ol>
<li><code>state.x/y</code>, <code>oldV.x/y</code>: Helpful, but not sufficient for emergence</li>
<li><code>state.w</code>: Allows discriminatory forces (see below) to produce emergence</li>
<li><code>state.z</code>: Doesn't contribute to emergence yet, but we if we add a new force that acts based on this property, some new, interesting phenomena might emerge.</li>
</ol>
<h3>Interactions</h3>
<h4>Non-discriminatory forces</h4>
<p>
Non-discriminatory forces act the same way on every particle,
similarly to the
<a href="https://en.wikipedia.org/wiki/Gravity">gravitational force</a>
in the author's home universe. The distance between particles
typically still plays a role, so in a strict sense, even this
type of force is discriminatory between close and far
particles, but I will conveniently neglect this fact.
</p>
<p>
A gravitation-like non-discriminatory force could attract every
particle towards each other, making them orbit the center of
mass. This does not lead to the emergence of exochemistry.
</p>
<p>
There may be configurations of non-discriminatory forces that
lead to exochemistry, though at this spacetime, the author
knows of none. The creation of such is left as an exercise to
the reader.
</p>
<h4>Discriminatory forces</h4>
<p>
Discriminatory forces act differently depending on certain
properties of the interacting particles. Similarly to the
<a href="https://en.wikipedia.org/wiki/Electromagnetism">electromagnetic force</a>
in the author's home universe, where objects with the same
charge repel each other, while objects with an opposite charge
attract each other.
</p>
<p>
In the example above, a discriminatory force is responsible for
the emergence of exochemical properties. This is the
(simplified) relevant code:
</p>
<pre><code>int myCharge = (state.w &lt; 0.5) ? 1 : -1;
for (int i = 0; i &lt; particleLimit; i++) {
if (i == currentIndex) { continue; } // don't interact with yourself
otherState = allStates[i];
otherCharge = (otherState.w &lt; 0.5) ? 1 : -1;
distance = otherState.xy - state.xy;
direction = float(myCharge * otherCharge);
acceleration = -0.0001 * distance.xy / pow(length(distance.xy), 4.0);
velocity.xy += acceleration * direction;
}</code></pre>
<p>
This is just one of many ways to write a non-discriminatory
force, but the key part is that there's a direction which
depends on the "charge" of the particles. There's also various
constants, like the <code>-0.0001</code>, which mediates the
strength of this force. The <code>4.0</code> within the
"<code>pow()</code>" function takes the distance to the power
of 4, resulting in a non-linear relationship between distance
and acceleration.
</p>
<p>
There is a lot to explore here, which is left as an exercise to
the reader.
</p>
<h4>Limiting the velocity</h4>
<p>
A universal speed limit may contribute to the emergence of
emergence by creating an environment where particles stay close
together long enough for the forces to be able to act.
</p>
<p>
This is especially important in limited-precision simulations
like Exophysics, where the time steps between each moment are
relatively large, with only about 60 simulated moments per
human second. As a result, for example, particles may fly past
one another even though they should, in theory, collide and
bounce off each other. This further results in a violation of
a conservation of energy, with a tendency towards an energy
explosion, and progressive heating of the universe.
Countermeasures are also left as an exercise for the reader.
On the flip side, this evades the
<a href="https://en.wikipedia.org/wiki/Heat_death_of_the_universe">heat death of the universe</a>
and let's you build
<a href="https://en.wikipedia.org/wiki/Perpetual_motion">perpetual motion machines</a>.
</p>
</article>
<script src="toc.js"></script>
</body>
</html>