-
-
November 6, 2024 at 4:39 amblmcdonaSubscriber
Are commands such as the "ematwrite,yes" command supported with this software version? I have written the command as an inserted command object in the model tree, but the stiffness matrix is not being written. Is this due to using the Student Version of the software?
-
November 7, 2024 at 8:43 amAniketForum Moderator
it should work in the student version as well.
The EMATWRITE command in Mechanical APDL forces the writing of the element matrices to a file named Jobname.emat. This command can be particularly useful when you need to ensure that the element matrices are written out, which might not be done by default. The command can be used with a key of "YES" to force the writing of the element matrices, even if it's not normally done. By default, the value is "NO," which means element matrices are written only if required. It's important to note that if used in the solution processor with the /SOLU command, EMATWRITE is valid only within the first load step. Additionally, this command is also valid in PREP7, but it cannot be accessed from a menu.
-Aniket
-
November 7, 2024 at 5:12 pmblmcdonaSubscriber
Thank you for your response. Regarding commands, I actually used different commands to write the following code for stiffness and mass matrix:
*CFOPEN, stiffness_matrix.txt, TXT ! Open a file for writing the stiffness matrix/SOLU ! Switch to the solution environmentMAT, K, 1, STIFF ! This will extract the global stiffness matrix*DO, I, 1, 1000 ! Loop over matrix rows (adjust the number based on your model size)*DO, J, 1, 1000 ! Loop over matrix columns (adjust based on your model)*GET, Kij, MATRIX, I, J, STIFF ! Get the stiffness matrix component K_ij*VWRITE, I, J, Kij(F10.5, F10.5, F10.5) ! Format for writing the data*ENDDO*ENDDO*CFCLOS ! Close the output file after writing the matrix!Mass matrix*CFOPEN, global_mass_matrix.txt, TXT ! Open a text file for writing the mass matrix/SOLU ! Switch to the solution environmentMAT, M, 1, MASS ! Extract the global mass matrix*DO, I, 1, 1000 ! Loop over matrix rows (adjust the number based on your model size)*DO, J, 1, 1000 ! Loop over matrix columns (adjust based on your model)*GET, Mij, MATRIX, I, J, MASS ! Get the mass matrix component M_ij*VWRITE, I, J, Mij(F10.5, F10.5, F10.5) ! Format for writing the data (adjust as needed)*ENDDO*ENDDO*CFCLOS ! Close the output file after writing the matrixHowever, the matrices are not square. Instead, the only have three columns. How do I make the matrices square?Best,Brandon -
November 9, 2024 at 8:52 amblmcdonaSubscriber
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 environmentMAT, 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 matrixThe 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 -
November 11, 2024 at 9:39 amAshish KhemkaForum Moderator
Hello,
I think MAT command is used to define element attributes. Please refer to following forum thread which should be helpful:
How to Create a Stiffness Matrix in APDL
Thanks and Regards,
Ashish Khemka
-
- You must be logged in to reply to this topic.
-
1116
-
468
-
445
-
225
-
201
© 2024 Copyright ANSYS, Inc. All rights reserved.