The PieceWise Linear (PWL) Voltage Source:
What is it?
A PWL is a voltage source. It is a battery that can be programmed to
change its voltage at any time during a simulation.
What is it good for?
The PWL can be used to change the simulation condition as a function of time.
This could help us to model a changing interest rate or it could be used
to simulate the effect on Sam's savings if he stops driving when he is 85 years old.
We can also use the PWL to change our savings rate from $1,000.00 per month to $2,000.00 per
month at any time during the simulation.
The PWL will often be used to control the charge flow in a Voltage Controlled Current Source (VCCS).
It is a very useful tool to have in your simulation basket.
Tell me more!
At the left is shown the electrical symbol for a PieceWise Linear (PWL) Voltage Source named V1. A
PWL component can connect to the control terminals of the Voltage Controlled Current Source (VCCS) to
set the amount of current flow. The PWL will allow us to vary the voltage at the PWL terminals over time.
SPICE Description Format for the PieceWise Linear (PWL) Voltage Source:
Below is shown an example of how we want the voltage between the PWL terminals (N2 and N1) to change over time:
At the start of the simulation we want the voltage to be zero and then ramp up to 10 volts at 1 second. We want
the voltage to remain constant at 10 volts until 3 seconds is reached. At that time we want the voltage to
ramp down to 5 volts where it remains for the rest of the simulation. In this case the SPICE description format
for the PWL pictured above becomes:
V1 N2 N1 PWL(0s 0v 1s 10v 3s 10v 4s 5v)
The first character in this description must be a "V" so that the SPICE program knows that this circuit element is a
voltage source. V1 is the name of this particular PWL. Since all element names in the SPICE circuit description
must be unique, the name used for a second PWL element in our circuit description could be V2 or V_control etc..
The positive connection point (N2 in this example) is listed first followed by the negative terminal N1. The starting
point of the voltage at the beginning of the simulation is zero volts. The 0s 0v defines this point. The "s" means seconds
and the "v" means volts. The next point sets the voltage at one second to be 10 volts (1s 10v). The simulator will
assume a straight line between each specified point. The last point in the example is 5 volts at 4 seconds. After four
seconds the simulator holds the voltage at the previous specified value.
We will later use the PWL along with the capacitor and the Voltage Controlled Current Source to solve several
financial examples.
Back to the components page