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:
- Nameis the fault name. This element is required.
- Switchis the logical parameter that enables the fault model. This element is required.
- Valuesare 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.
- ExternalTriggeris 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.
- TriggerTypeis a parameter with a default value of enumeration class- simscape.fault.triggertype. Supported values are:- simscape.fault.triggertype.behavioraland- simscape.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.
- BehavioralTriggerValuesare 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 to- Behavioral.
- Statusis 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 the- TriggerTypeelement is defined.
- Transientis a logical attribute associated with the fault model. If- true, the fault model supports switching from the faulted state back to nominal state. If- false, the fault model only allows switching from nominal to faulted state once during simulation. The default is- false.
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 = ...)]
endIn 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
...
endExamples
Version History
Introduced in R2024b