ArticleslgStudy

computer science

Computer simulation

Computer simulation is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Computer simulation rather than just read about it. In short: Computer simulation is the running of a mathematical model on a computer, the model being designed to represent the behaviour of, or the outcome of, a real-world or physical system. The reliability of some mathematical models can be determined by comparing their results to the real-world outcomes they aim to predict.

Computer simulation — main illustration
Computer simulation — illustration

Key takeaways

  • Computer simulation belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Computer simulation to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Computer simulation from memory before moving on to harder problems.

Reference excerpt

Computer simulation is the running of a mathematical model on a computer, the model being designed to represent the behaviour of, or the outcome of, a real-world or physical system. The reliability of some mathematical models can be determined by comparing their results to the real-world outcomes they aim to predict. Computer simulations have become a useful tool for the mathematical modeling of many natural systems in physics (computational physics), astrophysics, climatology, chemistry, biology and manufacturing, as well as human systems in economics, psychology, social science, health care and engineering. Simulation of a system is represented as the running of the system's model. It can be used to explore and gain new insights into new technology and to estimate the performance of systems too complex for analytical solutions. Computer simulations are realized by running computer programs that can be either small, running almost instantly on small devices, or large-scale programs that run for hours or days on network-based groups of computers. The scale of events being simulated by computer simulations has far exceeded anything possible (or perhaps even imaginable) using traditional paper-and-pencil mathematical modeling. In 1997, a desert-battle simulation of one force invading another involved the modeling of 66,239 tanks, trucks and other vehicles on simulated terrain around Kuwait, using multiple supercomputers in the DoD High Performance Computer Modernization Program. Other examples include a 1-billion-atom model of material deformation; a 2.64-million-atom model of the complex protein-producing organelle of all living organisms, the ribosome, in 2005; a complete simulation of the life cycle of Mycoplasma genitalium in 2012; and the Blue Brain project at EPFL (Switzerland), begun in May 2005 to create the first computer simulation of the entire human brain, right down to the molecular level. Because of the computational cost of simulation, computer experiments are used to perform inference such as uncertainty quantification.

Simulation versus model A model consists of the equations used to capture the behavior of a system. By contrast, computer simulation is the actual running of the program that perform algorithms which solve those equations, often in an approximate manner. Simulation, therefore, is the process of running a model. Thus one would not "build a simulation"; instead, one would "build a model (or a simulator)", and then either "run the model" or equivalently "run a simulation".

History Computer simulation developed hand-in-hand with the rapid growth of the computer, following its first large-scale deployment during the Manhattan Project in World War II to model the process of nuclear detonation. It was a simulation of 12 hard spheres using a Monte Carlo algorithm. Computer simulation is often used as an adjunct to, or substitute for, modeling systems for which simple closed form analytic solutions are not possible. There are many types of computer simulations; their common feature is the attempt to generate a sample of representative scenarios for a model in which a complete enumeration of all possible states of the model would be prohibitive or impossible.

Data preparation The external data requirements of simulations and models vary widely. For some, the input might be just a few numbers (for example, simulation of a waveform of AC electricity on a wire), while others might require terabytes of information (such as weather and climate models). Input sources also vary widely:

Sensors and other physical devices connected to the model; Control surfaces used to direct the progress of the simulation in some way; Current or historical data entered by hand; Values extracted as a by-product from other processes; Values output for the purpose by other simulations, models, or processes. Lastly, the time at which data is available varies:

"invariant" data is often built into the model code, either because the value is truly invariant (e.g., the value of π) or because the designers consider the value to be invariant for all cases of interest; data can be entered into the simulation when it starts up, for example by reading one or more files, or by reading data from a preprocessor; data can be provided during the simulation run, for example by a sensor network. Because of this variety, and because diverse simulation systems have many common elements, there are a large number of specialized simulation languages. The best-known may be Simula. There are now many others. Systems that accept data from external sources must be very careful in knowing what they are receiving. While it is easy for computers to read in values from text or binary files, what is much harder is knowing what the accuracy (compared to measurement resolution and precision) of the values are. Often they are expressed as "error bars", a minimum and maximum deviation from the value range within which the true value (is expected to) lie. Because digital computer mathematics is not perfect, rounding and truncation errors multiply this error, so it is useful to perform an "error analysis" to confirm that values output by the simulation will still be usefully accurate.

Types Models used for computer simulations can be classified according to several independent pairs of attributes, including:

Stochastic or deterministic (and as a special case of deterministic, chaotic) – see external links below for examples of stochastic vs. deterministic simulations Steady-state or dynamic Continuous or discrete (and as an important special case of discrete, discrete event or DE models) Dynamic system simulation, e.g. electric systems, hydraulic systems or multi-body mechanical systems (described primarily by DAE:s) or dynamics simulation of field problems, e.g. CFD of FEM simulations (described by PDE:s). Local or distributed. Another way of categorizing models is to look at the underlying data structures. For time-stepped simulations, there are two main classes:

… excerpt ends here. Continue reading the full article.

Illustrations

Computer simulation: A 48-hour computer simulation of Typhoon Mawar using the Weather Research and Forecasting model
A 48-hour computer simulation of Typhoon Mawar using the Weather Research and Forecasting model
Computer simulation: Process of building a computer model, and the interplay between experiment, simulation, and theory
Process of building a computer model, and the interplay between experiment, simulation, and theory
Computer simulation: Computer simulation of the process of osmosis
Computer simulation of the process of osmosis

Worked examples

Example 1 — a first encounter with Computer simulation

Start with the simplest possible case. Write down what Computer simulation claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Computer simulation before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Computer simulation ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Computer simulation

In research
Computer simulation appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Computer simulation in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Computer simulation is common in secondary-school and first-year university syllabi. It links to neighbouring topics Alternatives to animal testing, Computational fields of study, Computational science, so understanding it makes those chapters shorter.
In everyday life
Look for Computer simulation outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Computer simulation” →

How to study Computer simulation in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Computer simulation means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Computer simulation out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Computer simulation in simple terms?

Computer simulation is the running of a mathematical model on a computer, the model being designed to represent the behaviour of, or the outcome of, a real-world or physical system. The reliability of some mathematical models can be determined by comparing their results to the real-world outcomes t…

Why does Computer simulation matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Computer simulation?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Computer simulation.

Tags

  • Alternatives to animal testing
  • Computational fields of study
  • Computational science
  • Computer simulation
  • Simulation software
  • Virtual reality

Keep exploring