Thanks a lot for your help.
Let me clarify my question, I can use ansys to extract the stiffness matrix for a structure using this procedure
I want to find stiffness and mass matrix from ANSYS Classic. I found a method from internet. It is as follows.
1.Build your model normally. No need to apply boundary conditions
2. solu->New analysis->Substructuring
3.Sol->Analysis options and give your substructure name
4.solu->Master DOFs->Define->Pick All->All DOF->OK
5.solu->solve LS
6. Click UM->List->Other->Superelement Data Set the name of your *.sub file, the name you defined in step 3, and set KOPT=Full Contents, then click OK
7.ANSYS will list super element data. Scroll down to:GLOBAL DOF SET NODES, LABELS=.Next ANSYS lists the order of the DOF vector for your global stiffness matrix.I have tried it and it works pretty good but now I want to get the overall/lumped/equivalent stiffness matrix for the structure like the one we get from the energy methods but using ansys. Do u know how ?