We’re putting the final touches on our new badges platform. Badge issuance remains temporarily paused, but all completions are being recorded and will be fulfilled once the platform is live. Thank you for your patience.

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