Ansys Learning Forum › Forums › Discuss Simulation › General Mechanical › how to assign energy probe using APDL command ? › Reply To: how to assign energy probe using APDL command ?
I tried to modify the code as next, , in addition, I tried to print out the potential_energy array to a text file as shown. The text file was created, but unfortunately empty. And also ‘my_energy’ is zero
/POST1
SET,LAST
ESEL,S,ENAME,,185
*DIM,potential_energy,ARRAY,55 ! Number of steps
*DO, step, 1, 55, 1
/SOLU
*GET,energy,SENE,step,ITEM
potential_energy(step) = energy
*ENDDO
*CFOPEN,my_file,TXT,C:\Users\MD\Desktop\energy\
*VWRITE, potential_energy(1:55),”%10.2F”
*CFCLOSE
*GET, max_index, potential_energy, MAX
*GET, my_energy, ARRAY, potential_energy(max_index)
regards