TypeError: unsupported operand type(s) for +: ‘int’ and ‘list’ for molecular dynamics simulation

Why am I getting the error in line 4 of my code for an MD simulation?

a = [x*delta_t for x in velocities]
b = [x*(0.5/m)*(delta_t**2) for x in list_of_f]
for i in range (len(xcoords)):
    c = xcoords[i] + a[i] + b[i]

unsupported operand type(s) for +: 'int' and 'list'

Read more here: https://stackoverflow.com/questions/64950316/typeerror-unsupported-operand-types-for-int-and-list-for-molecular-dyn

Content Attribution

This content was originally published by da2ksentine7 at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: