Dymoval is a Python package for analyzing measurement data and validating models.
Dymoval validates models based only on measurements and simulated data, and it is completely independent of the used modeling tool. That means that it does not matter if a model has been developed with Simulink, Modelica, etc., dymoval will only look at the produced data from the model.
If you are tracking your models changes in a CI/CD environment, then dymoval API can be easily used to run tests in Jenkins or GitHub Actions pipelines as it enables unit-testing on models.
Finally, dymoval provides a number of functions for for handling measurements data, addressing common issues such as noise, missing data, and varying sampling intervals.
Dymoval exists on both pip
and conda
, so you can choose between the
following:
pip install dymoval
conda install conda-forge::dymoval
Suppose that you want to validate a model and you have the simulated out
time-seriesy_sim
along with the corresponding real-world measurements
y_meas
and the input time-series u_meas
, and let sampled_period
the
sampling period of these signals. Then, just call the following function:
from dymoval.validation import validate_models
validate_models(
measured_in=u_meas,
measured_out=y_meas,
simulated_out=y_sim,
sampling_period = sampling_period
)
to get something like the following:
Input whiteness (abs_mean-max) 0.3532
R-Squared (%) 65.9009
Residuals whiteness (abs_mean-max) 0.1087
Input-Res whiteness (abs_mean-max) 0.2053
My_Model
Outcome: PASS
Congrats! Your model passed the test!
But what if the test didn't pass? Don't worry, it might not be the model's fault.
For example, you could be dealing with noisy measurements, over-sampled signals, missing data, and other factors that might affect the results. Take a look at the tutorial to learn how to address such issues:
import dymoval as dmv
dmv.open_tutorial()
The above commands create a dymoval_tutorial
folder containing all the files
needed to run the tutorial in your home
folder. All you have to do is to run
Jupyter notebook named dymoval_tutorial.ipynb
. You need an app for opening
.ipynb
files.
And if you want to discover more on model validation and Dymoval check out the docs.
Model validation
- Validation metrics:
- R-square fit
- Residuals auto-correlation statistics
- Input-Residuals cross-correlation statistics
- Coverage region
- MIMO models
- Independence of the modeling tool used.
- API suitable for model unit-tests
Measurement data analysis and manipulation
- Time and frequency analysis
- Easy plotting
- Missing data handling
- Linear filtering
- Means and offsets removal
- Re-sampling
- Physical units
Dymoval is licensed under BSD 3 license.