Build a reusable numerical model in Julia
8 steps · about 4 h 50 min · Intermediate
- Model quantities with concrete composite types (guide, Julia documentation, 35 min)
Domain types clarify which values belong together while leaving methods open for extension.
- Express variants with multiple dispatch (guide, Julia documentation, 40 min)
Dispatch selects behaviour from the actual combination of model and input types.
- Store model inputs in arrays (guide, Julia documentation, 35 min)
Array shapes and element types directly affect numerical meaning and performance.
- Broadcast scalar rules over data (guide, Julia documentation, 30 min)
Dotted calls preserve a clear scalar definition while efficiently applying it elementwise.
- Measure and remove avoidable allocations (guide, Julia documentation, 45 min)
Function barriers and stable types address common slowdowns without guessing.
- Use standard linear algebra operations (reference, Julia documentation, 35 min)
Purpose-built factorizations and operators are clearer and safer than handwritten matrix routines.
- Differentiate the model automatically (guide, ForwardDiff documentation, 35 min)
Forward-mode derivatives support sensitivity checks without manually maintaining derivative code.
- Test identities, tolerances and edge cases (reference, Julia documentation, 35 min)
Numerical tests need explicit tolerances and properties rather than fragile exact equality alone.