How to write some computed parameter

I can compute the total potential energy of a system by using the command:

“compute # all pe”

but how would I get the output potential energy of the system? that is how would I write the potential energy(pe) in a dump file?

I can compute the total potential energy of a system by using the command:

"compute # all pe"

but how would I get the output potential energy of the system? that is how would I write the potential energy(pe) in a dump file?

You cannot. Dump files only output per atom properties. You can output
it as thermo output (which happens by default) or use fix print. See
the lammps documentation for details.

Axel

Specifically, read Section 6.15 of the manual
and learn about the difference between per-atom
outputs (dump) and global scalar values like pe (thermo
output).

Steve