Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
ICS
ICS Public
Lecture Files
Commits
6a3bab79
Commit
6a3bab79
authored
May 28, 2021
by
Adwait Datar
Browse files
Gitlab Runner Update from orc-aux-files/master:Correct the folder name for exercises 15_1,15_3,15_4
parent
674268ff
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
93 additions
and
0 deletions
+93
-0
ORC/exercise-files/Exercise_material_SoSe_2021/code/E_15_1_and15_3_and_E_15_4/orc15_1_and_E_15_3_H2.m
...21/code/E_15_1_and15_3_and_E_15_4/orc15_1_and_E_15_3_H2.m
+36
-0
ORC/exercise-files/Exercise_material_SoSe_2021/code/E_15_1_and15_3_and_E_15_4/orc15_1_and_E_15_4_Hinf.m
.../code/E_15_1_and15_3_and_E_15_4/orc15_1_and_E_15_4_Hinf.m
+57
-0
ORC/exercise-files/Exercise_material_SoSe_2021/code/E_15_1_and15_3_and_E_15_4/orc15_design2.mat
...oSe_2021/code/E_15_1_and15_3_and_E_15_4/orc15_design2.mat
+0
-0
ORC/exercise-files/Exercise_material_SoSe_2021/code/E_15_3_andE_15_4.zip
...les/Exercise_material_SoSe_2021/code/E_15_3_andE_15_4.zip
+0
-0
No files found.
ORC/exercise-files/Exercise_material_SoSe_2021/code/E_15_1_and15_3_and_E_15_4/orc15_1_and_E_15_3_H2.m
0 → 100644
View file @
6a3bab79
% ORC 15.3 :: H2 norm computation
%
% TUHH :: Institut for Control Systems :: Optimal and Robust Control
% Last update: 20.05.2009
load
orc15_design2
CL2
Gyr2
T
=
Gyr2
;
%% Using the gramians
% with observability gramian
Wo
=
gram
(
T
,
'o'
);
h2gramo
=
sqrt
(
trace
(
T
.
B
'*
Wo
*
T
.
B
)
)
% with the controllability gramian
Wc
=
gram
(
T
,
'c'
);
h2gramc
=
sqrt
(
trace
(
T
.
C
*
Wc
*
T
.
C
'
)
)
%% Using the inpulse response
T_step
=
0.001
;
t
=
0
:
T_step
:
2
;
[
g
,
t
]
=
impulse
(
T
,
t
);
Sum
=
0
;
for
i
=
1
:
length
(
t
)
X
(:,:)
=
g
(
i
,:,:);
Sum
=
Sum
+
trace
(
X
'*
X
);
end
h2imp
=
sqrt
(
Sum
*
T_step
)
%% with the norm function
h2norm
=
norm
(
T
,
2
)
hinfnorm
=
norm
(
T
,
inf
)
ORC/exercise-files/Exercise_material_SoSe_2021/code/E_15_1_and15_3_and_E_15_4/orc15_1_and_E_15_4_Hinf.m
0 → 100644
View file @
6a3bab79
% ORC 15.4 :: H-infinity norm calculation
%
% TUHH :: Institut for Control Systems :: Optimal and Robust Control
% Last update: 24.05.2016
load
orc15_design2
Gyr2
T
=
Gyr2
;
[
A
,
B
,
C
,
D
]
=
ssdata
(
T
);
%% Using iterations over gamma
eigtol
=
1e-6
;
% tic
for
gamma
=
5
:
-
0.01
:
0
M
=
[
A
1
/
gamma
*
B
*
B
'
-
1
/
gamma
*
C
'*C -A'
];
if
min
(
abs
(
real
(
eig
(
M
))))
<
eigtol
% check if the minimum real eig.
% value is close to the imag. axis
break
end
end
hinf_iter
=
gamma
% toc
%% Or using bisections over gamma
g_max
=
100
;
g_min
=
0.01
;
g_tol
=
0.1
;
eigtol
=
1e-6
;
% tic
while
g_max
-
g_min
>
g_tol
figure
(
1
);
clf
;
sigma
(
T
);
hold
on
;
line
([
1e-1
,
1e4
],
20
*
log10
([
g_max
,
g_max
]),
'Color'
,
[
0.0
0.8
0.0
]);
line
([
1e-1
,
1e4
],
20
*
log10
([
g_min
,
g_min
]),
'Color'
,
[
0.8
0.0
0.0
]);
pause
;
gamma
=
(
g_max
+
g_min
)/
2
;
M
=
[
A
1
/
gamma
*
B
*
B
'
-
1
/
gamma
*
C
'*C -A'
];
if
min
(
abs
(
real
(
eig
(
M
))))
<
eigtol
g_min
=
gamma
;
% there is imag. eigval. ==> Hinf > gamma
else
g_max
=
gamma
;
% there is no imag. eigenval ==> Hinf < gamma
end
end
hinf_bis
=
gamma
% toc
%% Using the singular value plot and the norm function
sigma
(
T
);
dta
=
ginput
(
1
);
hinf_sig
=
10
^
(
dta
(
2
)/
20
)
% convert from log scala
hinf_norm
=
norm
(
T
,
inf
)
ORC/exercise-files/Exercise_material_SoSe_2021/code/E_15_1_and15_3_and_E_15_4/orc15_design2.mat
0 → 100644
View file @
6a3bab79
File added
ORC/exercise-files/Exercise_material_SoSe_2021/code/E_15_3_andE_15_4.zip
0 → 100644
View file @
6a3bab79
File added
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment