I know that inverse kinematics ($p \rightarrow q$, p: desired pose of the end-effector, q: joint angles) is not a function because there might be multiple joint angle vectors q that result in the same pose p.
By inverse dynamics control I mean the mapping $(q, \dot{q}, \ddot{q}) \rightarrow u$ (u: required torques. I am not very experienced with these kind of problems. Is the mapping a function, i.e. for each triple $(q, \dot{q}, \ddot{q})$ there is a unique solution u? My intuition says it is. But I am not sure. If there is not, would it always be possible to obtain a solution by averaging two or more solutions?