Modeling of Tip-Cantilever Dynamics in Atomic Force Microscopy