Model Your First System
This tutorial provides a beginner-friendly guide to creating your first system with SysML v2 and SysON, adapted from the training SysML v2 Introductory Training Flashlight Starter Model by Sanford Friedenthal. The focus is on representing a flashlight.
1. Step 1: Create a Project
-
Open the Projects Browser and create a new SysML v2 project by clicking on the SysML v2 card.
-
The Project Editor automatically opens, creating a new project named
SysML v2
with a packagePackage1
. A defaultGeneral view
representation associated with the package is opened in the main editor area. -
From the project toolbar, rename the project to
Flashlight
. -
From the Project Explorer, rename the model to
Flashlight.sysml
and the package toFlashlight_StarterModel
.
2. Step 2: Model Organization (Package Structure)
-
In the main editor area, right-click on the diagram background to open the palette.
-
Click on
Structure
→New Package
to create a new package. -
Rename the package to
FlashlightSpecificationAndDesign
. -
Right-click on the
FlashlightSpecificationAndDesign
package, selectStructure
→New Package
to create a new package inside it. -
Rename it to
Requirements
. -
Right-click again on the
FlashlightSpecificationAndDesign
, and use the quick access toolNew Package
. -
Rename it to
ActionTree
. -
Repeat the earlier step to create and rename the following packages inside
FlashlightSpecificationAndDesign
:-
PartsTree
-
RequirementsAllocation
-
-
Click on the
Arrange all elements
menu in the global toolbar at the top of the diagram.

3. Step 3: Flashlight Requirements Tree
-
In the explorer, select the
Requirements
package, click the "more" menu, and chooseNew representation
-
Set the name of the representation to
Requirements General View
. -
Create a new
General View
and open it. -
In the main editor area, right-click on the diagram background to open the palette.
-
Click on
Requirements
→New Requirement
to create a new requirement. -
Rename it to
flashlightSpecification
. -
Right-click on the
flashlightSpecification
requirement, then selectRequirements
→New Requirement
to create a nested requirement. -
Rename the new requirement to
userInterface
. -
In the explorer, select
flashlightSpecification
, click the "more" menu, and chooseNew objects from text
. -
In the modal input box, paste the following content:
requirement illumination{ requirement fieldOfView{ doc /* The flashlight field of view shall be 0 - 20 degrees.*/ } requirement lightPower{ doc /* The light power shall be a minimum of TBD lumens.*/ } } requirement physical{ requirement portability; requirement size{ doc /* The flashlight shall be less than 6 inches in length.*/ } requirement weight; } requirement reliability; requirement cost;
-
Select the newly created elements (
illumination
,physical
,reliability
,cost
,portability
,size
,weight
,fieldOfView
,lightPower
) in the explorer (Ctrl + Click), and drag-and-drop them into the diagram. -
Use the
Arrange all elements
tool from the diagram toolbar to auto layout the diagram. -
Right-click on the
size
requirement and selectShow/Hide → Show valued content
to display the documentation in the diagram. -
Repeat the operation for the children of
illumination
:fieldOfView
andlightPower
. -
Right-click on the
weight
requirement and select theNew Documentation
tool. -
In the newly created
doc
element, enter the text:The weight shall be less than 0.25 kg.
-
Right-click on the
weight
requirement again and chooseStructure → New Attribute
. -
Edit the new attribute to
actualweight :> mass
. -
Right-click on the background of diagram and use the tool
New Namespace Import
. Then selectSI/Library Package SI
to import it from the standard libraries. -
Use the palette filter to locate the
New Required Constraint
tool, and apply it to theweight
requirement. -
Edit the constraint to:
actualweight<=0.25[kg]

4. Step 4: Produce Directed Light Action Flow
-
In the explorer, select the
ActionTree
package, click the "more" menu, and chooseNew representation
. -
Set the name of the representation to
Action Tree General View
. -
Create a new
General View
and open it. -
In the main editor area, right-click on the diagram background to open the palette.
-
Click on
Behavior
→New Action
to create a new action. -
Rename it
produceDirectedLight
. -
Right-click on the
produceDirectedLight
action, then selectBehavior
→New Start Action
. -
Right-click again on
produceDirectedLight
, then selectBehavior
→New Fork
. -
Rename the fork to
fork1
. -
Select the start node and use the connection tool to create a succession between the start action and the fork node.
-
Right-click on the
produceDirectedLight
and selectBehavior
→New Action
to create a nested action. -
Rename the nested action to
provideDCPwr
. -
Select
fork1
and use the connection tool to create a succession to theprovideDCPwr
action. -
Right-click on
provideDCPwr
, then selectStructure
→New Item Out
. -
Rename the item to
outdcPwr
. -
In the explorer, select the
produceDirectedLight
action, click the "more" menu, and chooseNew objects from text
. -
In the model input box, paste the following content:
in item onOffCmd; out item lightOut; action connectDCPwr { in item onOffCmd; in item dcPwrIn; out item dcPwrOut; } action generateLight{ in item dcPwrIn; out item light; } action directLight{ in item lightIn; out item lightOut; }
-
In the
action flow
compartment ofproduceDirectLight
use the toolRelated Elements → Add existing element
. -
Create a new transition between
fork1
andconnectDCPwr
. -
Set the value of
connectDCPwr::onOffCmd
by renaming the itemin onOffCmd
ofconnectDCPwr
toin onOffCmd = produceDirectedLight.onOffCmd
-
Create a
Flow Connection (flow)
fromdcPwrOut
ofconnectDCPwr
todcPwrIn
ofgenerateLight
. -
Create a
Flow Connection (flow)
betweenlight
ofgenerateLight
tolightIn
ofdirectLight
. -
Create a
Flow Connection (flow)
betweenoutdcPwr
ofprovideDCPwr
todcPwrIn
ofconnectDCPwr
. -
Using the eye icon on the
produceDirectLight
action display theitems
compartement -
Set the value of
produceDirectedLight::lightOut
by renaming the itemout lightOut
ofproduceDirectedLight
toout lightOut = directLight.lightOut
.

5. Step 5: Flashlight Interconnection
-
In the explorer, select the
PartsTree
package, click the "more" menu, and chooseNew representation
. -
Set the name of the representation to
Parts Tree General View
. -
Create a new
General View
and open it. -
In the main editor area, right-click on the diagram background to open the palette.
-
Click on
Structure
→New Part
to create a new part usage. -
Rename it to
flashlight
. -
Right-click on
flashlight
, then selectStructure
→New Attribute
. -
Edit it to
mass :> ISQ::mass
-
Right-click again on
flashlight
, and use the quick access toolNew Attribute
to addfov:Real
. -
Right-click again on
flashlight
, and use the quick access toolNew Attribute
to addilluminationLevel:Real
. -
Right-click on
flashlight
, then select theBehavior
→New Perform
and select the actionproduceDirectedLight
created earlier. -
In the explorer, select the
flashlight
part, click the "more" menu, and chooseNew representation
. -
Set the name of the representation to
Flashlight Interconnection View
. -
Create a new
Interconnection View
and open it. -
Right-click on
flashlight
, then select theStructure
→New Port
. -
Rename it
cmdPort
. -
Right-click on
flashlight
, then select theStructure
→New Part
to create a nested part. -
Rename it
switch
. -
Right-click on
switch
, then select theStructure
→New Port
. -
Rename it
cmdPort
. -
Create a new binding between the
cmdPort
offlashlight
and thecmdPort
of theswitch
. -
Right-click on
switch
, then select theStructure
→New Port In
. -
Rename it
inPort
. -
Right-click on
switch
, then select theStructure
→New Port Out
. -
Rename it
outPort
. -
Right-click on
flashlight
, then select theStructure
→New Part
to create a nested part. -
Rename it
battery
. -
In the
Details
view, select theAdvanced
tab and uncheck theIs Composite
property, to declare that this is a reference. -
Edit it to
battery[2]
to declare that the part has a multiplicity equal to 2. -
Right-click on
battery
, then select theStructure
→New Port Out
. -
Rename it
dcPwrOutPort
. -
Select
dcPwrOutPort
, create a flow betweendcPwrOutPort
andinPort
. -
In the explorer, select the
flashlight
part, click the "more" menu, and chooseNew objects from text
. -
In the model input box, paste the following content:
port lightOutPort; port handPort; part lamp{ attribute efficiency:Real; in port dcPwrInPort; out port lightOutPort; } part optics{ in port lightInPort; out port lightOutPort; part reflector{ attribute radius :> ISQ::length; } part lens; } part structure{ port handPort; part frontHousing; part middleHousing; part backHousing; }
-
Drag and drop the newly created parts
lamp
,optics
,structure
into theflashlight
part. -
Create a new binding between the
lightOutPort
offlashlight
and thelightOutPort
of theoptics
. -
Create a new binding between the
handPort
offlashlight
and thehandPort
of thestructure
. -
Select
outPort
, create a flow betweenoutPort
anddcPwrInPort
. -
Select
lightOutPort
, create a flow betweenlightOutPort
andlightInPort
.

6. Step 6: Flashlight States
-
In the explorer, select the
flashlight
part, click the "more" menu, and chooseNew representation
. -
Set the name of the representation to
Flashlight General View
. -
Create a new
General View
and open it. -
In the main editor area, right-click on the diagram background to open the palette.
-
Click on
Behavior
→New Exhibit State
to create an exhibit state usage. -
Rename it to
flashlightStates
. -
Right-click on
flashlightStates
, then select theBehavior
→New State
to create a three nested states. -
Rename them to
initial
,off
, andon
. -
Create transition named
init
between theinitial
state and theoff
state. -
Create the following transitions between the
on
state and theoff
state.-
transition
off_To_on
fromoff
toon
-
transition
on_To_off
fromon
tooff
-
-
Right-click on the
on
state, select theBehavior
→Do Action with referenced action
, and select theproduceDirectedLight
action defined earlier .

7. Step 7: Flashlight Requirements Allocation
-
In the explorer, select the
RequirementsAllocation
package, click the "more" menu, and chooseNew representation
. -
Create a new
General View
and open it. -
Drag and drop the following elements from the explorer to the diagram :
-
Requirements:
-
flashlightSpecification
, -
illumination
, -
fieldofView
, -
lightPower
, -
physical
, -
weight
;
-
-
Part:
-
flashlight
;
-
-
Attributes of
flashlight
:-
mass
, -
illuminationLevel
, -
fov
;
-
-
Action:
-
produceDirectedLight
.
-
-
-
Create the following allocations:
-
illumination
→produceDirectedLight
, -
weight
→mass
, -
fieldOfView
→fov
, -
lightPower
→illuminationLevel
.
-
