Update posterior parameter distribution of degradation remaining useful life model
Update Exponential Degradation Model in Real Time
Load training data, which is a degradation feature profile for a component.
For this example, assume that the training data is not historical data. When there is no historical data, you can update your degradation model in real time using observed data.
Create an exponential degradation model with the following settings:
Arbitrary and prior distributions with large variances so that the model relies mostly on observed data
Noise variance of
mdl = exponentialDegradationModel('Theta',1,'ThetaVariance',1e6,... 'Beta',1,'BetaVariance',1e6,... 'NoiseVariance',0.003);
Since there is no life time variable in the training data, create an arbitrary life time vector for fitting.
lifeTime = [1:length(expRealTime)];
Observe the degradation feature for 10 iterations. Update the degradation model after each iteration.
for i=1:10 update(mdl,[lifeTime(i) expRealTime(i)]) end
After observing the model for some time, for example at a steady-state operating point, you can restart the model and save the current posterior distribution as a prior distribution.
View the updated prior distribution parameters.
ans = struct with fields: Theta: 2.3555 ThetaVariance: 0.0058 Beta: 0.0722 BetaVariance: 3.6362e-05 Rho: -0.8429
mdl — Degradation RUL model
linearDegradationModel object |
Degradation RUL model, specified as a
linearDegradationModel object or an
update updates the posterior estimates of the
degradation model parameters based on the latest degradation feature
linearDegradationModel, the updated parameters
exponentialDegradationModel, the updated
update also sets the following properties of
InitialLifeTimeValue— The first time you call
update, this property is set to the life time value in the first row of
CurrentLifeTimeValue— Each time you call
update, this property is set to the life time value in the last row of
CurrentMeasurement— Each time you call
update, this property is set to the feature measurement value in the last row of
data — Degradation feature measurements
two-column array |
Degradation feature measurements, specified as one of the following:
Two-column array — The first column contains life time values and the second column contains the corresponding degradation feature measurement.
timetableobject that contains variables with names that match the
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Usage notes and limitations:
This command supports code generation with MATLAB® Coder™. Before generating code that uses an RUL model, you must save the model using
saveRULModelForCoder. When updating the model at run time, it is also useful to store the model state using
readState. For an example, see Generate Code that Preserves RUL Model State for System Restart.