]> Creatis software - CreaPhase.git/blob - octave_packages/control-2.3.52/WestlandLynx.m
Add a useful package (from Source forge) for octave
[CreaPhase.git] / octave_packages / control-2.3.52 / WestlandLynx.m
1 ## -*- texinfo -*-
2 ## @deftypefn{Function File} {@var{sys} =} WestlandLynx ()
3 ## Model of the Westland Lynx Helicopter about hover.
4 ## @example
5 ## @group
6 ## INPUTS
7 ## main rotor collective
8 ## longitudinal cyclic
9 ## lateral cyclic
10 ## tail rotor collective
11 ## @end group
12 ## @end example
13 ## @example
14 ## @group
15 ## STATES
16 ## pitch attitude           theta       [rad]
17 ## roll attitude            phi         [rad]
18 ## roll rate (body-axis)    p           [rad/s]
19 ## pitch rate (body-axis)   q           [rad/s]
20 ## yaw rate                 xi          [rad/s]
21 ## forward velocity         v_x         [ft/s]
22 ## lateral velocity         v_y         [ft/s]
23 ## vertical velocity        v_z         [ft/s]
24 ## @end group
25 ## @end example
26 ## @example
27 ## @group
28 ## OUTPUTS
29 ## heave velocity           H_dot       [ft/s]
30 ## pitch attitude           theta       [rad]
31 ## roll attitude            phi         [rad]
32 ## heading rate             psi_dot     [rad/s]
33 ## roll rate                p           [rad/s]
34 ## pitch rate               q           [rad/s]
35 ## @end group
36 ## @end example
37 ## @example
38 ## @group
39 ## Reference:
40 ## Skogestad, S. and Postlethwaite I.
41 ## Multivariable Feedback Control: Analysis and Design
42 ## Second Edition
43 ## Wiley 2005
44 ## http://www.nt.ntnu.no/users/skoge/book/2nd_edition/matlab_m/matfiles.html
45 ## @end group
46 ## @end example
47 ## @end deftypefn
48
49 ## Author: Lukas Reichlin <lukas.reichlin@gmail.com>
50 ## Created: January 2010
51 ## Version: 0.1
52
53 function sys = WestlandLynx ()
54
55   if (nargin)
56     print_usage ();
57   endif
58
59   a01 = [                 0                  0                  0   0.99857378005981;
60                           0                  0   1.00000000000000  -0.00318221934140;
61                           0                  0 -11.57049560546880  -2.54463768005371;
62                           0                  0   0.43935656547546  -1.99818229675293;
63                           0                  0  -2.04089546203613  -0.45899915695190;
64          -32.10360717773440                  0  -0.50335502624512   2.29785919189453;
65            0.10216116905212  32.05783081054690  -2.34721755981445  -0.50361156463623;
66           -1.91097259521484   1.71382904052734  -0.00400543212891  -0.05741119384766];
67
68   a02 = [  0.05338427424431                  0                  0                  0;
69            0.05952465534210                  0                  0                  0;
70           -0.06360262632370   0.10678052902222  -0.09491866827011   0.00710757449269;
71                           0   0.01665188372135   0.01846204698086  -0.00118747074157;
72           -0.73502779006958   0.01925575733185  -0.00459562242031   0.00212036073208;
73                           0  -0.02121581137180  -0.02116791903973   0.01581159234047;
74            0.83494758605957   0.02122657001019  -0.03787973523140   0.00035400385968;
75                           0   0.01398963481188  -0.00090675335377  -0.29051351547241];
76
77   a0 = [a01 a02];
78
79   b0 = [                  0                  0                  0                  0;
80                           0                  0                  0                  0;
81            0.12433505058289   0.08278584480286  -2.75247764587402  -0.01788876950741;
82           -0.03635892271996   0.47509527206421   0.01429074257612                  0;
83            0.30449151992798   0.01495801657438  -0.49651837348938  -0.20674192905426;
84            0.28773546218872  -0.54450607299805  -0.01637935638428                  0;
85           -0.01907348632812   0.01636743545532  -0.54453611373901   0.23484230041504;
86           -4.82063293457031  -0.00038146972656                  0                  0];
87
88   c0 = [  0        0         0         0         0    0.0595   0.05329  -0.9968;
89         1.0        0         0         0         0         0         0        0;
90           0      1.0         0         0         0         0         0        0;
91           0        0         0  -0.05348       1.0         0         0        0;
92           0        0       1.0         0         0         0         0        0;
93           0        0         0       1.0         0         0         0       0];
94
95   d0 = zeros (6, 4);
96
97   inname = {"main_coll", "long_cyc", "lat_cyc", "tail_coll"};
98   stname = {"theta", "phi", "p", "q", "xi", "v_x", "v_y", "v_z"};
99   outname = {"H_dot", "theta", "phi", "psi_dot", "p", "q"};
100
101   sys = ss (a0, b0, c0, d0, "inname", inname, "stname", stname, "outname", outname);
102
103 endfunction