# Solving equation of motion differential equation by using matlab

I have an equation of motion differential equation:

$$M\;x''(t) + C\;x'(t) + K\;x(t) = 0$$

I know $M,C,$ and $K$ (constant $4\times 4$ matrices) and also the eigenvalue-eigenvector pairs. What I do not know is how to get the general solution from this. I am using matlab.

The eigenvalue-eigenvector pairs solve the equation $\left(\lambda^2M + \lambda C + K\right)x = 0$

-

If $(\lambda, x)$ is such a pair, $e^{\lambda t} x$ satisfies the differential equation.
I'll assume $M$ is nonsingular. Then $P(\lambda) = \det(\lambda^2 M + \lambda C + K)$ is a polynomial of degree $8$ in $\lambda$, and its roots are the $\lambda_j$.
Generically there will be $8$ pairs $(\lambda_j, x_j)$ with $x_j$ linearly independent, and then the general solution is $$x(t) = \sum_{j=1}^8 e^{\lambda_j t} x_j$$ If the number of linearly independent $x_j$ for some $\lambda_j$ is less than the algebraic multiplicity of $\lambda_j$ as a root of $P$, you will also need some solutions of the form $\sum_{k=0}^n t^k e^{\lambda_j t} x_k$ for some positive integers $n$ and vectors $x_1, \ldots, x_n$.
Assuming $M$, $C$ and $K$ are real, the complex $(\lambda, x)$ should come in complex conjugate pairs. You can then get real solutions from the real and imaginary parts of $e^{\lambda t} x$. Thus if $\lambda = \alpha + i \beta$ and $x = u + i v$ where $\alpha, \beta, u, v$ are real, you take the real solutions $e^{\alpha t} (\cos(\beta t) u - \sin(\beta t) v)$ and $e^{\alpha t} (\sin(\beta t) u + \cos(\beta t) v)$. – Robert Israel Nov 28 '12 at 7:56