Ritz method
The Ritz method is a direct method to find an approximate solution for boundary value problems. The method is named after Walther Ritz, although also commonly called the Rayleigh–Ritz method and the Ritz-Galerkin method. In quantum mechanics, a system of particles can be described in terms of an "energy functional" or Hamiltonian, which will measure the energy of any proposed configuration of said particles. It turns out that certain privileged configurations are more likely than other configurations, and this has to do with the eigenanalysis ("analysis of characteristics") of this Hamiltonian system. Because it is often  impossible to analyze all of the infinite configurations of particles to find the one with the least amount of energy, it becomes essential to be able to approximate this Hamiltonian in some way for the purpose of numerical computations. The Ritz method can be used to achieve this goal. In the language of mathematics, it is exactly the finite element method used to compute the eigenvectors and eigenvalues of a Hamiltonian system. Definitions. As with other variational methods, a trial wave function, formula_1, is tested on the system. This trial function is selected to meet boundary conditions (and any other  physical constraints). The exact function is not known; the trial function contains one or more adjustable parameters, which are varied to find a lowest energy configuration. It can be shown that the ground state energy, formula_2, satisfies an inequality: That is, the ground-state energy is less than this value. The trial wave-function will always give an expectation value larger than or equal to the ground-energy. If the trial wave function is known to be orthogonal to the ground state, then it will provide a boundary for the energy of some excited state. The Ritz ansatz function is  a linear combination of "N" known basis functions formula_4, parametrized by unknown coefficients: With a known Hamiltonian, we can write its expected value as The basis functions are usually not orthogonal, so that the overlap matrix S has nonzero nondiagonal elements. Either formula_7 or formula_8 (the conjugation of the first) can be used to minimize the expectation value. For instance, by making the partial derivatives of formula_9 over formula_8 zero, the following equality is obtained for every "k" = 1, 2, ..., "N": which leads to a set of "N" secular equations: In the above equations, energy formula_9 and the coefficients  formula_14 are unknown. With respect to c, this is a homogeneous set of linear equations, which has a solution when the determinant of the coefficients to these unknowns is zero: which in turn is true only for "N" values of formula_9. Furthermore, since the Hamiltonian is a hermitian operator, the H matrix is also hermitian and the values of formula_17 will be real. The lowest value among formula_17 (i=1,2..,N), formula_19, will be the best approximation to the ground state for the basis functions used. The remaining "N-1" energies are estimates of excited state energies. An approximation for the wave  function of state "i" can be obtained by finding the coefficients formula_14 from the corresponding secular equation. Applications in mechanical engineering. The Rayleigh–Ritz method is often used in mechanical engineering for finding the approximate real resonant frequencies of multi degree of freedom systems, such as spring mass systems or flywheels on a shaft with varying cross section. It is an extension of Rayleigh's method. It can also be used for finding buckling loads and post-buckling behaviour for columns. Consider the case whereby we want to find the resonant frequency of oscillation of a system. First, write the  oscillation in the form, formula_21 with an unknown mode shape formula_22. Next, find the total energy of the system, consisting of a kinetic energy term and a potential energy term. The kinetic energy term involves the square of the time derivative of formula_23 and thus gains a factor of formula_24. Thus, we can calculate the total energy of the system and express it in the following form: formula_25 By conservation of energy, the average kinetic energy must be equal to the average potential energy. Thus, formula_26 which is also known as the Rayleigh quotient. Thus, if we knew the mode  shape formula_22, we would be able to calculate formula_28 and formula_29, and in turn get the eigenfrequency. However, we do not yet know the mode shape. In order to find this, we can approximate formula_22 as a combination of a few approximating functions formula_31 formula_32 where formula_33 are constants to be determined. In general, if we choose a random set of formula_33, it will describe a superposition of the actual eigenmodes of the system. However, if we seek formula_33 such that the eigenfrequency formula_36 is minimised, then the mode described by this set of formula_33 will be close to the  lowest possible actual eigenmode of the system. Thus, this finds the lowest eigenfrequency. If we find eigenmodes orthogonal to this approximated lowest eigenmode, we can approximately find the next few eigenfrequencies as well. In general, we can express formula_28 and formula_29 as a collection of terms quadratic in the coefficients formula_40: formula_41 formula_42 where formula_43 and formula_44 are the stiffness matrix and mass matrix of a discrete system respectively. The minimization of formula_36 becomes: formula_46 Solving this, formula_47 formula_48 formula_49 For a non-trivial solution of c, we require determinant of the matrix coefficient of c to be zero. formula_50  This gives a solution for the first N eigenfrequencies and eigenmodes of the system, with N being the number of approximating functions. Simple case of double spring-mass system. The following discussion uses the simplest case, where the system has two lumped springs and two lumped masses, and only two mode shapes are assumed. Hence "M" = ["m", "m"] and "K" = ["k", "k"]. A mode shape is assumed for the system, with two terms, one of which is weighted by a factor "B", e.g. "Y" = [1, 1] + "B"[1, −1]. Simple harmonic motion theory says that the velocity  at the time when deflection is zero, is the angular frequency formula_51 times the deflection (y) at time of maximum deflection. In this example the kinetic energy (KE) for each mass is formula_52 etc., and the potential energy (PE) for each spring is formula_53 etc. We also know that without damping, the maximal KE equals the maximal PE. Thus, Note that the overall amplitude of the mode shape cancels out from each side, always. That is, the actual size of the assumed deflection does not matter, just the mode "shape". Mathematical manipulations then obtain an expression for formula_51, in terms  of B, which can be differentiated with respect to B, to find the minimum, i.e. when formula_56. This gives the value of B for which formula_51 is lowest. This is an upper bound solution for formula_51 if formula_51 is hoped to be the predicted fundamental frequency of the system because the mode shape is "assumed", but we have found the lowest value of that upper bound, given our assumptions, because B is used to find the optimal 'mix' of the two assumed mode shape functions. There are many tricks with this method, the most important is to try and choose  realistic assumed mode shapes. For example, in the case of beam deflection problems it is wise to use a deformed shape that is analytically similar to the expected solution. A quartic may fit most of the easy problems of simply linked beams even if the order of the deformed solution may be lower. The springs and masses do not have to be discrete, they can be continuous (or a mixture), and this method can be easily used in a spreadsheet to find the natural frequencies of quite complex distributed systems, if you can describe the distributed KE and PE terms  easily, or else break the continuous elements up into discrete parts. This method could be used iteratively, adding additional mode shapes to the previous best solution, or you can build up a long expression with many Bs and many mode shapes, and then differentiate them partially. The relationship with the finite element method. In the language of the finite element method, the matrix formula_60 is precisely the "stiffness matrix" of the Hamiltonian in the piecewise linear element space, and the matrix formula_61 is the "mass matrix". In the language of linear algebra, the value formula_62 is an eigenvalue of the  discretized Hamiltonian, and the vector formula_63 is a discretized eigenvector.