Add a Step Function

Add a Step Function

COMSOL Tips Featured Image

How to define Step Function in COMSOL Multiphysics

Step function is a useful function in order to use in many mathematical and numerical calculations and modeling. In COMSOL Multiphysics, there is a beneficial tool to define a step function. In this tip we will use Heat Transfer from Infinite Plate-Time Dependence CMS to illustrate the tip via definition of a step function and use it in a boundary condition.


Add a step function for use in the boundary conditions.

Step 1 (step1)

  1. In the Home toolbar, click Functions and choose Local>Step.
  2. In the Settings window for Step, locate the Parameters section.
  3. In the Location text field, type 5e-5.
  4. In the From text field, type 1.
  5. In the To text field, type 0.
  6. Click to expand the Smoothing section. In the Size of transition zone text field, type 1e-4.

Optionally, you can inspect the shape of the step function.

  • Click Plot.


Solid 1

In the Model Builder window, under Component 1 (comp1)>Heat Transfer in Solids (ht) click Solid 1.

Temperature 1

  1. In the Physics toolbar, click Boundaries and choose Temperature.
  2. Click in the Graphics window and then press Ctrl+A to select both boundaries.
  3. In the Settings window for Temperature, locate the Temperature section.
  4. In the T0 text field, type step1(t).

CMS Website
Computational Modeling and Simulation is the simulation center of Acamech that models Mechanical Engineering Problems, especially Multiphysics Simulation; including Fluid Flow (CFD), Structural Mechanics, Acoustics, Heat Transfer as a unique Multiphysics problem. We use COMSOL Multiphysics, MATLAB, and Autodesk Inventor.

Leave a Reply

Your email address will not be published. Required fields are marked *