1 function v=hgradx_general(obj,x,t,u,varargin)
\r
2 % Calculates: grad_x[h(x,t) + hu(x,t)*u(t) + e(t)]
\r
4 % Syntax: (* = optional)
\r
6 % grad_x = hgradx_general(model, x, t, u, e*);
\r
13 % Column vector or scalar containing x
\r
15 % Scalar containing the time of the operation.
\r
17 % Column vector or scalar containing deterministic data for this particular step.
\r
19 % Column vector or scalar containing e(t) for this particular step.
\r
20 % Redundant for this model, since e(t) is elimiated by the differentiation.
\r
25 % The result of the operation: the gradient with respect to x.
\r
27 % Toolbox for nonlinear filtering.
\r
28 % Copyright (C) 2005 Jakob Rosén <jakob.rosen@gmail.com>
\r
30 % This program is free software; you can redistribute it and/or
\r
31 % modify it under the terms of the GNU General Public License
\r
32 % as published by the Free Software Foundation; either version 2
\r
33 % of the License, or (at your option) any later version.
\r
35 % This program is distributed in the hope that it will be useful,
\r
36 % but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
37 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
38 % GNU General Public License for more details.
\r
40 % You should have received a copy of the GNU General Public License
\r
41 % along with this program; if not, write to the Free Software
\r
42 % Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
\r
44 % Calculate grad_x[h(x,t)]
\r
45 v=gradx(obj.h,x,t,[],[]);
\r
47 % If u is defined, we have to differentiate hu(x,t)*u(t) too (with respect to x)
\r
50 % ...but only if hu is defined!
\r
51 v=v+gradx(obj.hu,x,t,[],[])*u;
\r