espressomd-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: net force applied on an object


From: Martin Kaiser
Subject: Re: net force applied on an object
Date: Sat, 18 Dec 2021 11:15:57 +0100

Dear Shammi,

in the documentation,

https://espressomd.github.io/doc4.1.4/particles.html

at point 4.3, you will find the command to access particle properties, which includes the force. In general the syntax is:

system.part[<INDEX>].<PROPERTY>

so for the force:

system.part[<INDEX>].f

This will give you an array of 3 values, which are the force in each spatial direction, x, y and z.
You can simply use the numpy function:

numpy.linalg.norm(force)

,where "force" is the array returned by espresso, to get the magnitude.
Do this after each integration, or save the force values to a file, to do this analysis later for each time step.

Best,
Martin
On Dec 18, 2021 09:07, Shammi Babar <babarshammi@gmail.com> wrote:
dear users,
 
how to output net force applied on a particle at each step of simulation? 

thanks


reply via email to

[Prev in Thread] Current Thread [Next in Thread]