Notebooks, Scripts, and Parameters
Reproducible organization of simulations, parameters, results, and convergence.
Conceptual context
A physical simulation is not defined by code alone. Its result also depends on parameters, units, numerical method, environment version, initial conditions, and execution procedure. A notebook can combine explanation, data, plots, and results, while a script supports automation and repeated runs. Reproducibility means that another person can reconstruct the computational experiment and obtain a compatible . Refining adds a crucial test: if decreases regularly, the solution shows convergence rather than merely looking precise.
🟢 Essential level
A reproducible notebook or script acts as a digital laboratory record. It must state what was calculated, which parameters were used, which code version produced the result, and how outputs were generated. Inputs, procedure, and outputs should remain separate so execution order cannot silently alter the experiment.
is not enough by itself: it must be compared with and accompanied by . To study convergence, the simulation is repeated with several values while every other setting remains fixed. In the method's useful regime, discrepancy decreases under refinement, and summarizes the rate of that decrease.
Every run should preserve parameters, units, versions, seeds, and output files. Another person can then reconstruct the calculation and distinguish genuine improvement from a hidden configuration change. A failed result also provides evidence when linked to its setup. Reproducibility does not prove that a model is physically correct, but it makes the model testable, comparable, and traceable.
🔵 Formal level
Basic formulas
The basic comparison between a computed result and a reference is:
Absolute error
This defines as the distance between and . Both values must represent the same quantity, use identical units, and correspond to the same physical state.
Within the asymptotic regime of a convergent method, error reduction is modeled by:
Convergence law
Here gathers problem- and method-dependent factors, measures resolution, and controls the slope on a log-log graph. Estimating the order uses , , , and , although a third resolution gives a stronger diagnosis.
Real student questions
Is a neat notebook automatically reproducible? No. It must run from a clean state with recorded dependencies.
Is a script better than a notebook? They serve different purposes. The notebook explains and explores; the script automates and reduces hidden state.
Why are several resolutions needed? One result does not reveal an error trend.
Can error increase when the step decreases? Yes, because of instability, roundoff, tolerances, or a poor reference.
Does convergence mean physical truth? No. It means stability with respect to discretization inside a model.
What should be saved? Code, parameters, units, versions, seeds, inputs, and outputs.
Final synthesis
A reproducible simulation is a complete computational experiment, not a final image. Refining , measuring , and recording parameters distinguish accuracy, convergence, and physical validity. Notebooks, scripts, and configuration files turn temporary results into verifiable knowledge.
Formal development
This section is part of the complete theory. See the subscription options to access it.
🔴 Structural level
This section is part of the complete theory. See the subscription options to access it.
Deep physical interpretation
This section is part of the complete theory. See the subscription options to access it.
Order of magnitude
This section is part of the complete theory. See the subscription options to access it.
Personalized resolution method
This section is part of the complete theory. See the subscription options to access it.
Special cases and extended example
This section is part of the complete theory. See the subscription options to access it.
Cross-cutting connections and study paths
This section is part of the complete theory. See the subscription options to access it.