Tutorial: Simulating Ideal Gas Measurements with Multi-Channel Generation
In this tutorial, you will use Phoenix's multi-channel generation feature to simulate realistic sensor data from an ideal gas experiment. By the end, you will have created a two-channel time series representing temperature and pressure readings from a sealed container of gas, complete with correlated signals, realistic noise, and data quality issues.
Background: The Ideal Gas Law
The ideal gas law states:
PV = nRT
Where: - P = Pressure (Pa) - V = Volume (m³) — constant for a sealed container - n = Amount of substance (mol) — constant - R = Universal gas constant (8.314 J/(mol·K)) - T = Temperature (K)
For a sealed container (fixed V and n), pressure is directly proportional to temperature:
P = (nR/V) × T
This means that when temperature rises, pressure rises proportionally. This physical relationship makes an ideal gas system a perfect example for multi-channel generation: two measured quantities that are strongly correlated by a known physical law.
Our Scenario
Imagine a sealed laboratory vessel containing nitrogen gas at roughly ambient conditions:
| Property | Value |
|---|---|
| Gas | Nitrogen (N₂) |
| Container volume | 0.01 m³ (10 litres) |
| Amount of gas | 0.5 mol |
| Baseline temperature | ~300 K (27 °C) |
| Baseline pressure | ~124 kPa |
| Observation period | 2 hours |
| Sampling rate | 1 Hz |
The vessel sits in a lab where the ambient temperature fluctuates with a slow periodic cycle (e.g. HVAC cycling) and faster random noise from sensor imprecision. We will model both effects.
Step 1: Open Phoenix Generator
Navigate to Phoenix from the main navigation and click Generate (or go directly to /phoenix/generate/).
You will see the generation interface with a sidebar on the left for configuration and a blank chart area on the right.
Screenshot 1 — Empty Generator Page Capture the full page showing the empty chart area and the sidebar with default single-channel configuration. This orients the reader to the interface layout.
Step 2: Configure the Time Axis
All channels share the same time axis, so we configure this first.
In the Time Configuration section of the sidebar, enter:
| Field | Value | Rationale |
|---|---|---|
| Duration — Hours | 2 |
2-hour observation window |
| Duration — Days, Minutes, Seconds | 0 |
Leave at zero |
| Sampling Frequency | 1 Hz |
One reading per second from each sensor |
This gives us 7,201 points per channel. With 2 channels, the total is 14,402 points, which exceeds the 10,000-point limit.
We need to reduce the sampling rate. Set:
| Field | Revised Value |
|---|---|
| Sampling Frequency | 0.5 Hz |
Now: 2 hours × 3,600 s/hr × 0.5 Hz = 3,600 points per channel, and 3,600 × 2 = 7,200 total points — safely within the limit.
Screenshot 2 — Time Configuration Capture the Time Configuration section showing duration set to 2 hours and sampling frequency at 0.5 Hz. Highlight the calculated point count if visible.
Step 3: Create the Temperature Channel
By default, Phoenix starts with a single channel. This will become our Temperature channel.
Click on the Channel 1 tab (it should already be active) and configure:
Channel Identity
| Field | Value |
|---|---|
| Channel Name | Temperature |
| Unit | K |
Base Signal
| Field | Value | Rationale |
|---|---|---|
| Mean | 300 |
Baseline temperature: 300 K (27 °C) |
| Noise Amplitude | 0.5 |
Simulates sensor noise of ±0.5 K — typical for an industrial thermocouple |
Linear Trend
Enable the trend and set:
| Field | Value | Rationale |
|---|---|---|
| Trend Slope | 0.001 |
Gradual warming of 0.001 K per time step. Over 3,600 steps this adds ~3.6 K drift — a subtle but detectable rise representing the lab warming up over the observation period. |
Oscillations
Click Add Oscillation and configure:
| Field | Value | Rationale |
|---|---|---|
| Period (seconds) | 1800 |
30-minute cycle, representing HVAC on/off cycling |
| Amplitude | 3 |
±3 K swing around the mean — a realistic HVAC-driven fluctuation |
| Phase | 0 |
Start at baseline |
This oscillation creates the dominant periodic pattern in the temperature signal.
Screenshot 3 — Temperature Channel Configuration Capture the full channel configuration card showing the name "Temperature", unit "K", mean 300, noise 0.5, trend enabled with slope 0.001, and one oscillation with period 1800 s / amplitude 3 / phase 0.
Step 4: Create the Pressure Channel
Click the Add Channel button. A new tab labelled "Channel 2" appears. Click on it to make it active.
Channel Identity
| Field | Value |
|---|---|
| Channel Name | Pressure |
| Unit | kPa |
Base Signal
For our sealed container: P = nRT/V = (0.5 × 8.314 × 300) / 0.01 ≈ 124,710 Pa ≈ 124.7 kPa.
| Field | Value | Rationale |
|---|---|---|
| Mean | 124.7 |
Equilibrium pressure at 300 K |
| Noise Amplitude | 0.8 |
Pressure transducers tend to be slightly noisier than thermocouples. ±0.8 kPa is realistic for an industrial sensor. |
Linear Trend
Enable the trend:
| Field | Value | Rationale |
|---|---|---|
| Trend Slope | 0.0004 |
Pressure rises proportionally to temperature. Since the temperature trend is 0.001 K/step and the sensitivity is roughly 0.415 kPa/K (from nR/V), the pressure trend is ~0.0004 kPa/step. |
Oscillations
Click Add Oscillation:
| Field | Value | Rationale |
|---|---|---|
| Period (seconds) | 1800 |
Same 30-minute cycle as temperature — pressure follows temperature via the gas law |
| Amplitude | 1.25 |
Temperature amplitude is 3 K. Pressure sensitivity ≈ 0.415 kPa/K, so pressure amplitude ≈ 3 × 0.415 ≈ 1.25 kPa |
| Phase | 0 |
In phase with temperature — pressure responds immediately in an ideal gas |
Screenshot 4 — Pressure Channel Configuration Capture the channel configuration card for "Pressure" showing unit "kPa", mean 124.7, noise 0.8, trend 0.0004, and oscillation with period 1800 / amplitude 1.25 / phase 0.
Screenshot 5 — Channel Tabs Capture the tab bar showing both "Temperature" and "Pressure" tabs. This shows the reader what the multi-channel interface looks like with two configured channels.
Step 5: Add Channel Correlation
Temperature and pressure in an ideal gas are strongly positively correlated. We need to tell Phoenix about this physical relationship.
Scroll down to the Channel Correlations section (this appears automatically when you have 2 or more channels).
- Click Add Correlation
- Set Channel A to
Temperature - Set Channel B to
Pressure - Set Correlation to
0.85
Why 0.85 and not 1.0? In a perfect ideal gas with perfect sensors, the correlation would be 1.0. We use 0.85 to account for: - Independent sensor noise on each measurement - Small deviations from ideal gas behaviour - Measurement timing differences
This creates a realistic scenario where the signals are strongly related but not identical.
Screenshot 6 — Channel Correlations Capture the Channel Correlations section showing one correlation entry: Temperature ↔ Pressure with value 0.85. Include the "Add Correlation" button below.
Step 6: Preview the Data
Click the Preview button at the bottom of the sidebar.
Phoenix generates the two-channel time series and displays an interactive Plotly chart. You should see:
- Two coloured traces — one for Temperature, one for Pressure
- Shared time axis — both signals span the same 2-hour window
- Correlated movement — when Temperature rises, Pressure rises too
- The 30-minute oscillation clearly visible in both signals
- A subtle upward trend over the full 2-hour window
- Random noise adding realistic jitter to both signals
What to Look For
-
Correlation: Click on the Temperature legend entry to hide it. Observe the Pressure trace alone. Then toggle it back and hide Pressure. Both should show the same general wave pattern.
-
Scale difference: Temperature oscillates around 300 K while Pressure oscillates around 124.7 kPa — very different scales, but the patterns are synchronised.
-
Noise difference: Pressure (noise=0.8) should look slightly noisier relative to its oscillation amplitude than Temperature (noise=0.5).
-
Trend: Look at the starting values versus the ending values. Both channels should end slightly higher than they started.
Screenshot 7 — Multi-Channel Preview Chart Capture the full chart showing both Temperature and Pressure traces. Zoom to show at least one full 30-minute cycle so the correlated oscillation is clearly visible.
Screenshot 8 — Chart Legend Interaction Capture two views: (a) Temperature hidden (click its legend entry), showing Pressure alone; (b) Both visible. This demonstrates the toggle feature.
Check the Statistics
Below the chart (or in the stats panel), review the per-channel statistics:
| Statistic | Temperature (K) | Pressure (kPa) |
|---|---|---|
| Mean | ~300 | ~124.7 |
| Min | ~295 | ~122 |
| Max | ~307 | ~127 |
| Std Dev | ~2.5 | ~1.2 |
The exact values will vary due to random noise, but they should be in these ballpark ranges.
Screenshot 9 — Statistics Panel Capture the statistics display showing per-channel metrics. If stats appear on hover or in a separate section, capture that.
Step 7: Add Data Degradation
Real sensors occasionally drop readings or produce erroneous spikes. Let's add these realistic imperfections to each channel independently.
Temperature Channel Degradation
Click the Temperature tab, then scroll to the Data Degradation section.
Missing Data
Enable Data Removal and configure:
| Field | Value | Rationale |
|---|---|---|
| Mode | Percentage |
Easier to reason about proportionally |
| Removal Percentage | 2 |
2% of readings lost — a realistic dropout rate for a wired thermocouple |
Outliers
Enable Outlier Insertion and configure:
| Field | Value | Rationale |
|---|---|---|
| Quantity Mode | Number |
We want a specific count |
| Number of Outliers | 5 |
5 spike events over 2 hours |
| Value Mode | Factor |
Multiply existing value to create spikes |
| Factor | 1.5 |
Spikes read 50% higher than actual — simulates a brief electrical interference event |
Screenshot 10 — Temperature Degradation Configuration Capture the degradation section for the Temperature channel showing data removal at 2% and 5 outliers with factor 1.5.
Pressure Channel Degradation
Click the Pressure tab and scroll to degradation.
Missing Data
Enable Data Removal:
| Field | Value | Rationale |
|---|---|---|
| Mode | Percentage |
Consistent with temperature approach |
| Removal Percentage | 5 |
Pressure transducers have a slightly higher dropout rate in this scenario — perhaps due to a longer cable run |
Outliers
Enable Outlier Insertion:
| Field | Value | Rationale |
|---|---|---|
| Quantity Mode | Number |
Specific count |
| Number of Outliers | 3 |
Fewer outlier events than temperature |
| Value Mode | Constant |
Sensor saturation — reads max value |
| Constant Value | 200 |
Sensor saturates at 200 kPa — a common failure mode for pressure transducers hitting their range limit |
Screenshot 11 — Pressure Degradation Configuration Capture the degradation section for the Pressure channel showing data removal at 5% and 3 constant-value outliers at 200 kPa.
Step 8: Preview with Degradation
Click Preview again to regenerate with degradation applied.
What to Look For
-
Gaps in the data: Zoom in and look for small breaks in the traces where data points have been removed. Temperature (2% removal) should have fewer gaps than Pressure (5% removal).
-
Temperature spikes: Look for 5 points where the Temperature trace jumps dramatically upward (50% above normal). These should be obvious outliers.
-
Pressure saturation: Look for 3 points where Pressure suddenly reads 200 kPa — well above the normal ~124.7 kPa range. These flat-topped spikes simulate sensor saturation.
-
Independent degradation: The gaps and spikes in each channel should occur at different timestamps — they are applied independently to each channel.
Screenshot 12 — Chart with Degradation Capture the full chart after degradation. Try to zoom into a region that shows at least one temperature spike and one pressure saturation point. Annotate or circle these features if your screenshot tool allows it.
Screenshot 13 — Zoomed View of Outliers Zoom into a narrow time window (e.g. 5 minutes) that contains a visible outlier. Capture the zoomed chart showing the spike clearly standing out from the normal signal.
Step 9: Save the Time Series
Once you are satisfied with the generated data, save it for use in SENTINEL.
- Click the Save button
- In the save dialog, enter:
| Field | Value |
|---|---|
| Name | Ideal Gas - Lab Vessel (N₂) |
| Description | Two-channel simulation of temperature and pressure measurements from a sealed nitrogen vessel. 2-hour observation at 0.5 Hz with HVAC-driven oscillations, sensor noise, and data quality issues. |
- Choose whether to open in SENTINEL after saving
- Click Confirm
Screenshot 14 — Save Dialog Capture the save modal showing the name and description fields filled in, with the save/confirm button visible.
Step 10: Export the Data
You can also download the generated data for analysis in external tools.
Click the Download button and choose a format:
- CSV — Best for Python (pandas), Excel, or general-purpose tools. The file will have columns:
Timestamp,Temperature,Pressure. - Excel — Ready-to-use spreadsheet with formatted columns
- JSON — Structured format for programmatic use
Example CSV Output
Timestamp,Temperature,Pressure
2024-01-01 10:00:00,299.47,123.89
2024-01-01 10:00:02,300.12,124.32
2024-01-01 10:00:04,300.85,124.71
2024-01-01 10:00:06,,124.15
2024-01-01 10:00:08,301.23,125.02
Note the empty cell in row 4 for Temperature — this is a removed data point (gap).
Screenshot 15 — Download Options Capture the download button/menu showing the available export formats (CSV, Excel, JSON).
Summary of Configuration
Here is the complete configuration used in this tutorial for reference:
Time Configuration
| Parameter | Value |
|---|---|
| Duration | 2 hours |
| Sampling Frequency | 0.5 Hz |
| Points per Channel | 3,600 |
| Total Points | 7,200 |
Channel 1: Temperature
| Parameter | Value |
|---|---|
| Name | Temperature |
| Unit | K |
| Mean | 300 |
| Noise Amplitude | 0.5 |
| Trend Slope | 0.001 |
| Oscillation Period | 1800 s |
| Oscillation Amplitude | 3 |
| Oscillation Phase | 0 |
| Data Removal | 2% |
| Outliers | 5, factor ×1.5 |
Channel 2: Pressure
| Parameter | Value |
|---|---|
| Name | Pressure |
| Unit | kPa |
| Mean | 124.7 |
| Noise Amplitude | 0.8 |
| Trend Slope | 0.0004 |
| Oscillation Period | 1800 s |
| Oscillation Amplitude | 1.25 |
| Oscillation Phase | 0 |
| Data Removal | 5% |
| Outliers | 3, constant 200 kPa |
Correlation
| Channel A | Channel B | Coefficient |
|---|---|---|
| Temperature | Pressure | 0.85 |
Exercises
Now that you have completed the basic tutorial, try these variations to deepen your understanding:
Exercise 1: Add a Third Channel — Volume
In reality, containers can expand slightly under pressure. Add a third channel for Volume: - Mean: 0.01 m³ - Very small noise (0.0001) - Weak negative correlation with Pressure (-0.1) - No oscillation (rigid container)
Exercise 2: Simulate a Cooling Event
Change the Temperature trend slope to a negative value (-0.002) to simulate the lab cooling down. Observe how the Pressure channel follows.
Exercise 3: Phase Lag
In some systems, pressure responds to temperature with a delay. Set the Pressure oscillation phase to 0.3 radians (~17° lag) and observe the subtle timing offset in the preview.
Exercise 4: Increase Correlation
Set the correlation to 0.95 and regenerate. Compare how closely the channels track each other versus the 0.85 configuration.
Key Takeaways
-
Multi-channel generation lets you create physically realistic datasets where signals share a common time axis and can be correlated.
-
Channel correlations model physical relationships between measured quantities — in this case, the ideal gas law linking temperature and pressure.
-
Independent degradation per channel creates realistic data quality scenarios where different sensors fail in different ways.
-
The point limit is shared across all channels. With 2 channels, you have half the per-channel budget compared to single-channel generation. Plan your sampling rate accordingly.
-
Physical reasoning should guide your parameter choices. Using the gas law to derive the pressure mean, oscillation amplitude, and trend slope from the temperature parameters creates a self-consistent dataset.
Next Steps
- Channel Correlations Guide — Deep dive into correlation configuration and validation
- Data Degradation Guide — Explore all degradation options in detail
- Oscillations Guide — Add more complex periodic patterns
- Sampling and Aliasing Guide — Understand sampling constraints for multi-channel data
- Export and Save Guide — Work with your generated data in external tools