For the hysteresis modeling, the data processing follows the same common steps.
Inputs and outputs
Input: , array of length Output: , optionally, , arrays of length
Processing steps
- Use a butterworth lowpass filter on measured
Low amplitude noise filterThe low amplitude filter introduces to many artifacts. An edge-preserving gaussian smoothing might be better.- Fit a Calibration function to the anhysteretic magnetization loop, preferably using the major magnetization loops (LHCPILOT or equivalent).
- RDP downsampling
Calculate from if’s missingis retrieved from NXCALSRemove the polynomial component from , and .Subtract the calibration function from the measured field to leave only non-linear residual.- Normalize variables to have zero mean and unit variance.
- Use sliding window to create data samples to model
Data filtering
The input and target data acquired from the B-Train are lowpass filtered, and stored in additional colums I_meas_A_filtered, B_meas_T_filtered and B_meas_dot_Ts_filtered using the lowpass filter configurations.
Adding current derivative
The derivative of the input current is computed using the filtered current and np.gradient, and stored as a column I_meas_A_filtered_dot.
Downsampling
To match the frequency of the FGC real-time channel, for the modeling of the MBIs, we use a downsampling rate of 20, which effectively reduces the 1 kHz signal to 50 Hz, which results in a sampling spacing of . This is implemented in the transformertf EncoderDecoderDataModule on a dataframe level, or in the EncoderDecoderDataset on a sampling level. The latter is used during training, since downsampling is performed by taking every th sample when sliding windows are used.
Removing calibration function
As a significant pre-processing step, the bijective Calibration function is subtracted from the measured field, which requires using the EncoderDecoderDataModule extra_transforms constructor argument to pass an additional transformertf.data.transforms.DiscreteFunctionTransform transform, and supply the target_depends_on="I_meas_A_filtered constructor argument to the datamodule. The calibration function is then subtracted automatically during pre-processing.
Normalize
The input and target data is normalized to have zero mean and unit variance, which is required by the neural network. The normalization is handled automatically by the EncoderDecoderDataModule when setting the normalize=True during datamodule construction.