Hi,
The .func
mod(x,y) {((x/y)-int(x/y))*y}
This is a user-defined function.
The function name is 'mod'
The input parameters are x and y.
{((x/y)-int(x/y))*y}
This mathematical describes the function
in this case it describes the modulo function, it returns the remainder after division.
mod(11,4) = 3
The SPICE variable
time is the current simulation time.
so
mod(time,60) would generate a ramp that goes from 0-59.99999
Voltage sourceThe voltage source is the first time in the expression. In this case the voltage source is 28.
Jay_Diddy_B