.Buildings.Utilities.IO.Python_3_8.Examples.KalmanFilter

Information

This example demonstrates the implementation of a Kalman filter in Python. The model generates a uniform random number, which is computed in the Python file KalmanFilter.py by the function random(seed). This random number is added to a sine wave and then sent to the function filter(u) in the above Python file. The function filter(u) implements a Kalman filter that estimates and returns the state. The function saves its temporary variables to a file called tmp-kalman.json.

When simulating this model, the figure below will be generated which shows the sine wave, the sine wave plus noise, which is input to the Kalman filter, and the estimated state which is the output of the Kalman filter.

image

Implementation

The code is based on http://www.scipy.org/Cookbook/KalmanFiltering.

Revisions


Generated at 2025-01-08T19:40:16Z by OpenModelicaOpenModelica 1.24.3 using GenerateDoc.mos