If idx is a single number, then acc(idx) needs to be a single number. Evidently something in your expression is an array. Try this:
idx
size(idx)
size(px(idx))
size(Ffriction)
size(mass)
What do you see? One of them does not have a size of 1. It's not a scalar. One of them is an array with multiple elements.
Or else Ffriction doesn't have the same number of elements as idx.