Cameo Blog

Refining SysML Activity Diagrams: A NASCAR Modeling Example

Refining SysML Activity Diagrams: A NASCAR Modeling Example

One of the key strengths of SysML activity diagrams is their ability to evolve over time. Engineers rarely create the perfect behavioral model on the first attempt. Instead, activity diagrams are typically refined iteratively, starting with a simple representation and gradually adding detail as the system understanding improves.

This process is called activity diagram refinement.

In this article, we explore how activity diagrams can be refined step-by-step using a simple and intuitive example: modeling a NASCAR race.

Watch the full tutorial here:

https://www.youtube.com/watch?v=UFl6pduULvw


Why Activity Diagram Refinement Matters in SysML

When modeling system behavior, engineers must balance two competing goals:

  • simplicity – keeping the model understandable

  • fidelity – accurately representing system behavior

If a model is too simple, it may miss important behaviors.
If it is too detailed too early, it can become difficult to understand or maintain.

Refining activity diagrams over time allows teams to:

  • gradually increase behavioral fidelity

  • validate logic incrementally

  • improve model clarity

  • support simulation and analysis

This incremental modeling approach is common in Model-Based Systems Engineering (MBSE).


Level 1: A Very Simple Activity Diagram

The first step in activity diagram refinement is to create a very high-level behavioral representation.

In the NASCAR example, the simplified question is:

What are NASCAR drivers doing during the race?

The most basic answer is:

They keep making left turns.

At this first level, the activity diagram contains a single action:

Make Left Turn

Even though this representation is extremely simple, it technically works. If the model is simulated, it can loop repeatedly until the race ends.

However, this model is clearly too abstract to represent a realistic NASCAR race.

That’s where refinement comes in.


Level 2: Adding More Behavioral Detail

In the second level of refinement, we add more detail to better represent the actual behavior of the system.

Instead of simply saying “make a left turn,” we model the four individual turns that make up a NASCAR lap:

  • Turn 1

  • Turn 2

  • Turn 3

  • Turn 4

Completing all four turns represents one full lap around the track.

In the activity diagram, these actions are connected sequentially to represent the path around the track.

After completing a lap, the model checks a condition:

Is the race complete?

If the race is not complete, the activity repeats and the car continues running laps.

This version of the model provides significantly better behavioral fidelity while still remaining simple enough to understand.


Level 3: Introducing Additional System Behavior

The third level of refinement introduces a more realistic constraint:

Fuel consumption.

In real racing, cars cannot simply run laps indefinitely. Drivers must occasionally enter the pit lane to refuel.

To represent this behavior, the refined activity diagram includes:

  • a fuel level check

  • a pit stop action

  • a nested activity representing the lap behavior

Now the activity flow looks something like this:

1️⃣ Check fuel level
2️⃣ If fuel is low → enter pit stop
3️⃣ Otherwise → continue racing
4️⃣ Run a lap (Turn 1 → Turn 4)
5️⃣ Check if race is complete

This creates a more realistic behavioral model.


Nested Activities in SysML

One important modeling concept introduced in the refined diagram is nested activities.

Instead of repeatedly modeling each turn throughout the entire diagram, the lap behavior is encapsulated inside a nested activity.

The lap activity includes:

  • Turn 1

  • Turn 2

  • Turn 3

  • Turn 4

The higher-level activity then simply calls the Run Lap activity when needed.

This technique improves model readability and allows behavior to be reused across diagrams.


Running the Model in Simulation

One advantage of SysML activity diagrams is the ability to run behavioral simulations.

Using simulation, we can observe how the logic executes step-by-step.

For example:

1️⃣ The race begins
2️⃣ The model checks if the car is low on fuel
3️⃣ If fuel is sufficient, the car runs a lap
4️⃣ The system checks if the race is finished
5️⃣ If not finished, the loop repeats

If the car eventually becomes low on fuel, the activity transitions to the pit stop action, refuels the car, and then continues the race.

This simulation capability helps validate behavioral logic early in system design.


Why Iterative Refinement Is a Good Modeling Practice

The NASCAR example illustrates an important MBSE principle:

Start simple, then refine.

Beginning with a very simple activity diagram helps engineers:

  • communicate initial system behavior

  • verify basic logic

  • avoid unnecessary complexity early in development

Once the core behavior is understood, additional realism can be added incrementally.

This iterative approach leads to models that are both:

  • understandable

  • accurate


Additional Ways Activity Diagrams Can Be Refined

The example shown here stops after introducing fuel logic, but the activity diagram could be refined even further.

Possible extensions might include:

  • tire wear and tire changes

  • yellow flag conditions

  • safety car behavior

  • overtaking and race position logic

  • weather conditions affecting driving

Each refinement adds more behavioral fidelity and makes the model more representative of the real system.


Key Takeaways for SysML Activity Diagrams

When modeling behavior in SysML, remember these key principles:

Start with a simple behavioral model

A high-level diagram helps teams agree on the basic system behavior.

Add detail gradually

Refinement should occur as system understanding improves.

Use nested activities

Encapsulating repeated behavior improves diagram clarity.

Validate behavior with simulation

Simulation helps confirm that logic flows correctly.

Avoid unnecessary complexity early

Detailed behavior should only be added when it improves understanding.


Learn More SysML Modeling Techniques

If you are learning SysML behavioral modeling, activity diagrams are one of the most useful tools for describing system logic and operational flow.

Watch the full tutorial here:

https://www.youtube.com/watch?v=UFl6pduULvw

The video demonstrates how to build and simulate these activity diagrams step-by-step.


Final Thoughts

Activity diagram refinement is a core modeling technique in SysML and MBSE. By starting with a simple representation and gradually introducing more realistic behaviors, engineers can build models that are both understandable and analytically useful.

The NASCAR example shows how a model can evolve from a simple “left turn” loop into a more realistic representation that includes laps, fuel checks, and pit stops.

This iterative approach is exactly how most real engineering models evolve over time.

Leave a Reply

Your email address will not be published. Required fields are marked *