Custom pair potential(wall potential)

Dear LAMMPS users, is it possible to achieve a potential that varies periodically with atomic distance in LAMMPS?
For example, the pairwise interaction potential can be described as a trigonometric function E=sin(r), where r is the distance.
Or to achieve a wall-particle interaction system, the energy is given by E=sin(z), z is the distance from the particle to the wall.
My system has two atom types, the coefficients for all pairs have been specified explicitly.
The periodic potential described above should be added to the existing system.
I tried the pair_style table to create an interpolation table, but it didn’t work because this pair style does not support mixing, and there are 3-body interactions in my system. It is not able to write all the potential energy and force values in the table file.

Thank you very much for any advice.

An interaction like you describe could be added using an atom style variable and fix addforce.