An optimal robot-environment interaction is designed by transforming an environment model into an optimal control problem. In the optimal control, the inverse differential Riccati equation is introduced as a fixed-end-point closed-loop optimal control over a specific time interval. Then, the environment model, including interaction force is formulated in a state equation, and the optimal trajectory is determined by minimizing a cost function. Position control is proposed, and the stability of the closed-loop system is investigated using the Lyapunov direct method. Finally, theoretical developments are verified through numerical simulation.