General Mechanical

General Mechanical

Topics related to Mechanical Enterprise, Motion, Additive Print and more.

How to extract proper Eigenvalues and Mode shapes from Mass and Stiffness matrices

    • nalin2021
      Subscriber
    • Erik Kostson
      Ansys Employee

      Ansys employees are not able to download , and further more can not provide any advice in regards to other software (e.g., Matlab). Perhaps other users who have done this can help here.

      What we can suggest is to do a simple example where we can hand calculate the natural frequencies of a free free beam say, then export the matrices and do a hand calculation on those matrices for the frequency and see that you get the same as in theory and then you know the export is ok.

      All the best

      Erik
    • nalin2021
      Subscriber
      @ekostson

      Do you know of any alternative method to extract Mass and Stiffness matrices other than (https://www.youtube.com/watch?v=C1CIfrs9_KY&ab_channel=AnsysTechTips)?
    • Erik Kostson
      Ansys Employee

      Since this is an official Ansys video, I would recommend that for extracting those.

      All the best

      Erik
      • Md_Salem
        Subscriber
        Hello Erik,
         
        I need to extract the mode shape vectors of some cantilever plate to make a correlation between some of them analytically.
         
        I used the workbench to simulate the problem and added the next APDL command to extract both mass and stiffness matrices in  MMF:
         
        /AUX2
        COMBINE, FULL
        /POST1
        *SMAT, MatKS, D, IMPORT, FULL, file.full, STIFF
        *SMAT, MatMS, D, IMPORT, FULL, file.full, MASS
        *Export, MatKS, MMF, matK_MMF.txt 
         
         
        *Export, MatMS, MMF, matM_MMF.txt 
         
        Then I did modal analysis , and I got the two files of mass and stiffness matrices in MMF.
         
        I used the next Matlab code to solve the eigen problem in order to extract mode shapes.
         
         
         
         
        clc;
        clear all;
        format shortG;
        format loose;
         
         
        load matK_MMF.txt;
        K = zeros(462,462);
        for r = 2:5515
            K(matK_MMF(r,1), matK_MMF(r,2)) = matK_MMF(r,3);
        end
        disp (K)
         
         
         
         
        load matM_MMF.txt;
        M = zeros(462,462);
        for r = 2:1999
            M(matM_MMF(r,1), matM_MMF(r,2)) = matM_MMF(r,3);
        end
        disp(M)
         
         
        cheq=linsolve(M,K)
         
         
        [Mode,Lamda]=eig(cheq);
         
         
        lamda=diag(sort(diag(Lamda),'ascend')); % make diagonal matrix out of sorted diagonal values of input 'Lamda'
        [c, ind]=sort(diag(Lamda),'ascend'); % store the indices of which columns the sorted eigenvalues come from 'lamda'
        omegarad=sqrt(lamda);
        omegaHz=omegarad/pi/2
        mode=Mode(:,ind)
         
         
        This code ran syntactically without any errors .
         
        I checked for the first natural frequency, omegaHz(1,1), which is supposed to be 208.53 Hz as shown in the workbench analysis , but unfortunately it was 64023 Hz .
         
        Would you please show me what is wrong with that problem? 
        Or is there any possible way to extract mode shapes vectors or modal matrix directly from ANSYS ?
         
        Regards
    • nalin2021
      Subscriber

      Okay I have done as you said and I still get values for the natural frequencies that don't match up with the results indicated in ANSYS. The units have been set to metric in workbench (kg,m,s) May I ask how exactly ANSYS obtains the natural frequencies it displays in the Solution Menu (I assume it is by solving the eigenvalue problem)?
      Also according to https://www.researchgate.net/post/how_to_get_eigenvalues_for_mass_stiffness_matrices_in_ansys_apdl there might be something wrong with the exported Stiffness Matrix.
Viewing 4 reply threads
  • The topic ‘How to extract proper Eigenvalues and Mode shapes from Mass and Stiffness matrices’ is closed to new replies.