Using E-field with a function

Greetings! I am a newer LAMMPS user, and I am trying to simulate an electric field that oscillates like a sine/cosine function. Currently, I have a working example of an E-field that is easier to generate, that section of my input set up as follows:

variable oscillate equal 0.01
fix kick all efield 0.0 0.0 v_oscillate

Being a new user, I am unsure how (or even if it is possible) to manipulate this to obtain my desired field.
I appreciate any help that you can give!

Are you looking for a temporal or spatial oscillation?

Spatial oscillation is what I was initially planning to attempt

From the fix efield documentation:

Atom-style variables can specify the same formulas as equal-style variables but can also include per-atom values, such as atom coordinates. Thus it is easy to specify a spatially-dependent E-field with optional time-dependence as well.

Thank you!
So I think that answers my question, because (if I interpret all of this correctly) the efield WILL accept the Math functions as defined in LAMMPS. Correct?

What is available for variable expressions (and either equal or atom style or both) is documented in the manual. Check out the docs of the “variable” command.

It is good practice to make some tests. You can output atom style variable values in custom dumps alongside their atom IDs and coordinates.