Cleaned up equations for UKF.
I was using a bunch of variable names that weren't consistent with the rest of the book (but perhaps are more consistent with the literature). It just made everything more challenging than it needed to be, so instead of \mu and \sigma (e.g.) I use \bar x and \bar P. I also am in the middle of rewriting some sections for clarity, but that work is not completed.
This commit is contained in:
parent
b6d5052f45
commit
800ea6c189
@ -292,7 +292,7 @@
|
||||
"\n",
|
||||
"$$m\\frac{d^2x}{dt^2} + c\\frac{dx}{dt} +kx = 0$$\n",
|
||||
"\n",
|
||||
"It is not possible to write a linear equation for this second order differential equation, and therefore we cannot design a Kalman filter using the theory that we have learned.\n",
|
||||
"There is no linear solution for $x(t)$ for this second order differential equation, and therefore we cannot design a Kalman filter using the theory that we have learned.\n",
|
||||
"\n",
|
||||
"A second source of nonlinearity comes from the measurements. For example, radars measure the slant range to an object, and we are typically interested in the aircraft's position over the ground. We invoke Pythagoras and get the nonlinear equation:\n",
|
||||
"\n",
|
||||
@ -942,7 +942,7 @@
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.5.0"
|
||||
"version": "3.5.1"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
File diff suppressed because one or more lines are too long
@ -246,7 +246,7 @@ def plot_monte_carlo_mean(xs, ys, f, mean_fx, label, plot_colormap=True):
|
||||
plt.scatter(mean_fx[0], mean_fx[1],
|
||||
marker='v', s=300, c='r', label=label)
|
||||
plt.scatter(computed_mean_x, computed_mean_y,
|
||||
marker='*',s=120, c='r', label='Computed Mean')
|
||||
marker='*',s=120, c='b', label='Computed Mean')
|
||||
|
||||
plot_bivariate_colormap(fxs, fys)
|
||||
plt.ylim([-10, 200])
|
||||
|
@ -279,7 +279,7 @@ def plot_radar(xs, t, plot_x=True, plot_vel=True, plot_alt=True):
|
||||
plt.ylabel('altitude')
|
||||
plt.show()
|
||||
|
||||
|
||||
|
||||
def plot_altitude(xs, t, track):
|
||||
xs = np.asarray(xs)
|
||||
|
||||
@ -289,7 +289,7 @@ def plot_altitude(xs, t, track):
|
||||
plt.ylabel('altitude')
|
||||
plt.legend(loc=4)
|
||||
|
||||
|
||||
|
||||
def print_sigmas(n=1, mean=5, cov=3, alpha=.1, beta=2., kappa=2):
|
||||
points = MerweScaledSigmaPoints(n, alpha, beta, kappa)
|
||||
print('sigmas: ', points.sigma_points(mean, cov).T[0])
|
||||
@ -404,20 +404,24 @@ def _plot_iscts(pos, sa, sb, N=4):
|
||||
xs_b.append(db*math.cos(a_b) + sb[0])
|
||||
ys_b.append(db*math.sin(a_b) + sb[1])
|
||||
|
||||
plt.scatter(xs, ys, c='r', marker='.')
|
||||
plt.scatter(xs_a, ys_a)
|
||||
plt.scatter(xs_b, ys_b)
|
||||
plt.scatter(xs, ys, c='r', marker='.', alpha=0.5)
|
||||
plt.scatter(xs_a, ys_a, c='k', edgecolor='k')
|
||||
plt.scatter(xs_b, ys_b, marker='v', edgecolor=None)
|
||||
plt.gca().set_aspect('equal')
|
||||
|
||||
|
||||
def plot_iscts_two_sensors():
|
||||
plt.subplot(121)
|
||||
pos = np.array([4., 4,])
|
||||
sa = [0., 2.]
|
||||
sb = [8., 2.]
|
||||
|
||||
plt.scatter(*sa, s=100)
|
||||
plt.scatter(*sb, s=100)
|
||||
plt.scatter(*sa, s=200, c='k', marker='v')
|
||||
plt.scatter(*sb, s=200, marker='s')
|
||||
_plot_iscts(pos, sa, sb, N=4)
|
||||
plt.subplot(122)
|
||||
plot_iscts_two_sensors_changed_sensors()
|
||||
|
||||
|
||||
|
||||
def plot_iscts_two_sensors_changed_sensors():
|
||||
@ -425,8 +429,8 @@ def plot_iscts_two_sensors_changed_sensors():
|
||||
sb = [3, 7]
|
||||
pos= np.array([3., 3.])
|
||||
|
||||
plt.scatter(*sa, s=100)
|
||||
plt.scatter(*sb, s=100)
|
||||
plt.scatter(*sa, s=200, c='k', marker='v')
|
||||
plt.scatter(*sb, s=200, marker='s')
|
||||
_plot_iscts(pos, sa, sb, N=5)
|
||||
plt.ylim(3.8, 8.5)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user