Introduction to Modeling#
In physics, we use models to understand, predict, and simulate reality. A model is a simplified representation of the real world — designed to help us understand complex systems. Think of the motion of a falling apple, the weather, or the behavior of an electron in a magnetic field.
Modeling is not just mathematics. It iss a creative and critical process where physical knowledge, computational power, and logic come together.
We consider that the physical model is present, so that we can focus on the computational aspects. This means you should already understand the physics behind the problem you want to model and have described it in detail. Without solid physical insight, a model can be misleading or wrong, even if the code runs perfectly. A model is only as good as the physical assumptions it’s based on:
What forces are acting?
Can you ignore air resistance?
Does Newton’s second law apply here?
Components of a computational model#
A good model is built in clear steps:
Initial conditions These are the starting values of your system. For example: a ball starts at a height of 2.0 m with a velocity of 0 m/s. These values are essential for a simulation: they determine how the system evolves from the beginning.
Boundary conditions Boundary conditions specify what happens at the ‘edges’ of your model. For example:
A spring can stretch a maximum of 10 cm.
An object stops at the wall.
There is no friction outside a certain area.
They constrain your model and ensure your simulation remains realistic.
Variables Variables describe the state of the system at any given moment, for example:
position x
velocity v
time t
These change continuously during the simulation.
Auxiliary variables
Sometimes you need extra variables that don’t directly describe the state, but are necessary for your calculations. Think of:
acceleration $a$ as the derivative of $v$
force $F = m·a$
intermediate results like $\Delta v$ or energy
These make your code and reasoning clearer and more reusable.
Tools for modeling and simulation#
There are various tools and languages you can use to create models and run simulations:
Tool/Language |
Advantages |
Disadvantages |
---|---|---|
Python |
Accessible, powerful, many libraries (like |
Requires some programming experience |
Coach |
Intuitive interface, good for experiments and direct feedback. |
Less flexible, harder to adapt for complex models |
C++ |
Fast, suitable for large and heavy simulations. |
Complex syntax, not beginner-friendly |
Excel |
Good for simple numerical models, easy to start with. |
Limited scalability and repeatability |
For this course, we use Python because it offers a good balance between accessibility and flexibility.