# Resource required for learning simulations in physics

I know basic programming in C and Fortran. I want to learn simple simulations in physics to have some idea about it. Right now I don't have any idea about it. Can someone refer some online/offline sources (at beginner level) from where I can have a clear understanding of what simulation means and how is it done? If there are beginner level textbooks on physics simulations please also refer.

Right now as a beginner, I am not interested in specialized or research-level simulation techniques. Rather than simulation for basic textbook problems in classical or quantum mechanics, if possible. Since I don't have any understanding of what a simulation is I could not be more specific. Sorry about that.

Before answering, please see our policy on resource recommendation questions. Please write substantial answers that detail the style, content, and prerequisites of the book, paper or other resource. Explain the nature of the resource so that readers can decide which one is best suited for them rather than relying on the opinions of others. Answers containing only a reference to a book or paper will be removed!

• Pick up a book on numerical methods for engineers, or numerical methods for ordinary differential equations. In general, the requirements for simulation is calculus, programming, and geometry. – ja72 Apr 30 '18 at 14:54
• This will also depend on what you want to simulate. – Kyle Kanos Apr 30 '18 at 16:01
• @KyleKanos I've heard of something called Monte Carlo simulation. – mithusengupta123 Apr 30 '18 at 17:11
• Okay. So does that mean you want more resources in MC simulations? That's still fairly broad because it can be used for a number of things: stochastic processes, numerical integration, synthetic data analysis, and so on. – Kyle Kanos Apr 30 '18 at 17:13
• I've heard of MC simulation in the context of phase transition. So maybe I what to know what that means, for example. – mithusengupta123 Apr 30 '18 at 17:17

what simulation means and how is it done?

In a physics simulation you typically start from the assumption that

1. some laws are valid and relevant, and
2. some elements / boundary conditions are present.

From which you, numerically, determine implications.

For instance, you might assume:
- Newton's laws,
- perfectly elastic collisions,

consider the elements:
- gravitational force $F_g$,
- particle with mass $m$,
- an infinite, immovable horizontal surface,
- particle with zero initial velocity and initial position at height $h$,

and then proceed to, e.g., numerically integrate the corresponding differential equations (being careful about the discontinuities at the collisions); obtaining, e.g., that the particle's movement is periodic.

• What is the difference between numerical codes to solve a differential equation or some physics equation on one hand and simulating something on the other? – mithusengupta123 May 18 '18 at 4:08
• @mithusengupta123 Computer simulation is the more general case, outlined in the points 1 and 2. The laws mentioned in point 1 might be written in the form of differential equations (and then the simulation can be performed using the codes you mention) or some other description, such as mappings, Monte Carlo, among others. – stafusa May 18 '18 at 7:11

"Simulation" can refer to more than one process of estimating the behavior of a system or quantities that can be compared to measurement.

It may be helpful to choose a type of process you are interested in and develop a physics based simulation of it.

Keep in mind that a numerical method is not necessary for building a simulation and that computers are not necessary for numerical estimates. Hence, there are at least three distinct disciplines being discussed.

As an example, projectiles (baseballs, munitions, missiles) can be "modeled" using results straight from a high school book: x-x0 = vx0*t, y-y0 = vy0*t - 0.5*|g|*t^2. One does not need a computer, maybe a calculator if your arithmetic is rusty, to evaluate quantities based on this system of equations. The real issue for the modeler is "does this model accurately represent the system to which it is applied", "can I trust the estimates"?

You might be surprised at just how much can be squeezed from known exact solutions when they are applied thoughtfully.

If you are interested in modeling a complex system then you will eventually need to delve into classic numerical methods, Numerical Recipes in FORTRAN or C is a good place to start but that recipe book will not teach the art of modeling and simulation. You will need to test out those algorithms and learn which make sense to use for a particular problem. Many of those recipes for solving ordinary diff eq and partial diff eq are not stable or convergent (and they point that out) so you'll need to dig deeper.

The nature of your simulation approach may depend on the type of problem you want to solve, or on your available resources. There exist multiple techniques for solving the same set of equations, or types of equations. So you have a lot of freedom and that can get confusing.

Going back to the projectile problem if you add air resistance to the problem for high speed objects you may not get an exact solution and need numerical methods to approximate a solution. Now a computer will be a useful tool. BUT you will need a "model" of the air resistance (drag) force, and possibly lift. While the coefficients may be a function of knowable quantities you will likely want to keep this constant for simplicity (especially if you are just learning). The need for this now introduces an entirely new task for the modeler. The aero forces may be known, measured, capable of being estimated by a simple model, or you may want to get spun up to build a detailed simulation that couples fluid dynamics to the projectile motion so you can see buffeting and turbulent effect arise. That would be "hard". To the point made in the other answer, we usually start by:

1) identifying what we want to model then,

2) decide whether we can use know equations or solution, or need to solve the equations of physics, or can build up a statistical model,

3) along the way we decide what to neglect (and hopefully justify that),

4) then pick an approximation method (numerical, mode expansion, etc)

5) if needed write software to perform these calculations (for accuracy and speed)

Steps 4 and 5 will lead down a long path into completely independent disciplines. If you just want to learn how physics is modeled using these techniques you'll need to look at physics books that have a modeling or numerics section. I believe that newer editions of Fowles Mechanics is expanded to include some numerical sections. There is also "Modeling and Simulation of Aerospace Vehicle Dynamics" by Zipfel, "Method of Moments in Electrodynamics" by Gibson, etc. The problem is that most basic physics texts do NOT contain modeling and simulation sections, and most modeling and simulation books are either (1) too general and don't show applications, or (2) are too specific and don't explain the numerics adequately.

You state that you are a "beginner" but not whether you have a deep understanding of physics and not numerics or if you are a beginner at both. This would help w/r to a recommendation.

Last but not least different phenomena will require different techniques.

Rigid body motion -- Forward propagating ODE solvers (like Runge Kutta, etc)

EM and acoustic Scattering -- Boundary element methods

Solving the wave equation in refractive media -- Finite difference, or Finite element method

This doesn't even touch upon perturbation methods, etc.

and so on...

So I'd recommend starting with something like projectile motion with air resistance. This will point you in the direction of ODE solvers which are fairly easy to code and test. For linear resistance you have an exact solution to Newton's equation of motion so you can check your result. Then you can add Earth rotation effects etc making your model more realistic and learn more in the process.

I highly recommend Matter & Interactions by Chabay and Sherwood. It is an introductory classical mechanics and electromagnetism textbook based on doing physics simulations/computations using Python via VPython/Jupyter Notebook or GlowScript.