How to dump the angle of particles?

Hello everyone, in my system, each particle has 3 freedoms, x, y and θ. It was easy to dump x and y, but how can i dump θ?

I have read manual and I did not find responding command. So how to fix it? I do not like to get it by multiplying the angular velocities by the time step.

You need to provide more information.

Which LAMMPS version? Which atom style?
What do you mean by “theta”, i.e. which kind of per-atom angle are you talking about?

That is my problem too. I want to model a spherical particle which is attached to a rotational harmonic spring with the stiffness K. So the particle is subjected to a moment in one direction which makes the particle rotate. I don’t know how to write the code and get rotation angle (theta) as the output through dump command. I would be thankful if you could help. I think I should use granular model, right?

These statements contradict each other. If the particle would be attached to a spring, it would oscillated but not rotate in one direction.

To get the orientation of particles, you have to output its quaternions. Of course that requires using an atom style that includes quaternions, a model for force computation that computes torques and an integrator propagating the quaternions based on the torques.

To the best of my knowledge, there is nothing in LAMMPS that implements what you describe as a model. But LAMMPS is a very large software package, and there may be features I don’t recall. If the functionality you seek has been programmed, it is mentioned in the documentation. For everything else, you will have to start by adding an implementation of your model in C++. I am not familiar with the kind of model you describe (and confused by your description to begin with), so I cannot recommend which of the available features would be best for your model.

So, if the particle is subjected to a dynamic moment, then yes it oscillates back and forth. Therefore, imagine a particle that has attached to a rotational spring and subjected to a dynamic moment. I want to obtain angles in different time steps.

I already explained what you can do.

Hello, this is my problem too, Could you find a way to dump theta?

Hi, I can imagine a few possible answers to your question, but they are all highly contingent on exactly what you are trying to accomplish (e.g. what are you using for a “rotational harmonic spring?”).

I would recommend you write up a more detailed description of what you are/trying to simulate and create a new post. See the post below for what information is needed so you can get the most accurate feedback.

Hope this helps.

Thank you for letting me know the guidelines. My LAMMPS version is 29 Aug 2024. About your question regarding what am I using for a rotational spring, I should say this is also my question.
Totally, I want to model two particles. particle number one is fixed and can not move in any way, and particle number 2 is attached to the particle number 1 by a rotational spring (which I don’t know how to model it). So, the particle number 2 is subjected to a dynamic moment like (M0 sin(wt)) so the particle number 2 rotates over time. I want to obtain the rotation of particle number 2 in different time steps.
so:

  1. How to model such a spring in LAMMPS?
  2. How to obtain the particle number 2 rotation (theta) over time, as outputs?
  3. If possible, how to visualize the rotation by VMD or other applications?

Dumping angles between atoms of interest is easy to do with compute angle/local. A less sophisticated method would be using variables equal to atom coordinates to calculate the angle inside the LAMMPS input file. Your rotational spring can probably be modeled with a combination of the harmonic angle style and fix setforce.