1 function v=hgrade_general(obj,x,t,u,varargin)
\r
2 % Calculates: grad_e[h(x,t) + hu(x,t)*u(t) + e(t)]
\r
4 % Syntax: (* = optional)
\r
6 % grad_e = hgrade_general(model, x, t, u, e*);
\r
13 % Column vector or scalar containing x
\r
14 % Redundant argument for this model, because x is elimiated by the differentiation.
\r
16 % Scalar containing the time of the operation.
\r
17 % Redundant argument for this model, because t is elimiated by the differentiation.
\r
19 % Column vector or scalar containing deterministic data for this particular step.
\r
20 % Redundant argument for this model, because u(t) is eliminated by the differentiation.
\r
22 % Column vector or scalar containing e(t) for this particular step.
\r
23 % Redundant argument for this model, since this is eliminated by the differentiation.
\r
28 % The result of the operation: the gradient with respect to e.
\r
29 % grad_w always equals one for this model.
\r
31 % Toolbox for nonlinear filtering.
\r
32 % Copyright (C) 2005 Jakob Rosén <jakob.rosen@gmail.com>
\r
34 % This program is free software; you can redistribute it and/or
\r
35 % modify it under the terms of the GNU General Public License
\r
36 % as published by the Free Software Foundation; either version 2
\r
37 % of the License, or (at your option) any later version.
\r
39 % This program is distributed in the hope that it will be useful,
\r
40 % but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
41 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
42 % GNU General Public License for more details.
\r
44 % You should have received a copy of the GNU General Public License
\r
45 % along with this program; if not, write to the Free Software
\r
46 % Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
\r
48 % This should be property or something for the sake of optimization
\r
49 %v=eye(size(get(model,'R')));
\r
51 % A scalar will PROBABLY be enough, since the "real" gradient will be the identity matrix
\r
52 % of the same size as R. Since V*R*V' in the EKF filter produces the same result with
\r
53 % a scalar, with much fast execution time, this little optimization will probably work.
\r
54 % if not, just uncomment the above code...
\r
55 v=1; % (... and comment this line!)
\r