  In this paper, a dynamic model of reconstruction of the shear force $g(t)$ in
the Atomic Force Microscopy (AFM) cantilever tip-sample interaction is
proposed. The interaction of the cone-shaped cantilever tip with the surface of
the specimen (sample) is modeled by the damped Euler-Bernoulli beam equation
$\rho_A(x)u_{tt}$ $+\mu(x)u_{t}+(r(x)u_{xx}+\kappa(x)u_{xxt})_{xx}=0$,
$(x,t)\in (0,\ell)\times (0,T)$, subject to the following initial, $u(x,0)=0$,
$u_t(x,0)=0$ and boundary, $u(0,t)=0$, $u_{x}(0,t)=0$, $\left
(r(x)u_{xx}(x,t)+\kappa(x)u_{xxt} \right )_{x=\ell}=M(t)$, $\left
(-(r(x)u_{xx}+\kappa(x)u_{xxt})_x\right )_{x=\ell}=g(t)$ conditions, where
$M(t):=2h\cos \theta\,g(t)/\pi$ is the momentum generated by the transverse
shear force $g(t)$. For the reconstruction of $g(t)$ the measured displacement
$\nu(t):=u(\ell,t)$ is used as an additional data. The least square functional
$J(F)=\frac{1}{2}\Vert u(\ell,\cdot)-\nu \Vert_{L^2(0,T)}^2$ is introduced and
an explicit gradient formula for the Fr\'echet derivative through the solution
of the adjoint problem is derived. This allows to construct a gradient based
numerical algorithm for the reconstructions of the shear force from noise free
as well as from random noisy measured output $\nu (t)$. Computational
experiments show that the proposed algorithm is very fast and robust. This
allows to develop a numerical "gadget" for computational experiments of generic
AFMs.
