The dependence of the round-trip matriee elements on the position of reference plane is given, The variable method for mode calculations of multi-element cavity has been demonstrated. Some cavity modes are calculated by this method as examples.