Mentions légales du service

Skip to content
Snippets Groups Projects
Unverified Commit b273c7e9 authored by sleepingAgain's avatar sleepingAgain Committed by GitHub
Browse files

Fixed typo

parent b00adb27
Branches
No related tags found
No related merge requests found
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
[Table of Contents](http://nbviewer.ipython.org/github/rlabbe/Kalman-and-Bayesian-Filters-in-Python/blob/master/table_of_contents.ipynb) [Table of Contents](http://nbviewer.ipython.org/github/rlabbe/Kalman-and-Bayesian-Filters-in-Python/blob/master/table_of_contents.ipynb)
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
# H Infinity filter # H Infinity filter
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
#format the book #format the book
%matplotlib inline %matplotlib inline
from __future__ import division, print_function from __future__ import division, print_function
from book_format import load_style from book_format import load_style
load_style() load_style()
``` ```
%% Output %% Output
<IPython.core.display.HTML object> <IPython.core.display.HTML object>
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
I am still mulling over how to write this chapter. In the meantime, Professor Dan Simon at Clevant State University has an accessible introduction here: I am still mulling over how to write this chapter. In the meantime, Professor Dan Simon at Cleveland State University has an accessible introduction here:
http://academic.csuohio.edu/simond/courses/eec641/hinfinity.pdf http://academic.csuohio.edu/simond/courses/eec641/hinfinity.pdf
In one sentence the $H_\infty$ (H infinity) filter is like a Kalman filter, but it is robust in the face of non-Gaussian, non-predictable inputs. In one sentence the $H_\infty$ (H infinity) filter is like a Kalman filter, but it is robust in the face of non-Gaussian, non-predictable inputs.
My FilterPy library contains an H-Infinity filter. I've pasted some test code below which implements the filter designed by Simon in the article above. Hope it helps. My FilterPy library contains an H-Infinity filter. I've pasted some test code below which implements the filter designed by Simon in the article above. Hope it helps.
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
from __future__ import (absolute_import, division, print_function, from __future__ import (absolute_import, division, print_function,
unicode_literals) unicode_literals)
from numpy import array from numpy import array
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
from filterpy.hinfinity import HInfinityFilter from filterpy.hinfinity import HInfinityFilter
dt = 0.1 dt = 0.1
f = HInfinityFilter(2, 1, dim_u=1, gamma=.01) f = HInfinityFilter(2, 1, dim_u=1, gamma=.01)
f.F = array([[1., dt], f.F = array([[1., dt],
[0., 1.]]) [0., 1.]])
f.H = array([[0., 1.]]) f.H = array([[0., 1.]])
f.G = array([[dt**2 / 2, dt]]).T f.G = array([[dt**2 / 2, dt]]).T
f.P = 0.01 f.P = 0.01
f.W = array([[0.0003, 0.005], f.W = array([[0.0003, 0.005],
[0.0050, 0.100]])/ 1000 #process noise [0.0050, 0.100]])/ 1000 #process noise
f.V = 0.01 f.V = 0.01
f.Q = 0.01 f.Q = 0.01
u = 1. #acceleration of 1 f/sec**2 u = 1. #acceleration of 1 f/sec**2
xs = [] xs = []
vs = [] vs = []
for i in range(1,40): for i in range(1,40):
f.update (5) f.update (5)
#print(f.x.T) #print(f.x.T)
xs.append(f.x[0,0]) xs.append(f.x[0,0])
vs.append(f.x[1,0]) vs.append(f.x[1,0])
f.predict(u=u) f.predict(u=u)
plt.subplot(211) plt.subplot(211)
plt.plot(xs) plt.plot(xs)
plt.title('position') plt.title('position')
plt.subplot(212) plt.subplot(212)
plt.plot(vs) plt.plot(vs)
plt.title('velocity'); plt.title('velocity');
``` ```
%% Output %% Output
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment