SCADA applications (water, power, oil and gas) in SCADA systems - Time & Space Complexity
When working with SCADA systems, it is important to understand how the time to process data grows as more sensors or devices are added.
We want to know how the system's work changes when the number of monitored points increases.
Analyze the time complexity of the following SCADA data polling loop.
for sensor in sensors_list:
data = read_sensor(sensor)
process_data(data)
log_data(data)
if alert_condition(data):
send_alert(sensor, data)
This code polls each sensor, processes its data, logs it, and sends alerts if needed.
Look at what repeats as the system runs.
- Primary operation: Looping through each sensor in the list.
- How many times: Once for every sensor in the sensors_list.
As the number of sensors increases, the system does more work in a straight line.
| Input Size (n) | Approx. Operations |
|---|---|
| 10 | About 10 sensor reads and processes |
| 100 | About 100 sensor reads and processes |
| 1000 | About 1000 sensor reads and processes |
Pattern observation: The work grows evenly as more sensors are added.
Time Complexity: O(n)
This means the time to complete the polling grows directly with the number of sensors.
[X] Wrong: "Adding more sensors won't affect the polling time much because each sensor is quick to read."
[OK] Correct: Even if each read is fast, doing many reads adds up, so total time grows with sensor count.
Understanding how system work grows with input size helps you design and maintain SCADA systems that stay reliable as they scale.
What if we added parallel processing to read sensors simultaneously? How would the time complexity change?