Initial commit
[pftoolbox.git] / GUI / pfgui_example_models.m
blob05f1242bd332d7cc72b19b78caff869571a71c22
1 function [objects,names]=pfgui_example_models;\r
2 % Sorry, I didn't have enough time to write nice and documented GUI code.\r
3 \r
4 % Toolbox for nonlinear filtering.\r
5 % Copyright (C) 2005  Jakob Rosén <jakob.rosen@gmail.com>\r
6 %\r
7 % This program is free software; you can redistribute it and/or\r
8 % modify it under the terms of the GNU General Public License\r
9 % as published by the Free Software Foundation; either version 2\r
10 % of the License, or (at your option) any later version.\r
11 %\r
12 % This program is distributed in the hope that it will be useful,\r
13 % but WITHOUT ANY WARRANTY; without even the implied warranty of\r
14 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
15 % GNU General Public License for more details.\r
16 %\r
17 % You should have received a copy of the GNU General Public License\r
18 % along with this program; if not, write to the Free Software\r
19 % Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.\r
21 objects={};\r
22 names={};\r
24 %%%%%% MODEL 1 %%%%%%\r
25 T=1;\r
26 f=[1 0 T 0; 0 1 0 T; 0 0 1 0; 0 0 0 1];\r
27 gw=[0.5*T^2 0; 0 0.5*T^2; T 0; 0 T];\r
28 %h={'sqrt(x1.^2+x2.^2)', 'atan(x2./x1)', 'x4'};\r
29 h={'x1','x2','x4'};\r
31 model=danl(f,gw,[],h,[],[0 0 0 0]',[1 1],[0.25 0.2 0.1], [], 1, {'x1','x2','x3','x4'});\r
32 name='Totally linear';\r
34 objects{end+1}=model;\r
35 names{end+1}=name;\r
37 %%%%%% MODEL 2 %%%%%%\r
38 f=[1 0 T 0 0.5*T^2 0; 0 1 0 T 0 0.5*T^2; 0 0 1 0 T 0; 0 0 0 1 0 T];\r
39 model=dnl(xlinear(f,[1 4],[4 1 0 2]),h,[0 0 0 0]',[1 1],[0.25 0.2 0.1], [], 1, {'x1','x2','x3','x4'});\r
40 name='Totally linear';\r
42 objects{end+1}=model;\r
43 names{end+1}=name;\r
45 %%%%%% MODEL 3 %%%%%%\r
46 h={'x1+e1','x2+e2','x4+e3'};\r
47 model=dgnl(xlinear(f,[1 4],[4 1 0 2]),h,@h_inv_1,[0 0 0 0]',[1 1],[0.25 0.2 0.1], [], 1, {'x1','x2','x3','x4'});\r
48 name='Totally linear';\r
50 objects{end+1}=model;\r
51 names{end+1}=name;\r
53 %%%%%% MODEL 4 %%%%%%\r
54 T=1;\r
55 f='cos(x1.^2)+sin(x1)+x1';\r
56 h={'cos(x1)','sin(x1)'};\r
58 model=danl(f, 1, [], h, [], 0, 1, [0.0025 0.002], 1);\r
60 objects{end+1}=model;\r
61 names{end+1}='Trigonometric';\r
63 %%%%%% MODEL 5 %%%%%%\r
64 T=1;\r
65 A=[1 0 T 0; 0 1 0 T; 0 0 1 0; 0 0 0 1];\r
66 B=[0.5*T^2 0; 0 0.5*T^2; T 0; 0 T];\r
67 h={'sqrt(x1.^2+x2.^2)', 'atan2(x2,x1)'};\r
69 gradx={'1/(x1^2+x2^2+eps)^(1/2)*x1', '1/(x1^2+x2^2+eps)^(1/2)*x2', '0', '0'; '-x2/(x1^2+eps)/(1+x2^2/(x1^2+eps))', '1/(x1+eps)/((1+x2^2+eps)/(x1^2+eps))', '0', '0'};\r
71 model=danl(A,B,[],h,[],[0 0 0 0],[1 1],[1 1], [1 1 1 1]');\r
72 model=set(model,'hgradx',gradx);\r
74 objects{end+1}=model;\r
75 names{end+1}='Wild Bearings';\r