Flexible needle insertion into viscoelastic tissue is modeled in this paper with a linear beam supported by virtual springs. Using this simplified model, the forward and inverse kinematics of the needle is solved analytically, providing a way for simulation and path planning in real-time. Using the inverse kinematics, the required needle basis trajectory can be computed for any desired needle tip path. It is shown that the needle base trajectory is not unique and can be optimized to minimize lateral pressure of the needle body on the tissue. Experimental results are provided of robotically assisted insertion of flexible needle while avoiding “obstacle”.