Modeling Behavior in a Simple State Machine

Overview

Before you can run a simulation using Moxie, you need to create a state machine to describe the behavior of your system. If you are not familiar with the concept of a state machine, you may want to read the introductory paragraphs of the state machines section in the SysML Modeling Reference. In this section, you will create a simple SysML state machine to model the behavior of powering on the UAV.

This section covers the following concept:

Figure A1: A simple state machine

Prerequisites

Prerequisite Description
Moxie Installation You must have installed Moxie.
Tutorial Project You must start this section with the Moxie simulation project from the previous section. If you did not complete the previous section, you can use the following project from the Moxie installation: \documentation\tutorialFiles\01\InstanceSpecificationDiagrams.mdzip
Recommended Reading Before completing this section, you may want to read the following help topics:

Instructions

A state machine diagram is a graphical interface for viewing and updating its corresponding state machine. Creating a state machine diagram also conveniently creates the corresponding state machine for you.

  1. Open the project from the previous section.
  2. In the Containment Tree, right-click the Structure > PowerSystem block and select Create Diagram (or press CtrlShiftD).
  3. Select SysML State Machine Diagram, enter PowerSystem State Machine as its name, and press Enter. You may need to click the Expert button in the lower left of the dialog in order to find SysML State Machine Diagram.
  4. In the state machine diagram, you should see an initial pseudostate with a transition to a blank state. The UAV should start in a powered-off state, so double-click the state on the diagram to bring up its specification window, enter PoweredOff as its name, and click Close.
  5. Select the PoweredOff state in the diagram and click the Transition button () on the context toolbar next to the state. Then click anywhere on the canvas to add a new state.
  6. Double-click the new state on the diagram to bring up its specification window. Enter PoweredOn as its name and click Close.

    Figure B1: The power system state machine

  7. Save your work before continuing.

This state machine only describes a power system being in a powered-off state and then being in a powered-on state. It does not describe the transition between the two states — neither the time at which the transition occurs, nor the effect the transition has on the underlying properties of the system.

To learn more about state machine concepts, see the state machines help topic.

Next Section >