What is the difference between simulation and emulation? We write programs to implement them. Can we get both these implementation in a single program?
Emulation is the process of mimicking the outwardly observable behavior to match an existing target. The internal state of the emulation mechanism does not have to accurately reflect the internal state of the target which it is emulating.
Simulation, on the other hand, involves modeling the underlying state of the target. The end result of a good simulation is that the simulation model will emulate the target which it is simulating.
The word "emulator" was coined in 1963 at IBM during development of the NPL (IBM 360) product line, using a "new combination of software, microcode, and hardware. In 1963, when microcode was first used to speed up this simulation process, IBM engineers coined the term "emulator" to describe the concept.
It has recently become common to use the word "emulate" in the context of software. However, before 1980, "emulation" referred only to emulation with a hardware or microcode assist, while "simulation" referred to pure software emulation.
For example, a computer specially built for running programs designed for another architecture is an emulator. In contrast, a simulator could be a program which runs on a PC, so that old Atari games can be simulated on it. Purists continue to insist on this distinction, but currently the term "emulation" often means the complete imitation of a machine executing binary code while "simulation" often refers to computer simulation, where a computer program is used to simulate an abstract model.
Emulation is the process of mimicking the outwardly observable behavior to match an existing target. The internal state of the emulation mechanism does not have to accurately reflect the internal state of the target which it is emulating.
Simulation, on the other hand, involves modeling the underlying state of the target. The end result of a good simulation is that the simulation model will emulate the target which it is simulating.
The word "emulator" was coined in 1963 at IBM during development of the NPL (IBM 360) product line, using a "new combination of software, microcode, and hardware. In 1963, when microcode was first used to speed up this simulation process, IBM engineers coined the term "emulator" to describe the concept.
It has recently become common to use the word "emulate" in the context of software. However, before 1980, "emulation" referred only to emulation with a hardware or microcode assist, while "simulation" referred to pure software emulation.
For example, a computer specially built for running programs designed for another architecture is an emulator. In contrast, a simulator could be a program which runs on a PC, so that old Atari games can be simulated on it. Purists continue to insist on this distinction, but currently the term "emulation" often means the complete imitation of a machine executing binary code while "simulation" often refers to computer simulation, where a computer program is used to simulate an abstract model.
In addition to @Behrouz Ahmadi-Nedushan's incisive answer, consider
C. L. Farmer, J. M. Fowkes and N. I. M. Gould, Optimal Multilateral Well Placement, Oxford University Mathematical Institute, 2010:
http://eprints.maths.ox.ac.uk/977/1/NA-10-06.pdf
This article addresses the problem of replacing an expensive simulator with a less expensive emulator (called a surrogate model, p. 2). A good introduction to surrogate approximation is given in Section 2, starting on page 3.
A very good introduction to emulators vis-a-vis simulators is given in
L.S. Bastos, Validating Guassian Process Models in Computer Experiments, University of Sheffield, UK, 2010:
A Gaussian process emulator is a representation of our beliefs about a mathematical model in a computer program known as a simulator (p. iv). See a complete introduction to emulators in Section 2, starting on page 2.