Ansys Assistant will be unavailable on the Learning Forum starting January 30. An upgraded version is coming soon. We apologize for any inconvenience and appreciate your patience. Stay tuned for updates.

Ansys Learning Forum Forums Discuss Simulation General Mechanical How to write an array to text file ? Reply To: How to write an array to text file ?

Claudio Pedrazzi
Subscriber

Concerning the question about getting the maximum value, if I understand correctly, the problem is that everytime you go through the loop, you overwrite my_energy.  I would simply use an additional storage variable like max_my_energy and initialise it to 0 before the loop begins, then in every step you should simply compare my_energy with the maximum until there, and if higher, substitute it.  

*IF,my_energy,GT,max_my_energy,THEN

max_my_energy=my_energy

*ENDIF

[bingo_chatbox]