Source Blocks

Let's begin by discussing the sources that are available:

clock: The clock element is a source that outputs the current simulation time in seconds.

<constant name="scalar_const" value="5"/>
<constant name="vector_const" value="1 2 3"/>

constant: Can be used to define a scalar or vector constant.

 

<sine amplitude="5"/>

sine: Creates a sine wave. Can specify amplitude, bias, frequency, and phase.

 

<square amplitude="3" frequency="0.5" />

square: Creates a square wave. Can specify amplitude, bias, frequency, and phase

 

<step initial="1" final="3" time="5" />

step: Creates a step function. Can specify initial value, final value, and time that step occurs.

 

<ramp amplitude="0.5" />

ramp: Creates a ramp function. Can specify amplitude and bias.

 

<triangle amplitude="3" /> 

triangle: Creates a triangle wave. Can specify amplitude, bias, frequency and phase. 

 

<sawtooth amplitude="5" frequency="0.25" />

sawtooth: Creates a sawtooth wave. Can specify amplitude, bias, frequency and phase. 

 

<signalGenerator waveform="random" />

signalGenerator: Creates a wave of the specified type. Can specify amplitude, bias, frequency and phase. Waveform should be specified.

 

MULTIPLE WAVES

The waveform blocks can also be used to generate multiple waves in a vector without having to define the sources independently. The number of series in the plot must be specified.  

<timePlot name="myPlot" series="3" />

<simulation name="sineSim" duration="30" period="0.01">
  <solver name="solver">
    <series>
      <sine amplitude="1 2 3" />
      <probe ref="sectionName.myPlot" />
    </series>
  </solver>
</simulation>
 
multiple-source.jpg