Using DoCircuits, you can generate a sine wave, square wave, pulse wave, triangular wave among others. But what if we can push the limits? What if we have near-infinite choices to the types of the wave that can be generated? Well, say hello to the piece-wise linear source. Don’t be intimidated by the name – it’s no big deal. A piece-wise linear function is a function that is defined by sub-functions where each of the sub-function is defined individually for a minute period of time.

Simply put, one can generate the function of one’s wish using this source, by defining what the amplitude of the function is supposed to be and for what time. In addition to that you can also define whether the signal is supposed to be periodic or not. So using this piece-wise linear source you can generate any signal of your choice.

So how is it possible? It works similar to the other sources. You can start by dragging and dropping a piece-wise linear source.

In the field provided you have to enter the values that the function should take and the corresponding time. For instance, let us say we give a set of data as follows: 0,0;0.05m,1;0.1m,0;0.2m,3;0.3m,0. In words it means the first point is 0 s, 0 V followed by 0.05 ms, 1 V; 0.1 ms, 0 V and so on. The first value is the time domain and the second value separated by a comma is the voltage domain. Note each point is distinguished from the next point by a semi-colon. Finally after you simulate, all these points are linearly connected to give you the function that you wanted.

Here are some different signals that I generated and plotted:

So go ahead folks! Try your hand at different types of sources for your experiments. Who knows, there could even be an artist hidden in you, and it may be revealed in how you create awesome plots! As an example, checkout the following circuit – A rectifier using a Piecewise Linear Source. Click on the circuit to run the experiment.