# Least-squares solution of equations of motion under inconsistent constraints

Joel Franklin

► To cite this version:

Joel Franklin. Least-squares solution of equations of motion under inconsistent constraints. Linear Algebra and its Applications, 1995, 222, pp.9 - 13. 10.1016/0024-3795(93)00267-4. hal-01406290

HAL Id: hal-01406290

https://hal.science/hal-01406290v1

Submitted on 1 Dec 2016

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons CC BY 4.0 - Attribution - International License
# Least-Squares Solution of Equations of Motion
Under Inconsistent Constraints

Joel Franklin

*Applied Mathematics Department*
*California Institute of Technology*
*Pasadena, California 91125*

## ABSTRACT

Udwadia and Kalaba have obtained explicit equations for the motion of discrete mechanical systems under consistent holonomic or nonholonomic constraints. Using the extremal property of the Moore-Penrose pseudoinverse, a direct proof now shows that the UK equations also determine the least-squares solution for motion under inconsistent constraints.

F. E. Udwadia and R. E. Kalaba [13, 12] have derived equations of motion for mechanical systems under general constraints. Their equations are remarkable because they apply even to nonholonomic constraints. According to Herbert Goldstein [5, p. 16], “... the more vicious cases of nonholonomic constraint must be tackled individually, and consequently in the development of the more formal aspects of classical mechanics it is almost invariably assumed that any constraint, if present, is holonomic.”

As an application of linear algebra, the Udwadia-Kalaba equations are interesting because they are easily obtained from the Moore-Penrose pseudoinverse [8, 11]. The present paper extends the Udwadia-Kalaba results to systems with complex coordinates and to systems with inconsistent constraints for which a least-squares solution is desired.

If $B$ is any $m \times n$ matrix with complex components, the Moore-Penrose pseudoinverse may be defined as the $n \times m$ matrix $B^+$ such that, for all given vectors $g \in C^m$, the unique vector $w$ of minimum Euclidian norm $\|w\|$ that minimizes the error norm $\|Bw - g\|$ is $w = B^+g$. The pseudoinverse $B^+$ is easily obtained from the singular-value decomposition of $B$; see, e.g., Golub and Van Loan [6, p. 139].

The basic references in mechanics include papers by d'Alembert [1], Lagrange [7], Gauss [3], Gibbs [4], and Appell [2]. See also Pars [10] and
Neimark and Fufaev [9]. The following purely algebraic discussion can be applied to mechanics by setting

$z = \ddot{x}(t) = \text{the unknown acceleration vector,}$

$M = M(x, \dot{x}, t)$ the given $n \times n$ positive-definite mass matrix,

$f = f(x, \dot{x}, t) = \text{the vector of applied forces,}$

$A = A(x, \dot{x}, t)$ a given $m \times n$ matrix (no assumption is made about the rank of $A$),

$b = b(x, \dot{x}, t) = \text{a given vector,}$

$\{Az = b\}$ — the (possibly redundant or inconsistent) system of
of constraints,

$f^c = f^c(x, \dot{x}, t) = \text{the unknown vector of internal forces.}$

Holonomic constraints have the form [5, p. 12]

$$h_i(x(t), t) = 0 \quad (i = 1, \dots, m),$$

where $x(t)$ is the vector of position coordinates. A virtual displacement $\delta x$ satisfies the equations

$$\sum_{j=1}^{n} \frac{\partial h_i}{\partial x_j} \delta x_j = 0 \quad (i = 1, \dots, m).$$

D'Alembert's principle of virtual work requires that $(\delta x)^T (M\ddot{x} - f) = 0$ for all virtual displacements $\delta x$, where $M$ is the mass matrix, $\ddot{x}$ is the acceleration vector, and $f$ is the vector of applied forces. If the $m$ constraints leave $k$ degrees of freedom, the original coordinates $x_1, \dots, x_n$ are replaced by $k$ Lagrangian coordinates $q_1, \dots, q_k$, and one obtains the classical Lagrange equations of constrained motion [5, p. 20].

Nonholonomic constraints often take the form

$$h_i(x(t), \dot{x}(t), t) = 0 \quad (i = 1, \dots, m)$$

In the example of a vertical disk rolling on a horizontal plane [5, p. 15], if we define the four independent coordinates $x_1, x_2, x_3 = \theta, x_4 = \phi$, we have the two nonholonomic constraints

$$\dot{x}_1 - a(\sin x_3)\dot{x}_4 = 0,$$

$$\dot{x}_2 + a(\cos x_3)\dot{x}_4 = 0.$$

These constraints cannot be put into holonomic form.
In general, differentiation of the constraint equations with respect to time produces a linear system of the form $A\ddot{x} = b$, where the matrix $A$ and the vector $b$ depend on $x, \dot{x}$, and $t$. The extended principle of virtual work, as it appears in [13], now requires that $v^*(M\ddot{x} - f) = 0$ for all variations $v$ satisfying $Av = 0$.

We will state three problems, and we will prove they are equivalent. Problem 3 generalizes a minimum principle of Gauss [3]. The common solution is easily obtained with the matrix pseudoinverse.

**PROBLEM 1.** Find column vectors $z$ and $f^c$ such that $Mz = f + f^c$, $\|Az - b\| = \text{minimum, where } v^*f^c = 0$ for all $v$ satisfying $Av = 0$.

**PROBLEM 2.** Find column vectors $z$ and $f^c$ such that $Mz = f + f^c$, $\|Az - b\| = \text{minimum, where } f^c \text{ has the form } f^c = A^*u$.

**PROBLEM 3.** Find the unique vector $z$ that minimizes $z^*Mz - 2\text{Re}(f^*z)$ for all $z$ that minimize $\|Az - b\|$. Then define $f^c = Mz - f$.

**THEOREM.** Assume that $M$ is positive definite. Then the three problems are equivalent. They each have the unique solution vectors

$$f^c = M^{1/2}(AM^{-1/2})^+(b - AM^{-1}f), \quad z = M^{-1}(f + f^c).$$

**NOTE.** Udwadia and Kalaba obtained this solution in [13] assuming real data and consistent constraints $Az = b$. Inconsistent constraints, for which $Az = b$ has no solution, may appear if the data $A$ and $b$ contain errors of measurement.

**PROOF.** Define $w, B$, and $g$ as follows:

$$w = M^{1/2}z - M^{-1/2}f, \quad B = AM^{-1/2}, \quad g = b - AM^{-1}f.$$

Then

$$\|w\|^2 = z^*Mz - 2\text{Re}(f^*z) + f^*M^{-1}f, \quad Bw - g = Az - b.$$

Now Problem 3 takes this form: Find the vector $w$ of minimum norm $\|w\|$ that minimizes the error norm $\|Bw - g\|$. This is the minimum problem that defines the pseudoinverse $B^+$; the unique solution vector is $w = B^+g$. In terms of the original unknown $z$, the unique solution is

$$z = M^{-1}f + M^{-1/2}B^+(b - AM^{-1}f).$$

Setting $f^c = Mz - f$, we have the unique asserted solution vectors $f^c$ and $z$.
To prove the three problems are equivalent, we first recall some elementary results of linear algebra. First, the matrices $A^*$ and $A^*A$ have the same range; second, the range of $A^*$ is the orthogonal complement of the null space of $A$; third, $z$ minimizes $\|Az - b\|$ if and only if $A^*Az - A^*b = 0$. In brief,

$$ \begin{aligned} \mathcal{R}(A^*) &= \mathcal{R}(A^*A), \quad \mathcal{R}(A^*) = [\mathcal{N}(A)]^\perp, \quad \|Az - b\| = \min \\ &\Leftrightarrow A^*Az - A^*b = 0. \end{aligned} $$

Hence, Problems 1, 2, and 3 may be restated as follows:

**PROBLEM 1'.** Find $z$ and $f^c$ such that

$$ Mz = f + f^c, \quad A^*Az = A^*b, \quad f^c \in [\mathcal{N}(A)]^\perp, $$

where $v^*f^c = 0$ for all $v \in \mathcal{N}(A)$, the null space of $A$.

**PROBLEM 2'.** Find $z$ and $f^c$ such that

$$ Mz = f + f^c, \quad A^*Az = A^*b, \quad f^c \in \mathcal{R}(A^*). $$

**PROBLEM 3'.** Find $z$ satisfying the constrained-minimum problem

$$ z^*Mz - 2 \operatorname{Re}(f^*z) = \min \quad \text{for} \quad A^*Az - A^*b = 0; $$

then define $f^c = Mz - f$.

The Lagrangian of Problem 3' has the form

$$ \frac{1}{2} z^* M z - \operatorname{Re}(f^* z) - \operatorname{Re}[p^*(A^* A z - A^* b)], $$

where the $2n$ real Lagrange multipliers are the real and imaginary parts of the unknown vector $p \in \mathbb{C}^n$. Lagrange's variational equations are

$$ Mz - f - A^*Ap = 0, \quad A^*Az - A^*b = 0. $$

Since $M$ is assumed positive definite, these equations are sufficient as well as necessary for the solution $z$, and hence $f^c$, to Problem 3. Setting $f^c = A^*Ap = A^*u$, we see that Problem 2' is equivalent to Problem 3'.

Problems 1' and 2' are the same except that the first problem requires $f^c$ to be orthogonal to $\mathcal{N}(A)$ where the second problem requires $f^c$ to lie in $\mathcal{R}(A^*)$. Since $[\mathcal{N}(A)]^\perp = \mathcal{R}(A^*)$, the theorem is proved. ■
REFERENCES

1 J. d'Alembert, *Traité de Dynamique*, Paris, 1743.

2 P. Appell, Sur une forme générale des équations de la dynamique, *C. R. Acad. Sci. Paris* 129:459-460 (1899).

3 C. F. Gauss, Über ein neues allgemeines Grundgesetz der Mechanik, *J. Reine Angew. Math.* 4:232-235 (1829).

4 W. Gibbs, On the fundamental formulae of dynamics, *Amer. J. Math.* II:49-64 (1879).

5 Herbert Goldstein, *Classical Mechanics*, 2nd ed., Addison-Wesley, 1980.

6 G. H. Golub and C. F. Van Loan, *Matrix Computations*, Johns Hopkins U.P., Baltimore, 1983.

7 J. L. Lagrange, *Mécanique Analytique*, Mme Ve Courcier, Paris, 1787.

8 E. H. Moore, On the reciprocal of the general algebraic matrix, Abstract, *Bull. Amer. Math. Soc.* 26:394-395 (1920).

9 Ju. I. Neimark and N. A. Fufaev, *Dynamics of Nonholonomic Systems* (transl. from Russian), Amer. Math. Soc. Providence, 1972.

10 L. A. Pars, *A Treatise on Analytical Dynamics*, Ox Bow Press, Woodbridge, Conn., 1979.

11 R. Penrose, A generalized inverse of matrices, *Proc. Cambridge Philos. Soc.* 51:406-413 (1955).

12 F. E. Udwadia, A New Perspective on Constrained Motion, notes, Applied Mathematics Colloquium, Caltech, 26 Apr. 1993.

13 F. E. Udwadia and R. E. Kalaba, A new perspective on constrained motion, *Proc. Roy. Soc. London Ser. A* 439:407-410 (1992).