7017
|
1 ## Copyright (C) 1997, 2000, 2004, 2005, 2006, 2007 Kai P. Mueller |
3431
|
2 ## |
|
3 ## This file is part of Octave. |
|
4 ## |
|
5 ## Octave is free software; you can redistribute it and/or modify it |
7016
|
6 ## under the terms of the GNU General Public License as published by |
|
7 ## the Free Software Foundation; either version 3 of the License, or (at |
|
8 ## your option) any later version. |
3431
|
9 ## |
7016
|
10 ## Octave is distributed in the hope that it will be useful, but |
|
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
13 ## General Public License for more details. |
3431
|
14 ## |
|
15 ## You should have received a copy of the GNU General Public License |
7016
|
16 ## along with Octave; see the file COPYING. If not, see |
|
17 ## <http://www.gnu.org/licenses/>. |
3431
|
18 |
|
19 ## -*- texinfo -*- |
3500
|
20 ## @deftypefn {Function File} {} ord2 (@var{nfreq}, @var{damp}, @var{gain}) |
3431
|
21 ## Creates a continuous 2nd order system with parameters: |
5016
|
22 ## |
3431
|
23 ## @strong{Inputs} |
|
24 ## @table @var |
3439
|
25 ## @item nfreq |
|
26 ## natural frequency [Hz]. (not in rad/s) |
|
27 ## @item damp |
|
28 ## damping coefficient |
|
29 ## @item gain |
|
30 ## dc-gain |
3431
|
31 ## This is steady state value only for damp > 0. |
7001
|
32 ## gain is assumed to be 1.0 if omitted. |
3431
|
33 ## @end table |
5016
|
34 ## |
|
35 ## @strong{Output} |
|
36 ## @table @var |
|
37 ## @item outsys |
|
38 ## system data structure has representation with |
|
39 ## @ifinfo |
|
40 ## @math{w = 2 * pi * nfreq}: |
|
41 ## @end ifinfo |
|
42 ## @iftex |
|
43 ## @tex |
|
44 ## $ w = 2 \pi f $: |
|
45 ## @end tex |
|
46 ## @end iftex |
3431
|
47 ## @example |
5016
|
48 ## @group |
3431
|
49 ## / \ |
|
50 ## | / -2w*damp -w \ / w \ | |
|
51 ## G = | | |, | |, [ 0 gain ], 0 | |
|
52 ## | \ w 0 / \ 0 / | |
|
53 ## \ / |
5016
|
54 ## @end group |
3431
|
55 ## @end example |
5016
|
56 ## @end table |
|
57 ## @strong{See also} @command{jet707} (@acronym{MIMO} example, Boeing 707-321 |
3431
|
58 ## aircraft model) |
|
59 ## @end deftypefn |
|
60 |
|
61 ## Author: Kai P. Mueller <mueller@ifr.ing.tu-bs.de> |
|
62 ## Created: September 28, 1997 |
|
63 |
|
64 function outsys = ord2 (nfreq, damp, gain) |
|
65 |
|
66 ## Updates |
|
67 |
7133
|
68 if (nargin == 2 || nargin == 3) |
|
69 if (nargin == 2) |
|
70 gain = 1.0; |
|
71 endif |
|
72 w = 2.0 * pi * nfreq; |
|
73 outsys = ss ([-2.0*w*damp, -w; w, 0], [w; 0], [0, gain]); |
|
74 else |
6046
|
75 print_usage (); |
3431
|
76 endif |
|
77 |
|
78 endfunction |