Ansys Learning Forum Forums Discuss Simulation General Mechanical Stiffness matrix commands for student version Reply To: Stiffness matrix commands for student version

blmcdona
Subscriber

I wrote the following code in order to create a 10x10 stiffness matrix after modal analysis.  However, only the first column of the matrix is written; the rest are zeros.

 
*CFOPEN, stiffness_matrix.txt, TXT  ! Open a file for writing the stiffness matrix
 
/SOLU                     ! Switch to the solution environment
MAT, K, 1, STIFF  ! This will extract the global stiffness matrix
 
 *DO, I, 1, 10   ! Loop over matrix rows (adjust the number based on your model size)
     *DO, J, 1, 10  ! Loop over matrix columns (adjust based on your model)
         *GET, K_GLOBAL, STIF, I, J, STIFF  ! Get the stiffness matrix component K_ij
         
         *VWRITE, I, J, K_GLOBAL
         
         (F10.5, F10.5, F10.5)  ! Format for writing the data
     *ENDDO
 *ENDDO
 
*CFCLOS   ! Close the output file after writing the matrix
 
The error message that I get states that the element types 2-10 are not defined.  How do I define all 10 elements in my code?
 
Best,
Brandon