# In Dynamic Motion Primitives, why we need to approximate f if f_target is given?

I seem to misunderstand something crucial regarding finding the force vector in the process of DMPs: The way I understand it, I should come up with a dataset of trajectories $$\{y_i\}_{i=1}^n$$, and calculate a set of "True-labels" that are the forces associated with those trajectories: $$\{f_i | f_i=\ddot y_i - \alpha_y(\beta_y(g-y_i)-\dot y_i)\}_{i=1}^n$$. Next, I can minimize the squared differences between the approximation $$\hat{f_i}$$ (which is a linear combination of Gaussians) and $$f_i$$.

If this is all correct, why do I even need the approximation $$\hat{f}$$? don't I always have the values of the real force $$f$$, as I can always calculate it given the equation of motion? In other words, If I want to follow a trajectory $$y$$, then I need to apply the force $$f(y)$$, which is given by an $$O(1)$$ computation

Perhaps my error revolves around the idea that $$\hat{f}$$ is some generalization of all the different $$f_i$$'s? as in that $$\hat{f}$$ contains the information of all forces that are possible. If that is the case - I think for example of a robotic bird. A robotic bird does not have a set of common trajectories - in some cases, it may go in circles, and in other cases, it may go straight up. In that case, how can the DMP process generalize the force to account for all possible movements of the bird? I find it hard to believe that a linear representation of the forces of the wing could contain all that information

Regarding your last paragraph, DMPs cannot generalise too much. You can "train" a DMP with $$\hat{f_i}$$ from a single $$y_i$$, where $$y_i$$ is the path to be imitated. So you can get a DMP with $$\hat{f_1}$$ for a circular movement and a DMP with $$\hat{f_2}$$ for a linear movement. The whole idea is that even complicated movements can be composed into a basis (as in linear algebra) of a reasonably small number of primitive action building blocks.
If you know in advance the exact trajectory $$y$$ that you want to perform, you don't need to use this formalism. But this is rarely a realistic assumption, since slight variation in your environment means that every trajectory (e.g. for a walking robot) will be different. Indeed computing this new trajectory in real time may be time consuming, it's much faster to adapt an existing DMP to generate a new trajectory, while only fixing few parameters (rescale factor, or endpoints). This has the added benefit of making your trajectories all consistent with the path you are imitating, which may have been recorded to be particularly harmonious.
• If I understand you correctly, $\hat{f}$ is indeed the generalization of forces $\{f_i\}$ that was given by a set of trajectories $\{y_i\}$, but those should all be similar, at least in the sense that they describe similar movements (as in only circular motions, or only upwards motion)? Regardless, If you agree that $f_{target}$ is easily obtained by substituting $y_{target}$ to the differential equation, can you clarify why we still need $\hat{f}$? Aug 19 at 8:45