Contents

getSimulationTime

Final time of simulation for frequency response estimation

Syntax

tfinal = getSimulationTime(input)

Description

tfinal = getSimulationTime(input) returns the final time of the Simulink® simulation performed during frequency response estimation using the input signal input. Altering input to reduce the final simulation time can help reduce the time it takes to perform frequency response estimation.

Input Arguments

input

Input signal for frequency response estimation with the frestimate command.

The input signal input must be either:

  • A sinestream input signal, created in the Linear Analysis Tool or created with frest.Sinestream

  • A chirp input signal, created in the Linear Analysis Tool or created with frest.Chirp

  • A random input signal, created in the Linear Analysis Tool or created with frest.Random

Output Arguments

tfinal

Final time of simulation performed during frequency response estimation using the input signal input.

For example, the command sysest = frestimate(mdl,io,input) performs frequency response estimation on the Simulink model specified by mdl with the linearization I/O set io. The estimation uses the input signal input. The command tfinal = getSimulationTime(input) returns the simulation time at the end of the simulation performed by frestimate.

Examples

expand all

Simulation Time for Frequency Response Estimation

Create a sinestream input signal and calculate the final simulation time of an estimation using that signal.

input = frest.Sinestream('Amplitude',1e-3,...
                         'Frequency',logspace(1,3,50),...
                         'SamplesPerPeriod',40,'FreqUnits','Hz');
tfinal = getSimulationTime(input)
tfinal =

    4.4186

The sinestream signal input includes 50 frequencies spaced logarithmically between 10 Hz and 1000 Hz. Each frequency is sampled 40 times per period.

The resulting tfinal indicates that frequency response estimation of any model with this input signal would simulate the model for 4.4186 s.

Was this topic helpful?