cacheFunc

cacheFunc

Works with VSimBase, VSimEM, VSimPD, VSimPA, and VSimVE licenses.

Defines a function that remembers its last arguments and value, and avoids recalculation if possible.

cacheFunc Parameters

STFunc (block, required)

The function to be cached.

timeIsIrrelevant (bool)

Whether the change is time is relevant to the function.

irrelevantDirs (integer vector)

Any direction where the change is irrelevant to the function.

Example cacheFunc Block

<STFunc memDrive>
  kind = cacheFunc
  irrelevantDirs = [1 2]
  <STFunc drive>
    kind = expression
    expression =  amp*H(T_DRIVE-t)*cos(K*x)*sin(OMEGA*t)
  </STFunc>
</STFunc>