Main Content

time

Access global simulation time

Parent Section: equations

Syntax

time

Description

You can access global simulation time from the equations section of a Simscape™ file using the time function.

time returns the simulation time in seconds.

Examples

expand all

This component outputs y = sin (ω·t):

component MyComp
  parameters
    w = { 1, '1/s' } % omega
  end
  outputs
    y = 0;
  end
  equations
    y == sin( w * time );
  end
end

Version History

Introduced in R2008b