# Rdf with unequal number of particles.

9 views
Skip to first unread message

### Jenis Thongam

unread,
Dec 4, 2023, 9:04:51 AM12/4/23
to freud-users
Hi,
I have been using freud for the past few months to compute the radial distribution function. So far I have had an equal number of particles for every data frame. I have a 3d array of shape 2001, 450, 3 (2001 data frames, 450 particles, and x,y,z coordinates) which I fed to freud and computed the rdf and it worked.

Now, I have variable particle numbers for every data frame. So I tried to make an empty 3d zero array where for every data frame, I replaced the zeros with the particle coordinates. But the rdf from this method gives a misleading picture in the sense that I have values along the y-axis for x value between 0 and 1 which indicates that my particles are overlapping which is not the case.

Now, if I find the frame that has the lowest number of particles and then truncate the whole data (eliminating the zeros along with some particle coordinates), then the rdf gives the correct picture. But with this method, I lose many particle coordinates.

So, does freud have any other way to compute the rdf of particles where the number of particles changes with every data frame?

Thank you for your time and consideration.
Regards,
Jenis Thongam.

### Tommy Waltmann

unread,
Dec 4, 2023, 9:49:53 AM12/4/23
to freud-users
Hi Jenis,

freud will handle RDFs where each frame is a different number of particles. Each call to compute should contain the data for the given frame without any padded zeros. If this needs further clarification, please let me know.

Best,
Tommy

### Jenis Thongam

unread,
Dec 4, 2023, 10:17:11 AM12/4/23
to freud...@googlegroups.com
Hello Tommy,

I tried your approach where I use all of the available particle coordinates in each data frame (which will be different from one data frame to another) and it has resolved the problem.

So many thanks for your concise and quick response.
Regards,
Jenis Thongam.

--
You received this message because you are subscribed to the Google Groups "freud-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to freud-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/freud-users/aa7b58b4-908c-4317-92ea-33083eaabd2en%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages