A virtual NC − AFM machine has been built using the Matlab language. The virtual NC − AFM is identical to a real hybrid machine built with Digital Instruments and Omicron blocks. The
role of every subset is described in detail, and special attention is paid to the parameters of the
Automatic Gain Control (AGC) which controls the amplitude of the oscillations. The virtual machine is
a powerful tool, that allows to solve, without any approximation, non linear coupled differential
equations describing the physics of the tip-surface interaction. The machine is then used to study the
frequency shift and damping signal in the approach-retract mode. Two types of situations are analyzed: the
first one corresponds to the case where no dissipative force is introduced in the tip-surface interaction,
the second one deals with dissipative forces. These last ones are here introduced by assuming a mechanical
deformation of the surface under the tip. Interesting results are then obtained, in particular the fact
that unstability may occur under some particular conditions. Most of the results obtained by simulation
are then compared with those of analytical models already published in the literature.