Source Statement Functions

PULSE Function

PULSE initialValue pulsedValue <delayTime <riseTime <fallTime <pulseWidth <period>>>>>

Note

At t=delayTime, the pulse will start at initialValue and change to pulsedValue within riseTime. Consequently, a pulse without delay, rise and fall time PULSE 0 1 0 0 0 will output 0 in the very first simulation step and 1 in the next. This differs from the PLECS pulse which starts in high-state.

Table 24 PULSE Parameters

Parameter

Default

Description

initialValue

required

Initial value before pulse

pulsedValue

required

Value during pulse

delayTime

0

Absolute time after which the pulse starts (not phase delay)

riseTime

0

Time for rising edge transition

fallTime

0

Time for falling edge transition

pulseWidth

\(\infty\)

Duration of the pulse at pulsedValue

period

\(\infty\)

Period of the pulse waveform

SIN/SINE Function

SIN<E> offset amplitude <frequency <delay <damping>>>
Table 25 SIN Parameters

Parameter

Default

Description

offset

required

DC offset

amplitude

required

Amplitude of sine wave

frequency

0

Frequency in Hz

delay

0

Absolute time after which the sine starts (not phase delay)

damping

0

Damping factor

Note

Our default frequency of 0 differs from most other SPICE versions where \(1/T_\text{stop}\) is used.

SFFM Function

SFFM offset amplitude <frequency <modulationIndex <signalFrequency>>>
Table 26 SFFM Parameters

Parameter

Default

Description

offset

required

DC offset

amplitude

required

Carrier amplitude

frequency

0

Carrier frequency in Hz

modulationIndex

0

Modulation index

signalFrequency

0

Signal frequency in Hz

Note

Our default frequency of 0 differs from most other SPICE versions where \(1/T_\text{stop}\) is used.

EXP Function

EXP initialValue pulsedValue <riseDelayTime <riseTimeConstant <fallDelayTime <fallTimeConstant>>>>
Table 27 EXP Parameters

Parameter

Default

Description

initialValue

required

Initial value

pulsedValue

required

Pulsed value

riseDelayTime

0

Delay before rising exponential starts

riseTimeConstant

0

Time constant for rising exponential

fallDelayTime

0

Delay before falling exponential starts

fallTimeConstant

0

Time constant for falling exponential

Note

Our defaults for riseTimeConstant, fallDelayTime, and fallTimeConstant differ from most SPICE versions where \(1/T_\text{step}\) is used.

PWL Function

PWL t1 v1 t2 v2 <t3 v3 <...>>

Piecewise linear interpolation with value v1 at time t1, v2 at time t2, etc.

Table 28 PWL Requirements

Requirement

Description

Time ordering

Times must be strictly increasing: \(t_1 < t_2 < t_3 < \ldots\)

Minimum points

At least one time-value pair required