Simulating Systems with OPCloud — Part 1: Native Computation

Simulating Systems with OPCloud — Part 1: Native Computation

What You Can Do With OPCloud

Simulation — The Holy Grail in System Modelling

Among the many benefits of Model-Based Systems Engineering, the ability to simulate system behaviour is often the most valued. Simulation enables us to grasp system dynamics and predict outcomes under various conditions — something static models cannot offer.

With the wide range of MBSE tools, each with its unique computational capabilities built on their specific languages, users can often feel overwhelmed. It becomes a challenge to choose the most suitable tool for the problem at hand.

In the Simulating Systems with OPCloud series, we’ll explore how OPCloud simplifies and decentralises simulations in Systems Engineering, offering one of the most versatile and powerful MBSE tools on the market.

Overview of OPCloud Simulation

Object Process Methodology models created with OPCloud can be simulated with a simple click of button. Starting from the top-level System Diagram, processes are executed in a hierarchical manner — peeling back layers of abstraction and then returning to the surface. At each level, processes are executed from top to bottom, or in parallel if they are aligned at the same horizontal level, following the OPM Timeline Principle.


Simulation in OPCloud
Simulation in OPCloud, created by author using Canva

A successful simulation is more than an animated sequence of events. For the model to accurately depict the system, the underlying logic of each action or event must be embedded within the process — this is where computation plays a critical role.

With OPCloud, you can convert a process into a computational one, enabling complex logic ranging from simple arithmetic to stochastic processes and advanced programmatic functions. OPCloud currently supports the following ways of computations:

  • OPCloud Predefined functions
  • User-defined functions in TypeScript
  • External API integrations
  • SQL database connections
  • Advanced analytics through Python and MATLAB
  • Robotics control with ROS
  • IoT messaging with MQTT

In this first part of the series, we’ll focus on basic simulation usage within OPCloud, particularly native computation functionalities such as predefined and user-defined functions.

Native Computation in OPCloud

While external integrations provide more advanced computation, it is often advantageous to leverage OPCloud’s native functions whenever possible. This simplifies the process by keeping computations locally and ensuring the logic remains visible within the model rather than being hidden in external applications. Additionally, native computations avoids dependency and maintenance challenges associated with external integrations.

Below, we’ll explore several native features of OPCloud, using the classic example of ATM cash withdrawal. In this scenario, after the customer initiates the transaction and inputs the withdrawal amount, the bank checks whether the account balance is sufficient. If it is, the ATM dispenses the cash and updates the balance. Otherwise, a denial notice is served.

Cash Withdrawing in-zoomed
Cash Withdrawing in-zoomed, created by author using OPCloud

Importing/Exporting Variables

Engineers often need to simulate systems under various conditions. In OPM, these conditions are expressed through the state of objects. For instance, in the ATM scenario, the “Balance” and “Amount” are computational objects, with their states representing the account balance and the requested withdrawal amount.

In OPCloud, you can import these values from an external file, such as an Excel spreadsheet, to simulate different scenarios. This flexibility allows you to benchmark the system against a set of nominal or even edge cases such as zero or negative withdrawal amounts, or unusually large sums. OPCloud can also export the results of these simulations, providing a robust way to track object states.

Importing variables values
Importing variables values, created by author using OPCloud

Simulating with Probabilities

Another approach is to model object values using probability distributions. For example, you could set the “Balance” to $100 and define the “Amount” as a normally distributed variable with a mean of $70 and a standard deviation of $20. This setup eliminates the need to define multiple tests manually, as OPCloud can run the simulation several times, generating random values based on the distribution.

Simulating with probabilities
Simulating with probabilities, created by author using OPCloud

Moreover, some scenarios are often stochastic in nature, such as the weights of passengers onboarding an aircraft. By applying real-world statistical data, OPCloud can simulate realistically if the aircraft remains within weight limits under varying passenger loads.

Simulating with User Inputs

Perhaps the most intuitive way to simulate the ATM example is to ask for the user input directly. In OPCloud, you could configure the “Withdrawal Querying” process to prompt the user for the withdrawal amount during the simulation. To remain consistent with the OPM principles, the process has to have an agent — an object connected to it via the agent link.

Simulating with user inputs
Simulating with user inputs, created by author using OPCloud

This feature allows for flexible testing, enabling engineers to define specific test cases manually and observe the outcomes in real time. The user-provided value can be used either directly or as an argument in another function.

Computing with Predefined Functions

Even complex workflows have simple routine processes. OPCloud provides predefined functions for these common tasks, making it easier to set up a simulation. In the ATM example, “Balance Updating” simply involves subtracting the “Amount” from the “Balance”. Using OPCloud’s predefined subtraction function, you can easily automate the process, with the remaining balance calculated during the simulation.

Computing with predefined functions
Computing with predefined functions, created by author using OPCloud

The built-in functions cover a wide range of needs, from basic arithmetic to trigonometric, exponential, and statistical operations, as well as string concatenation. These native functions are efficient, robust, and help maintain clear visibility into the system’s embedded logic.

Computing with TypeScript

While predefined functions cover basic operations, more complex processes can be defined using TypeScript. In the ATM scenario, for instance, we can implement the logic for “Balance Checking” using TypeScript, allowing us to define intricate conditional logic without needing external integrations.

Computing with TypeScript
Computing with TypeScript, created by author using OPCloud

This native scripting capability is particularly useful for developing prototypes and mock-ups. Once the design is validated, the process can later be connected to an external system, such as the actual banking API, for further verifications.

Final Thoughts

Simulation enables engineers to anticipate how systems will behave under various conditions, identifying potential issues and optimizing performance long before physical prototypes are built. In complex, multi-faceted systems, this capability is crucial for reducing development costs and ensuring successful implementation.

OPCloud’s native computational capabilities provide an accessible and powerful platform for simulating these systems directly within your OPM models. Whether you’re performing simple calculations or running sophisticated algorithms, OPCloud streamlines the simulation process, empowering engineers to focus on refining and optimizing system behaviour with greater efficiency and clarity.

As we continue this series, we will dive deeper into external integrations, exploring how OPCloud can extend its computational power beyond native functionalities, offering a seamless interface to a wide array of tools and environments.

Interested in deepening your knowledge of OPM and advance your skills? Check out our microcourse on OptimiSE Academy !

What do you think about OPCloud’s simulation functionalities? Feel free to share your thoughts or experiences in the comments below!

Christopher Cerqueira

Adjunct Professor at Instituto Tecnológico da Aeronáutica

4 个月

Interesting. Despite the overall simulation capability, the simulation visualization was way better into OPCat.

要查看或添加评论,请登录

Joy Au的更多文章

社区洞察

其他会员也浏览了