# Using the “bi” and “bv” Arbitrary Sources in LTspice

The arbitrary sources in LTspice are incredibly versatile and useful. In the previous article it was shown how the “bi” source could be used to make a simple current dependent current source (“bv” could similarly be used to make a current dependent voltage source); however, the arbitrary sources can be used to create much more complex current/voltage sources based on virtually any combination of simulation parameters and LTspice recognized mathematical functions. Here two examples of how to use arbitrary sources are given with the associated LTspice circuit downloads provided.

## A Time Stepped Current Source.

This can be done with a PWL function, PWL file, or table, but all those things can get rather tedious if lots of steps or frequent editing is necessary. The same thing can be done very quickly, easily, and with a lot more simplicity and versatility via a “bi” arbitrary source. Observe.

Here the current source as defined is feeding a parallel 1 kOhm and 100 nF load. It is defined to provide a 1 mA current step increase every 1 ms by utilizing the ceil() function and time parameter. Since the simulation is run as a transient simulation from 0 to 10 ms, the current steps up from 0 to 1 mA just after time = 0 and continues at the 1 mA/ms step rate from there. Imagine how many other useful source behaviors could be created using arbitrary sources and the correct application of the LTspice recognized mathematical functions.

## A Sinusoidal Voltage Source With a Periodic Logarithmic Frequency Step

Here a sinusoidal voltage source ( sin(2pif*t) ) is defined with the following characteristics.

• A 100V amplitude ( 100*sin )
• A starting (time = 0) frequency of 1 kHz ( 2pi1k )
• A logarithmically stepped frequency every 2 ms ( 10floor(time*500)** )
• A horizontal timescale shift of 1 ms to the left ( time+1m )

The voltage source is feeding a series RC circuit with a specifically selected time constant to set the cutoff frequency at 10 kHz, the odd and unrealistic {100n/(2*pi)} capacitor value and 1 kOhm resistor value were used just to make the math work out perfectly for the demonstration.