Main Content

evalRequirement

Class: sdo.requirements.PhasePlaneEllipse
Package: sdo.requirements

Evaluate satisfaction of elliptical bound on phase plane trajectory of two signals

Syntax

evaluation = evalRequirement(requirement,signal1,signal2)
evaluation = evalRequirement(requirement,signals)

Description

evaluation = evalRequirement(requirement,signal1,signal2) evaluates whether the phase plane trajectory of the two signals specified in signal1 and signal2 satisfies the elliptical bound specified in the requirement object. The phase plane trajectory is a plot of the two signals against each other. A positive evaluation value indicates that the requirement has been violated.

evaluation = evalRequirement(requirement,signals) specifies the two signals as an n-by-2 array. The first column corresponds to the first signal, and the second column corresponds to the second signal. n is the number of time points in the signals.

Input Arguments

expand all

Phase plane ellipse requirement, specified as an sdo.requirements.PhasePlaneEllipse object. In the object, you specify the characteristics of the bounding ellipse such as the radii, center, and rotation of the ellipse. You also specify whether the ellipse is an upper or lower bound.

Signals to be evaluated, specified as two comma-separated timeseries objects.

signal1 corresponds to the x-value of the phase plane trajectory, and signal2 corresponds to the y-value of the phase plane trajectory. For an example, see Evaluate Elliptical Bound on Phase Plane Trajectory.

Signals to be evaluated, specified as an n-by-2 array. The first column corresponds to the first signal, the x-value of the phase plane trajectory. The second column corresponds to the second signal, the y-value of the phase plane trajectory. n is the number of time points in the signals. For an example, see Evaluate Circular Bound on Phase Plane Trajectory.

Output Arguments

expand all

Evaluation of the phase plane ellipse requirement, returned as a scalar or column vector depending on the Method property of requirement. The evalRequirement command computes the signed minimum distance of each point in the phase plane trajectory to the bounding ellipse.

  • If requirement.Method is 'Maximum', evaluation is a scalar that is the maximum of the signed distances. A positive value indicates that the requirement has been violated and at least one of the trajectory points lies outside the bounding region.

  • If requirement.Method is 'Residuals', evaluation is a column vector that contains the signed distances of each point in the phase plane trajectory to the bounding ellipse. A positive value in the vector indicates that the requirement has been violated for that time point. A negative value or zero indicates that the requirement has been satisfied for that time point.

Examples

expand all

Create a default requirement object.

Requirement = sdo.requirements.PhasePlaneEllipse;

The requirement object specifies the bounding ellipse as an upper bound with center located at [0,0], and no rotation. The x-axis radius of the ellipse is 1 and a y-axis radius is 0.5.

Specify the test signal data as timeseries objects.

signal1 = timeseries(1-exp(-(0:10)'));
signal2 = timeseries(sin((0:10)'));

Evaluate the requirement.

Evaluation = evalRequirement(Requirement,signal1,signal2)
Evaluation = 0.6997

The default method for requirement evaluation, Requirement.Method is 'Maximum'. Thus, the evalRequirement command computes the signed minimum distance of each point in the phase plane trajectory to the bounding ellipse and then returns the maximum of these distances. A positive value indicates that the at least one point on the phase trajectory lies outside the ellipse and violates the requirement.

To see the signed distance of each of the points on the trajectory to the phase plane ellipse, specify the method for evaluation as 'Residuals'.

Requirement.Method = 'Residuals';

Evaluate the requirement using the new evaluation method.

Evaluation2 = evalRequirement(Requirement,signal1,signal2)
Evaluation2 = 11×1

   -0.5000
    0.4291
    0.5711
   -0.0078
    0.4850
    0.6695
    0.1133
    0.4079
    0.6997
    0.2102
      ⋮

Evaluation2 is the minimum distance of the phase plane trajectory to the bounding ellipse and is a column vector with length equal to the length of the signals.

A negative value indicates that the phase plane trajectory of the two signals at the corresponding time point lies inside the ellipse and satisfies the requirement. A positive value indicates that the phase plane trajectory of the two signals at the corresponding time point lies outside the ellipse and violates the requirement.

You can see that the maximum value in Evaluation2 is the same as Evaluation.

Create a default requirement object.

Requirement = sdo.requirements.PhasePlaneEllipse;

Specify a circular bound of radius 2. The bounding circle is an upper bound.

Requirement.Radius = [2 2];

Specify the test signal data.

Signals = [1 2 3 4 5 6; 10 20 30 40 50 60]';

The test data is specified as an n-by-2 array. The first column corresponds to the first signal, the x-value of the phase plane trajectory. The second column corresponds to the second signal, the y-value of the phase plane trajectory.

Evaluate the requirement.

Evaluation = evalRequirement(Requirement,Signals)
Evaluation =

   58.2993

A positive Evaluation value indicates that the requirement is violated.

Version History

Introduced in R2016b