We have an exciting announcement about badges coming in May 2025. Until then, we will temporarily stop issuing new badges for course completions and certifications. However, all completions will be recorded and fulfilled after May 2025.

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 ?

Md_Salem
Subscriber

 

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