An interactive narrative teaching materials science concepts with molecular-dynamics simulations, (ab-)using the d3-force module.
The project consists of two parts
- Development of an extension to d3-force module, called
d3-force-md
, to include:- True velocity-verlet integration (force averaging, with finite time-step)
- Updated
forceLink
force to ensure energy-conservation - Implementation of two new forces, common in molecular dynamics simulations
- Interactive narrative using
d3-force-md
to teach Materials Science concepts- Aimed at undergraduate students
The module source code is hosted in its own repository.
Forked from the d3-force
repository, the main contributions can be found in the following files: src/simulation.js, src/link.js, src/lennardJonesPotential.js, src/centralPotential.js.
The module is published on NPM, and can be installed using npm install d3-force-md
. Alternatively, it can also be used as a standalone library. AMD, CommonJS, and vanilla environments are supported. In vanilla, a d3
global is exported:
<script src="https://d3js.org/d3-dispatch.v2.min.js"></script>
<script src="https://d3js.org/d3-quadtree.v2.min.js"></script>
<script src="https://d3js.org/d3-timer.v2.min.js"></script>
<script src="https://unpkg.com/d3-force-md"></script>
<script>
var simulation = d3.forceSimulation(nodes);
</script>
In addition to the full documentation found in the module repository, a trimmed version highlighting the changes introduced to the API can be found in this notebook. A comparison with the d3-force
module can also be found in this notebook.
The interactive narrative, deployed as an Observable notebook, uses the d3-force-md
module to introduce a variety of Materials Science concepts such as:
- Lattice dynamics
- Physical origin of surface energy
- Dislocations during materials deformation
- An interactive simulation playground
The 1-minute video teaser can be found here.
The paper describing the project in more detail can be found here.