Platform: All Platforms Versions: All versions

Problem Description

You may want to define loads, material properties, or boundary conditions that vary abruptly with respect to the solution, or with respect to time. This can, however, lead to a solution which is discontinuous in space and/or time, which can be difficult to solve.


The resolution here is to use smoothed step functions. There are several built-in functions that include a smoothing option. This smoothing can be either first-order or second-order continuous. Second-order is the default and is appropriate in most cases. The functions that include smoothing are: Ramp, Rectangle, Step, Triangle, Waveform (of type Sawtooth, Square, or Rectangle) and Piecewise. The interfaces for the Step and Piecewise functions, as well as a visualization of the resultant smoothed functions, are shown in the screenshots below.

The Step Function interface and the resultant Smoothed Step function.

Piecewise Function Interface

The Piecewise Function Interface.

Piecewise Function Plot

The Resultant Smoothed Piecewise Function.

Smoothed step functions, as well as other functions, can be defined at the Global level, within the Definitions branch of a Component within the model, or within the Materials property definitions depending upon the desired scope of the function.

See also:

Knowledge Base 103: Improving convergence for nonlinear stationary models

Knowledge Base 1245: Solving Models with Pulsed Loads in Time