Faults
Parent Section: annotations
Syntax
Faults = Fault(Name = 'FaultName', ... Switch = logical_p1, ... Values = [p1, p2], ... ExternalTrigger = in1, ... TriggerType = fault_trigger_type, ... BehavioralTriggerValues = [p3, p4], ... Status = logical_p2, Transient = true);
Description
In a custom component, you model fault behavior and triggering logic by using
parameters, variables, equations, conditional expressions, and other Simscape™ language constructs. The Faults
annotation provides the necessary information to the Simscape faults interface, which lets you model fault behaviors and trigger faults
during simulation.
annotations Faults = Fault(Name = 'FaultName', ... Switch = logical_p, ... Values = [p1, p2], ... ExternalTrigger = in1, ... TriggerType = fault_trigger_type, ... BehavioralTriggerValues = [p3, p4], ... Status = logical, Transient = true); end
Faults annotation elements are:
Name
is the fault name. This element is required.Switch
is the logical parameter that enables the fault model. This element is required.Values
are the parameters that allow you to configure the fault behavior, for example, faulted resistance or failed voltage. These parameters appear in the faults interface, for example, in the Faults section of the block dialog box under the fault name, or under the corresponding fault behavior in the fault Property Inspector. This element is required.ExternalTrigger
is the input connected to a triggering source. Depending on the fault settings, this trigger can be always on, timed, conditional, and so on. The trigger can have a value of 0 (not faulted) or 1 (faulted). This element is required.TriggerType
is a parameter with a default value of enumeration classsimscape.fault.triggertype
. Supported values are:simscape.fault.triggertype.behavioral
andsimscape.fault.triggertype.external
. This element is required only if you want to model behavioral faults because you need it to expose the Behavioral trigger option.BehavioralTriggerValues
are the parameters that allow you to configure the behavioral triggers, such as the maximum permissible current. These parameters appear in the faults interface when you set Trigger type toBehavioral
.Status
is a variable, intermediate, or output that must be set to zero during nominal component behavior and to nonzero when a fault occurs. This element is required only if theTriggerType
element is defined.Transient
is a logical attribute associated with the fault model. Iftrue
, the fault model supports switching from the faulted state back to nominal state. Iffalse
, the fault model only allows switching from nominal to faulted state once during simulation. The default isfalse
.
You can list the annotation elements in any order.
A component can have only one Faults
annotation
section. You can define multiple faults as an array:
annotations Faults = [Fault(Name = 'Armature winding', Switch = ...) Fault(Name = 'Series field winding', Switch = ...) Fault(Name = 'Shunt field winding', Switch = ...)] end
In a composite component, faults defined in its member components are exposed when the
member component has these attributes: Access=public
,
ExternalAccess=observe
. When you declare composite component
members, this combination of attributes is the default, therefore, by default the member
component faults are exposed. If you do not want the parent composite component to
display the faults of a member component, set the member component
Access
attribute to protected
. For
example:
component RC components (Access = protected) r1 = foundation.electrical.elements.resistor(R=p1); c1 = foundation.electrical.elements.capacitor(c=p2); end ... end
Examples
Version History
Introduced in R2024b