# source:projects/ckbs/trunk/test/nonlinear_ok_box_f.m@95

Last change on this file since 95 was 35, checked in by bradbell, 11 years ago

Revmove reference to gpl2.txt and further shorten copyright and license statement

File size: 1001 bytes
Line
1% -------------------------------------------------------------------
2% ckbs: Constrained Kalman-Bucy Smoother Program: Copyright (C) 2006
3% Authors: Bradlely Bell:        bradbell at washington dot edu
4%          Gianluigi Pillonetto: giapi at dei dot unipd dot it
5% License: GNU General Public License Version 2
6% -------------------------------------------------------------------
7% \$begin nonlinear_ok_box_f.m\$\$ \$newlinech %\$\$
8%
9% \$spell
10%       ckbs
11%       fk
12%       xk
13% \$\$
14%
15% \$section Example Constraint Function: nonlinear_ok_box_f\$\$
16%
17% \$head Source Code\$\$
18% \$newlinech \$\$ \$codep
19function [fk, Fk] = nonlinear_ok_box_f(k, xk)
20        global nonlinear_ok_box_x4_min
21        global nonlinear_ok_box_x4_max
22        %
23        % constrained so that x4_min <= x4(t) <= x4_max
24        x4_min = nonlinear_ok_box_x4_min;
25        x4_max = nonlinear_ok_box_x4_max;
26        ell    = 2;
27        n      = size(xk, 1);
28        %
29        fk = [ ...
30                xk(4) - x4_max;
31                x4_min - xk(4) ...
32        ];
33        Fk = zeros(ell, n);
34        Fk(1, 4) = 1;
35        Fk(2, 4) = -1;
36        return
37end
38% \$\$ \$newlinech %\$\$
39% \$end
Note: See TracBrowser for help on using the repository browser.