System Composer Concepts
System Composer™ combines concepts from systems engineering with concepts from Simulink®. This page will define these concepts and their respective applications to provide you with a better understanding of how these domains overlap in System Composer.
Author Architecture Models
An architecture model in System Composer consists of the common Simulink constructions: components, ports, and connectors. An architecture represents the system of components.
A System Composer architecture represents a system of components and how they interface with each other structurally and behaviorally. You can represent specific architectures using alternate views.
Different types of architectures describe different aspects of systems:
|Compose Architecture Visually|
A System Composer model is the file that contains architectural information, including components, ports, connectors, interfaces, and behaviors.
Perform operations on a model:
A System Composer model is stored as an SLX file.
|Create Architecture Model with Interfaces and Requirement Links|
A component is a nontrivial, nearly independent, and replaceable part of a system that fulfills a clear function in the context of an architecture. A component defines an architectural element, such as a function, a system, hardware, software, or other conceptual entity. A component can also be a subsystem or subfunction.
Represented as a block, a component is a part of an architecture model that can be separated into reusable artifacts.
A port is a node on a component or architecture that represents a point of interaction with its environment. A port permits the flow of information to and from other components or systems.
There are different types of ports:
Connectors are lines that provide connections between ports. Connectors describe how information flows between components or architectures.
A connector allows two components to interact without defining the nature of the interaction. Set an interface on a port to define how the components interact.
Create variant components and implement multiple design alternatives or variants, chosen based on programmatic rules. Add variant choices to any component to make a variant component. The active choice represents the original component.
A variant is one of many structural or behavioral choices in a variant component.
Use variants to quickly swap different architectural designs for a component while performing analysis.
A variant control is a string that controls the active variant choice.
Set the variant control to programmatically control which variant is active.
|Set Variant Control Condition|
Assign interfaces to ports using the Interface Editor in Dictionary View. Use an Adapter block to reconcile differences between interfaces on a connector between ports.
Manage interfaces local to a port using the Interface Editor in Port Interface View.
|interface data dictionary|
An interface data dictionary is a consolidated list of all the interfaces and value types in an architecture and where they are used.
Local interfaces on a System Composer model can be saved in an interface data dictionary using the Interface Editor. Interface dictionaries can be reused between models that need to use a given set of interfaces, elements, and value types. Data dictionaries are stored in separate SLDD files.
A data interface defines the kind of information that flows through a port. The same interface can be assigned to multiple ports. A data interface can be composite, meaning that it can include data elements that describe the properties of an interface signal.
Data interfaces represent the information that is shared through a connector and enters or exits a component through a port. Use the Interface Editor to create and manage data interfaces and data elements and store them in an interface data dictionary for reuse between models.
A data element describes a portion of an interface, such as a communication message, a calculated or measured parameter, or other decomposition of that interface.
Data interfaces are decomposed into data elements:
A value type can be used as a port interface to define the atomic piece of data that flows through that port and has a top-level type, dimension, unit, complexity, minimum, maximum, and description.
You can also assign the type of data elements in data interfaces to value types. Add value types to data dictionaries using the Interface Editor so that you can reuse the value types as interfaces or data elements.
|Create Value Types as Interfaces|
An owned interface is an interface that is local to a specific port and not shared in a data dictionary or the model dictionary.
Create an owned interface to represent a value type or data interface that is local to a port.
|Define Owned Interfaces Local to Ports|
An adapter helps connect two components with incompatible port interfaces by mapping between the two interfaces. An adapter can act as a unit delay or rate transition. You can also use an adapter for bus creation. Use the Adapter block to implement an adapter.
With an adapter, you can perform functions on the Interface Adapter dialog:
Author Physical Models
Author physical models in System Composer using subsystem components. A subsystem component is a Simulink subsystem that is part of the parent System Composer architecture model. You can add Simscape™ behavior to a subsystem component using physical ports, connectors, and interfaces. For more information, see Author Model Behavior.
A physical subsystem is a Simulink subsystem with Simscape connections.
A physical subsystem with Simscape connections uses a physical network approach suited for simulating systems with real physical components and represents a mathematical model.
|Describe Component Behavior Using Simscape|
A physical port represents a Simscape physical modeling connector port called a Connection Port (Simscape).
Use physical ports to connect components in an architecture model or to enable physical systems in a Simulink subsystem.
|Define Physical Ports on Component|
A physical connector can represent a nondirectional conserving connection of a specific physical domain. Connectors can also represent physical signals.
Use physical connectors to connect physical components that represent features of a system to simulate mathematically.
|Architecture Model with Simscape Behavior for a DC Motor|
A physical interface defines the kind of
information that flows through a physical port. The same interface can be assigned to multiple
ports. A physical interface is a composite interface equivalent to a
Use a physical interface to bundle physical elements to describe a physical model using at least one physical domain.
|Specify Physical Interfaces on Ports|
A physical element describes the
decomposition of a physical interface. A physical element is equivalent to a
|Describe Component Behavior Using Simscape|
Extend Architectural Elements
Create a profile in the Profile Editor and add stereotypes to it with properties. Apply the stereotype to a component, and set the property value.
A stereotype is a custom extension of the modeling language. Stereotypes provide a mechanism to extend the architecture language elements by adding domain-specific metadata.
Apply stereotypes to model elements such as root-level architecture, component architecture, connectors, ports, data interfaces, value types, and functions. Functions only apply to software architectures. A model element can have multiple stereotypes. Stereotypes provide model elements with a common set of property fields, such as mass, cost, and power.
|Extend Architectural Design Using Stereotypes|
A property is a field in a stereotype. You can specify property values for each element to which the stereotype is applied.
Use properties to store quantitative characteristics, such as weight or speed, that are associated with a model element. Properties can also be descriptive or represent a status. You can view and edit the properties of each element in the architecture model using the Property Inspector.
A profile is a package of stereotypes to create a self-consistent domain of element types.
Author profiles and apply profiles to a model using the Profile Editor. You can store stereotypes for a project in one profile or in several. When you save profiles, they are stored in XML files.
Manage and Verify Requirements
In the Requirements Perspective, you can create, manage, and allocate requirements. View the requirements on the architecture model. This functionality requires a Requirements Toolbox™ license.
Use Simulink Test™ to create a test harness for a System Composer component to validate simulation results and verify design in the Test Manager (Simulink Test). This functionality requires a Simulink Test license.
Requirements are a collection of statements describing the desired behavior and characteristics of a system. Requirements ensure system design integrity and are achievable, verifiable, unambiguous, and consistent with each other. Each level of design should have appropriate requirements.
To enhance traceability of requirements, link system, functional, customer, performance, or design requirements to components and ports. Link requirements to each other to represent derived or allocated requirements. Manage requirements from the Requirements Manager on an architecture model or through custom views. Assign test cases to requirements using the Test Manager (Simulink Test) for verification and validation.
|Link and Trace Requirements|
A requirement set is a collection of requirements. You can structure the requirements hierarchically and link them to components or ports.
Use the Requirements
Editor (Requirements Toolbox) to edit and refine requirements in a requirement set. Requirement sets are
A link is an object that relates two model-based design elements. A requirement link is a link where the destination is a requirement. You can link requirements to components or ports.
View links using the Requirements Perspective in System Composer. Select a requirement in the Requirements Browser to highlight the component or the port to which the requirement is assigned. Links are stored externally as
A test harness is a model that isolates the component under test with inputs, outputs, and verification blocks configured for testing scenarios. You can create a test harness for a model component or for a full model. A test harness gives you a separate testing environment for a model or a model component.
Create a test harness for a System Composer component to validate simulation results and verify design. The Interface Editor is accessible in System Composer test harness models to enable behavior testing and implementation-independent interface testing.
Create Custom Views
Apply a view filter to generate an element group of components for the view in the Architecture Views Gallery.
A view shows a customizable subset of elements in a model. Views can be filtered based on stereotypes or names of components, ports, and interfaces, along with the name, type, or units of an interface element. Create views by adding elements manually. Views create a simplified way to work with complex architectures by focusing on certain parts of the architectural design.
You can use different types of views to represent the system:
A viewpoint represents a stakeholder perspective that specifies the contents of the view.
|Modeling System Architecture of Keyless Entry System|
An element group is a grouping of components in a view.
Use element groups to programmatically populate a view.
A query is a specification that describes certain constraints or criteria to be satisfied by model elements.
Use queries to search elements with constraint criteria and to filter views.
|Find Elements in Model Using Queries|
A component diagram represents a view with components, ports, and connectors based on how the model is structured.
Component diagrams allow you to programmatically or manually add and remove components from the view.
|Inspect Components in Custom Architecture Views|
You can visualize a hierarchy diagram as a view with components, ports, reference types, component stereotypes, and stereotype properties.
There are two types of hierarchy diagrams:
|Display Component Hierarchy and Architecture Hierarchy Using Views|
Allocate Architecture Models
In the Allocation Editor, allocate components between two architecture models, based on a dependency or a directed relationship.
An allocation establishes a directed relationship from architectural elements — components, ports, and connectors — in one model to architectural elements in another model.
Resource-based allocation allows you to allocate functional architectural elements to logical architectural elements and logical architectural elements to physical architectural elements.
|Allocate Architectures in Tire Pressure Monitoring System|
An allocation scenario contains a set of allocations between a source and a target model.
Allocate between model elements within an allocation in an allocation scenario. The default allocation scenario is called
|Create and Manage Allocations|
An allocation set consists of one or more allocation scenarios that describe various allocations between a source and a target model.
Create an allocation set with allocation scenarios in the Allocation Editor.
|Systems Engineering Approach for SoC Applications|
Analyze Architecture Models
Create an analysis function to analyze power consumption in the
RobotDesign architecture model.
function RobotDesign_1(instance,varargin) if instance.isComponent() && ~isempty(instance.Components)... && instance.hasValue('RobotProfile.ElectricalComponent.Power') sysComponent_power = 0; for child = instance.Components if child.hasValue('RobotProfile.ElectricalComponent.Power') comp_power = child.getValue('RobotProfile.ElectricalComponent.Power'); sysComponent_power = sysComponent_power + comp_power; end end instance.setValue('RobotProfile.ElectricalComponent.Power',sysComponent_power); end
Analyze the robot design using the analysis function to determine total power usage.
Analysis is a method for quantitatively evaluating an architecture for certain characteristics. Static analysis analyzes the structure of the system. Static analysis uses an analysis function and parametric values of properties captured in the system model.
Use analyses to calculate overall reliability, mass roll-up, performance, or thermal characteristics of a system, or to perform a SWaP analysis.
An analysis function is a MATLAB® function that computes values necessary to evaluate the architecture using the properties of each element in the model instance.
Use an analysis function to calculate the result of an analysis.
An instance model is a collection of instances.
You can update an instance model with changes to a model, but
the instance model will not update with changes in active variants or model references. You can
use an instance model, saved in a
|Run Analysis Function|
An instance is an occurrence of an architecture model element at a given point in time.
An instance freezes the active variant or model reference of the component in the instance model.
|Create a Model Instance for Analysis|
Author Sequence Diagrams
Create a sequence diagram in the Architecture Views Gallery to describe system interactions.
A sequence diagram is a behavior diagram that represents the interaction between structural elements of an architecture as a sequence of message exchanges.
Use sequence diagrams to describe how the parts of a static system interact.
A lifeline is represented by a head and a timeline that proceeds down a vertical dotted line.
The head of a lifeline represents a component in an architecture model.
|Add Lifelines and Messages|
A message includes a send event and a receive event. You can draw messages from one lifeline to another on the vertical dotted lines in a sequence diagram. Messages are clarified with a message label.
A message label has a trigger and a constraint. A trigger determines whether the message occurs. A constraint determines whether the message is valid.
|Create Messages in Sequence Diagram|
A fragment indicates how a group of messages within are executed or interact in a sequence diagram.
A fragment is used to model complex sequences, such as alternatives, in a message-based behavior diagram.
|Implement Sequence Diagram Fragments|
An operand is a region in a fragment. Fragments have one or more operands depending on the kind of fragment. Operands can contain messages and additional fragments.
Each operand can include a constraint to specify whether the messages inside the operand execute. You can express the precondition of an operand as a MATLAB Boolean expression using the inputs of any lifeline.
|Add Fragments and Operands|
Author Model Behavior
Use a reference component to decompose and reuse architectural components and Simulink model behaviors. Use a subsystem component or state chart to implement Simulink and Stateflow® behaviors.
A reference component is a component whose definition is a separate architecture model, Simulink behavior model, or Simulink subsystem behavior. A reference component represents a logical hierarchy of other compositions.
You can reuse compositions in the model using reference components. There are three types of reference components:
A parameter definition is the definition of a property that has instance semantics. A parameter definition specifies attributes such as name, data type, default value, and units.
Parameter definitions can be specified as model arguments on a Simulink model or a System Composer architecture model.
|Access Model Arguments as Parameters on Reference Components|
A parameter is an instance-specific value of a parameter definition. A parameter captures instance-specific values and units.
Parameters are available for each component linking to a model reference or architecture reference that specifies model arguments. You can specify independent values for a parameter on each component.
|Use Parameters to Store Instance Values with Components|
A subsystem component is a Simulink subsystem that is part of the parent System Composer architecture model.
Add Simulink subsystem behavior to a component to author a subsystem component in System Composer. You cannot synchronize and reuse subsystem components as Reference Component blocks because the component is part of the parent model.
A state chart diagram demonstrates the state-dependent behavior of a component throughout its state lifecycle and the events that can trigger a transition between states.
Add Stateflow chart behavior to describe a component using state machines. You cannot synchronize and reuse Stateflow chart behaviors as Reference Component blocks because the component is part of the parent model.
Design Software Architectures
Design a software architecture model, define the execution order of the functions from the components, simulate the design in the architecture level, and generate code.
View the software architecture diagram in a class diagram in the Architecture Views Gallery.
A software architecture is a specialization of an architecture for software-based systems, including the description of software compositions, component functions, and their scheduling.
Use software architectures in System Composer to author software architecture models composed of software components, ports, and interfaces. Design your software architecture model, define the execution order of your component functions, simulate your design in the architecture level, and generate code.
A software component is a specialization of a component for software entities, including its functions (entry points) and interfaces.
Implement a Simulink export-function, rate-based, or JMAAB model as a software component, simulate the software architecture model, and generate code.
A software composition is a diagram of software components and connectors that represents a composite software entity, such as a module or application.
Encapsulate functionality by aggregating or nesting multiple software components or compositions.
|Modeling the Software Architecture of a Throttle Position Control System|
A software function is an entry point that can be defined in a software component.
You can apply stereotypes to software functions, edit sample times, and specify the function period using the Functions Editor.
|Author and Extend Functions for Software Architectures|
A class diagram is a graphical representation of a static structural model that displays unique architecture types of the software components optionally with software methods and properties.
Class diagrams capture one instance of each referenced model and show relationships between them. Any component diagram view can be optionally represented as a class diagram for a software architecture model.
|Class Diagram View of Software Architectures|