-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathera_backup.m
86 lines (70 loc) · 2.5 KB
/
era_backup.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
function [A,B,C,emac_era,msv_era] = era
%
% ERA
%
% [A,B,C,emac_era,msv_era] = era
%
% Applies the Eigensystem Realization Algorithm (ERA) to the
% impulse response from the FRF matrix 'G'
%
% nx is the number of states to use (2 states per mode)
% q and d are the ERA Hankel parameters
%
% Returns the state-space model matrics 'A,B,C,D' and the
% 'revised' sample rate fs_out (due to zero-padding)
%
% Also returns the observability matrix 'V' and the
% controllability matrix 'W'
%
% If nx < 0, will plot Hankel singular values and
% prompt for a cut-off
% Reference for ERA: "An Eigensystem Realization Algorithm for
% Modal Parameter Identification and Model Reduction,"
% Juang, J-N, and Pappa, R.S., Journal of Guidance, Control, and
% Dynamics, Vol. 8, No. 5, pp. 620-627, 1985.
% Version SWD970908
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This matlab source code was originally %
% developed as part of "DIAMOND" at %
% Los Alamos National Laboratory. It may %
% be copied, modified, and distributed in %
% any form, provided: %
% a) This notice accompanies the files and %
% appears near the top of all source %
% code files. %
% b) No payment or commercial services are %
% received in exchange for the code. %
% %
% Original copyright is reserved by the %
% Regents of the University of California, %
% in addition to Scott W. Doebling, Phillip %
% J. Cornwell, Erik G. Straser, and Charles %
% R. Farrar. %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
global MODES DATA
% Define variables and allocate space for matrices
fprintf(1,' Forming Hankel matrices...')
makehank
fprintf(1,'done\n')
nresp = size(DATA{1}.respDOF,1);
nref = size(DATA{1}.refDOF,1);
nx = MODES.eraparam.nx;
U0N = MODES.eraparam.U0(:,1:nx);
S0N = MODES.eraparam.S0(1:nx,1:nx);
V0N = MODES.eraparam.V0(:,1:nx);
% Form A, B, C, D, V, W
disp('Forming A,B,C,D...')
SNsqrt = sqrt(S0N);
SNinv = sqrt(inv(S0N));
A = SNinv * U0N' * MODES.eraparam.H1 * V0N * SNinv;
B = SNsqrt * V0N(1:nref,:)';
C = U0N(1:nresp,:) * SNsqrt;
D = shiftdim(MODES.eraparam.Y(1,:,:),1);
V = U0N * SNsqrt;
W = SNsqrt * V0N';
if nargout > 3,
disp('Computing EMAC...')
[emac_era,msv_era] = emaccomp(A,V,W,MODES.eraparam.q,MODES.eraparam.d,MODES.eraparam.fs_out);
end
return