Update analysis

This commit is contained in:
2019-03-26 14:47:27 +01:00
parent 489a163006
commit 719099b7ca
95 changed files with 10812 additions and 3728 deletions

21
matlab/control.m Normal file
View File

@@ -0,0 +1,21 @@
%% Controller
s = tf('s');
K = 4.5724e11*(s+44.46)/((s+8.127e-08)*(s+0.0002334)*(s+384.9));
%% Open Simulink for Control
open rotating_frame_ctrl.slx
sim rotating_frame_ctrl.slx
%%
figure;
hold on;
plot(sim_out.Time, sim_out.Data(:, 1));
plot(sim_out.Time, sim_out.Data(:, 2));
hold off;
xlabel('Time (s)');
ylabel('Displacement (m)');
legend({'Dx', 'Dy'});
exportFig('D_x_y', 'wide-tall');

52
matlab/id_non_rot_frame.m Normal file
View File

@@ -0,0 +1,52 @@
%% Open Simulink file
open rotating_frame.slx
%% Options for Linearized
options = linearizeOptions;
options.SampleTime = 0;
%% Name of the Simulink File
mdl = 'rotating_frame';
%% Input/Output definition
io(1) = linio([mdl, '/fx'], 1, 'input');
io(2) = linio([mdl, '/fy'], 1, 'input');
io(3) = linio([mdl, '/dx'], 1, 'output');
io(4) = linio([mdl, '/dy'], 1, 'output');
%% Run the linearization
angle_e = 0; rot_speed = 0;
G = linearize(mdl, io, 0);
%% Input/Output names
G.InputName = {'Fx', 'Fy'};
G.OutputName = {'Dx', 'Dy'};
%% Run the linearization
angle_e = 0; rot_speed = 2*pi;
Gr = linearize(mdl, io, 0);
%% Input/Output names
Gr.InputName = {'Fx', 'Fy'};
Gr.OutputName = {'Dx', 'Dy'};
%% Run the linearization
angle_e = 1*2*pi/180; rot_speed = 2*pi;
Ge = linearize(mdl, io, 0);
%% Input/Output names
Ge.InputName = {'Fx', 'Fy'};
Ge.OutputName = {'Dx', 'Dy'};
%%
f = figure('visible', 'off');
bode(G);
exportFig('G_x_y', 'wide-tall');
close(f);
figure;
bode(Ge);
% exportFig('G_x_y_e', 'normal-normal');

44
matlab/id_rot_fix.m Normal file
View File

@@ -0,0 +1,44 @@
%% Open Simulink file
open rotating_frame.slx
%% Options for Linearized
options = linearizeOptions;
options.SampleTime = 0;
%% Name of the Simulink File
mdl = 'rotating_frame';
%% Input/Output definition
io(1) = linio([mdl, '/fu'], 1, 'input');
io(2) = linio([mdl, '/fv'], 1, 'input');
io(3) = linio([mdl, '/dx'], 1, 'output');
io(4) = linio([mdl, '/dy'], 1, 'output');
%% Run the linearization
rot_speed = 2*pi;
G = linearize(mdl, io, 0.0);
%% Input/Output names
G.InputName = {'Fu', 'Fv'};
G.OutputName = {'Dx', 'Dy'};
%% Run the linearization
G1 = linearize(mdl, io, 0.4);
%% Input/Output names
G1.InputName = {'Fu', 'Fv'};
G1.OutputName = {'Dx', 'Dy'};
%% Run the linearization
G2 = linearize(mdl, io, 0.8);
%% Input/Output names
G2.InputName = {'Fu', 'Fv'};
G2.OutputName = {'Dx', 'Dy'};
figure;
bode(G, G1, G2);
exportFig('G_u_v_to_x_y', 'wide-tall');

46
matlab/identification.m Normal file
View File

@@ -0,0 +1,46 @@
%% Open Simulink file
open rotating_frame.slx
%% Options for Linearized
options = linearizeOptions;
options.SampleTime = 0;
%% Name of the Simulink File
mdl = 'rotating_frame';
%% Input/Output definition
io(1) = linio([mdl, '/fu'], 1, 'input');
io(2) = linio([mdl, '/fv'], 1, 'input');
io(3) = linio([mdl, '/du'], 1, 'output');
io(4) = linio([mdl, '/dv'], 1, 'output');
%% Run the linearization
rot_speed = 0;
G = linearize(mdl, io, 0.0);
%% Input/Output names
G.InputName = {'Fu', 'Fv'};
G.OutputName = {'Du', 'Dv'};
%% Run the linearization
rot_speed = 2*pi/60;
G1 = linearize(mdl, io, 0.0);
%% Input/Output names
G1.InputName = {'Fu', 'Fv'};
G1.OutputName = {'Du', 'Dv'};
%% Run the linearization
rot_speed = 2*pi;
G2 = linearize(mdl, io, 0.0);
%% Input/Output names
G2.InputName = {'Fu', 'Fv'};
G2.OutputName = {'Du', 'Dv'};
figure;
bode(G, G1, G2);
legend({'$\omega = 0$', '$\omega = 2pi/60$', '$\omega = 2pi$'})
exportFig('G_u_v', 'normal-normal');