Simulating Real-World Systems as a Programmer cover

A collection of posts on the foundations and patterns for building simulations of the real world. Written especially for programmers and non-technical readers wanting to learn the fundamentals. All written material and non-interactive diagrams were human-generated, where some interactive elements were programmed using generative AI tools.

Collection

Simulating Real-World Systems as a Programmer

    Simulating real-world systems

    What you now know

    We started this collection of posts with a question: why simulate real-world systems at all?

    The answer: simulations can discover better actions to take in our decision-making and interrogate the reasoning behind a decision in a way that other predictive AI approaches cannot.

    From this point onward, we built up our understanding in layers.

    State partitions and timesteps gave us a way to describe how a system evolves in time; these are the fundamental building blocks.

    Probabilistic thinking gave us a way to reason about its possible trajectories without enumerating them.

    Objectives and learning algorithms gave us a way to fit parameters to data, or to search for the best action-taking policy.

    Decisions (post 1)
    The simulation is run to support a decision.
    Building blocks (post 2)
    Time and state advance one step.
    Probabilities (post 3)
    The states have probabilities.
    Learning (post 4)
    Parameters are updated using those probabilities.

    What’s next?

    Consider the hardware; up until now, we have assumed a single simulation engine running on a classical CPU.

    If you want to know how engines run on different hardware see this separate post about simulation architectures on different hardware.

    After that, it’s time to explore some real applications!

    The stochadex project implements every piece described in this collection of posts.