Interactively estimate the Lyapunov exponent of a uniformly sampled signal in the Live Editor
The Estimate Lyapunov Exponent task lets you interactively estimate the Lyapunov exponent of a uniformly sampled signal. The task automatically generates MATLAB® code for your live script. For more information about Live Editor tasks generally, see Add Interactive Tasks to a Live Script.
Use the Lyapunov exponent to characterize the rate of separation of infinitesimally close trajectories in phase space to distinguish different attractors. The Lyapunov exponent is useful in quantifying the level of chaos in a system, which in turn can be used to detect potential faults. A negative Lyapunov exponent indicates convergence, while a positive Lyapunov exponents indicates divergence and chaos.
To add the Estimate Lyapunov Exponent task to a live script in the MATLAB Editor:
On the Live Editor tab, select Task > Estimate Lyapunov Exponent.
In a code block in your script, type a relevant keyword, such as
Lyapunov or Lyapunov exponent. Select
Estimate Lyapunov Exponent from the suggested command
completions.
Signal — Uniformly sampled time-domain signalSelect a uniformly sampled time-domain signal in array or timetable format. If the signal has multiple columns, the Estimate Lyapunov Exponent task computes the Lyapunov exponent by treating it as a multivariate signal. If the signal is a row vector, then the Estimate Lyapunov Exponent task treats it as a univariate signal.
Signal Type — Type of selected signalTime Domain' | 'Phase space'Specify the type of the selected signal as either 'Time Domain'
or 'Phase space'. If you specify the signal type as:
'Time Domain', then also specify the embedding dimension
and time lag for your signal.
'Phase space', then the Estimate
Correlation Dimension task automatically computes the embedding
dimension and time lag using the phase space information.
Sampling Rate — Sampling frequency of the data set2π (default) | scalarSpecify the sampling frequency of the data set as a scalar. The
Estimate Lyapunov Exponent task uses a value of
2π or 6.283 Hz by default. When the signal data
is in a timetable, the Estimate Lyapunov Exponent task
infers the sampling rate from the data set.
Embedding Dimension — Number of dimensions of phase space vectorsSpecify the number of dimensions of phase space vectors as a scalar or vector from the MATLAB workspace. When you specify the embedding dimension as a scalar, then the Estimate Lyapunov Exponent task uses the same embedding dimension value to estimate the value of Lyapunov exponent for all the columns of the uniformly sampled signal.
The Embedding Dimension drop down is active only when you
specify the signal type as 'Time Domain'. For phase space signals,
the Estimate Lyapunov Exponent task automatically
computes the embedding dimension from the phase space data.
If you do not know the value of embedding dimension for your signal, then you can compute it using the Reconstruct Phase Space task.
Time Lag — Time lag between successive phase vectorsSpecify time lag between successive phase vectors as a scalar or vector from the MATLAB workspace. When you specify the time lag as a scalar, then the Estimate Lyapunov Exponent task uses the same time delay value to estimate the value of Lyapunov exponent for all the columns of the uniformly sampled signal. If you specify the embedding dimension as a vector, then specify the time lag also as a vector of the same length.
The Time Lag drop down is active only when you specify
the signal type as 'Time Domain'. For phase space signals, the
Estimate Lyapunov Exponent task automatically
computes the time lag from the phase space data.
If you do not know the value of time lag for your signal, then you can compute it using the Reconstruct Phase Space task.
Expansion Range Min — Minimum expansion step value1 (default) | positive scalar integerSpecify the minimum expansion step value used to compute the expansion rate to estimate the Lyapunov exponent. Try different values such that the linear fit line aligns with the original data line in the plot.
Expansion Range Max — Maximum expansion step value5 (default) | positive scalar integerSpecify the maximum expansion step value used to compute the expansion rate to estimate the Lyapunov exponent. Try different values such that the linear fit line aligns with the original data line in the plot.
Mean Period — Threshold value for nearest neighbor computationceil(fs/max(meanfreq(signal,sampling
rate))) (default) | positive scalar integerSpecify the threshold value to compute the nearest neighbor i*
for a point i to estimate the largest Lyapunov exponent. For more
information, see lyapunovExponent.
Output Display — Toggle result display in the Live Editor outputToggle to display the value of Lyapunov exponent in the Live Editor output.
approximateEntropy | correlationDimension | lyapunovExponent | phaseSpaceReconstruction | Reconstruct Phase
Space