# MICROCRE reproducible teaching simulations Twelve synthetic models are supplied with browser interaction, standalone Python source, standalone MATLAB source, CSV curves, PNG figures and numerical verification reports. All default Python downloads have been executed separately in subprocesses. MATLAB and Octave were unavailable: **the MATLAB scripts have not been executed**. No calculation here validates an instrument, a material property, or a conformity decision. The heat-diffusion model performs an actual one-dimensional explicit finite-difference time integration. The other models combine explicit physical or teaching relationships with sampling, numerical quadrature, regression, Fourier projections or seeded Monte Carlo propagation. They are not finite-element analyses. ## Reproduce one downloaded example Install Python 3 with NumPy, SciPy and Matplotlib. Each `output/.py` is self-contained; it does not import any local project file or fetch data. For example: ```sh python heat-diffusion.py --output-dir heat-results ``` To override inputs, create a JSON object with the same numeric keys shown in `data/simulations.json`, then run: ```sh python heat-diffusion.py --params-json alternate-inputs.json --output-dir alternate-results ``` The script writes `.csv`, `.png` and `-summary.json`. The CSV uses long-form columns `series,x,y,x_unit,y_unit`; for the Monte Carlo model it includes every individual trial as well as the histogram. The summary preserves inputs, units from the embedded specification, outputs, assumptions, limitations and source URLs. Each MATLAB file uses an underscore filename, such as `heat_diffusion.m`. It is a standalone script with local helper functions, intended for MATLAB R2016b or later and core MATLAB functions. Edit the `p` structure and run it from MATLAB. It writes the same types of artifacts to `_results/`. Source review is not an execution test; confirm behavior in the MATLAB version you intend to use. ## Rebuild and verify the repository ```sh python simulations/build_manifest.py python simulations/run_all.py node tests/simulation-models.test.cjs python simulations/build_report.py ``` `run_all.py` generates and individually executes all twelve standalone Python scripts, writes the MATLAB counterparts, and runs analytical, boundary, normalization and grid-convergence checks. The JavaScript test compares the complete default curves and summaries with the Python CSV/JSON results, then exercises malformed and boundary inputs. If metadata is changed, the JavaScript `DEFINITIONS` must be synchronized intentionally; the test rejects a divergence. The exact executed dependency versions, timestamps and file SHA-256 values are recorded in `output/validation-report.json`. Cross-language numerical comparisons are in `output/browser-model-validation.json`. Browser DOM rendering and download interactions are checked by the site's integrated review, separately from these model tests. ## Model boundaries - **Indentation:** assumed loading/unloading powers; no actual contact-area calibration or validated constitutive law. - **Thermal drift:** linear drift from an independent synthetic reference; specimen creep is not fitted as drift. - **Heat diffusion:** constant diffusivity, fixed end temperatures and a sinusoidal initial field; rejects `alpha*dt/dx^2 > 0.5` and excessive step counts. Analytical eigenmode and 21/41/81-node convergence are checked. - **Beam bending:** small-deflection Euler–Bernoulli beam, ideal simple supports and a central point force. - **Tensile response:** one-dimensional assumed bilinear engineering response; no necking, fracture or large-strain claim. - **Optical angle:** single-pass ray angle; reflected-ray and mirror-rotation angles are not interchangeable. - **Resolution and sampling:** assumed Gaussian PSF plus rectangular pixel aperture. The browser erf approximation is checked against SciPy with an explicit tolerance; this is not an Airy/Rayleigh performance test. - **Roughness:** synthetic profile with linear detrending only; no standard cutoff filters or acceptance parameter claim. - **Roundness:** first-harmonic removal on uniform angular samples; not a full nonlinear circle fit or minimum-zone calculation. - **Absorbance:** assumed Gaussian molar spectra and Beer–Lambert additivity; no real chemical spectrum or detector calibration. - **Chromatography:** normalized Gaussian peaks; no tailing, drifting baseline or matrix effects. - **Monte Carlo:** fixed Park–Miller/Box–Muller seed and specified correlated Gaussian inputs. Non-positive sampled areas are rejected, not silently discarded. Equal-tail empirical coverage intervals have finite-sampling uncertainty and are not confidence intervals for the mean. ## Public-file contract `data/simulations.json` records both public `artifact_paths` and repository-relative `local_artifact_paths`. The site copies standalone `.py`, underscore-named `.m` and `.csv` files from `simulations/output/` to `/downloads/simulations/`; PNG files go to `/assets/simulation-results/`. The interactive module uses `form[data-simulation]`, input `[data-key]`, canvas `[data-simulation-plot]`, `[data-simulation-result]`, and `data-simulation-run`, `data-simulation-reset`, `data-simulation-csv` buttons. `window.YRSimulationLab.calculate(id, values)` returns a result without DOM or network access; `mount(root)` binds the form and is called automatically on DOM readiness.