This paper presents a generalized numerical method which is based on the well-known Mohr method. Static or dynamic stiffness matrices, as well as nodal load vectors for the static case, of non-uniform members are derived for several effects. The method focuses on the effects of resting on variable one- or two-parameter elastic foundations or supported by no foundation; a variable iterative algorithm is developed for computer application of the method. The algorithm enables the non-uniform member to be regarded as a sub-structure. This provides an important advantage to encompass all the variable effects in the stiffness matrix of this sub-structure. Stability and free-vibration analyses of the sub-structure can also be carried out through this method. Parametric and numerical examples are given to verify the accuracy and efficiency of the submitted method. (c) 2005 Elsevier Ltd. All rights reserved.