Security analysis of large power systems requires the evaluation of a large number of possible contingencies of the power system. For large power systems, even if only single component contingencies are considered or if fast methods are employed, full AC analysis of all contingencies would need a large computation time. An efficient method for contingency analysis is presented. The proposed approach is based on the offline calculation of a full single contingency analysis of the studied power system. The information acquired by realizing this contingency analysis is stored and utilized to establish a knowledge base. In real time the knowledge base is used to perform a single contingency analysis around the operating point for which the basis case has been calculated. The same knowledge base is also used to carry out a double contingency analysis at the operating point for which it has been established