Using the Convolution Element

The property dialog for a Convolution element looks like this:

Convolution elements have a single output. You can specify these attributes by pressing the Type… button. By default, a new Convolution element is a scalar, dimensionless value. You can also use Convolution elements to operate on and/or create vectors and matrices.

The Display Units field refers to the display units of the output signal (which may have different dimensions than the input signal).

You can save the results for a Convolution element by clicking Final Values and/or Time Histories.

Under Signal Definition, you first specify the Input signal.  You must also specify the dimensions of the input signal (by defining Units).  This facilitates error checking.  The Input signal will be a direct or indirect function of time.

You then define the Transfer Function.  In some cases, it may be easier to define the integral of the transfer function, rather than the transfer function itself, and the two radio buttons on the dialog allow you to choose between these two options.

The transfer function essentially “spreads out” or “disperses” a unit impulse over time.  In many cases, the transfer function may be a continuous function with a long “tail”.  That is, 99% of output produced by an impulse may be generated within 10 days of the impulse, with the remainder being spread out over the remaining 1000 days.  Such a transfer function can have a significant computational impact on your model.  Hence, GoldSim provides a way to “cut off” a transfer function after a certain lag time.  If you check the Truncate the Function at checkbox, you can then enter a time after which the transfer function will be truncated.  In the above example, you might, for example, specify this as 10 days.  This input can be a function of time (e.g., if the transfer function changes with time, you may need to adjust the truncation time accordingly).

The Convolution element works by generating and continuously adding to a projected future history of its output.  At each timestep the incremental input is convolved with the transfer function and added to that output history.  The history stores projected results for every scheduled timestep of the model, and also inserts additional points where necessary to ensure that the difference between successive time points is never greater than 10% of the Truncate the Function at value.

However, if your model generates unscheduled updates and if the duration of the transfer function is short, it is possible that the projected future history will not have enough time points to deliver accurate results.  In this situation you can use the optional input Maximum prediction timestep to ensure sufficient accuracy of this history. The must be specified as a time, and cannot have any links.  It should be short enough so that it can reasonably approximate the shape of the transfer function.

Note that in the definition of a convolution integral, the transfer function is mathematically defined not as a function of time, but as a function of a time difference, (t – τ), or lag time.  In order to write such an equation in GoldSim, you reference the time difference t – τ using a special locally available property of the Convolution element called “Lag”.  It must be referenced as “~Lag”.

   Note: As indicated by the way it is referenced, the Lag is an example of a locally available property.  As such, it only has meaning inside the Transfer Function field, and cannot be referenced anywhere else. 

For example, if your transfer function was the following equation:

then you would reference the lag time (t – τ) as “~Lag”:

The transfer function does not have to be time-invariant.  That is, the function can be defined to change as a function of time.  Referring to the example above, if the response was different at later times in the simulation (e.g., after 1 yr), the transfer function could be written as follows:

GoldSim checks to ensure that the dimensions of the various inputs and outputs are related as follows:

Output = Transfer Function * Input Signal * time

If the integral of the transfer function is specified, GoldSim checks to ensure that the dimensions of the various inputs and outputs are related as follows:

Output = Integral of Transfer Function * Input Signal

For example, if the element display units were specified as $ and the input signal display units were specified as g/yr, then GoldSim would require that the transfer function had dimensions of currency/mass (e.g., $/g).

Several points should be noted regarding the numerical implementation of the Convolution element within GoldSim:

   During the numerical integration, GoldSim does not actually start the integration from 0.  Instead, it starts the integration from a very small number.  This allows the transfer function to be a function of the inverse of the lag without causing numerical problems (i.e., divide by zero errors)

   The numerical integration approach used by GoldSim assumes that the input function varies linearly between time steps; and

   To have acceptable accuracy, the simulation timestep should be short relative to the rate of change of the transfer function.  Note, however, that your model may run much slower if the timestep is too small, as the computational effort for solving a Convolution element goes up as the square of the number of timesteps.

Related Topics…

Learn more about: