Consider a system on which a force acts opposite to the velocity direction. We can write its equation of motion such as
$$ m\ddot{\vec{x}} = -F\hat{v} $$
where the non-conservative force $F$ and the mass $m$ are constant and $\hat{v}$ is the velocity unit vector. Is there a way to express the condition that the force has to be opposite to the velocity vector when we derive the system's Hamiltonian?