-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtempPostProcessing.m
94 lines (85 loc) · 1.69 KB
/
tempPostProcessing.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
87
88
89
90
91
92
error1 = Err.signals.values;
out1 = out.signals.values;
%%
error2 = Err.signals.values;
out2 = out.signals.values;
time = out.time;
%%
error3 = Err.signals.values;
out3 = out.signals.values;
%%
figure;
plot(time,1e6*error1);
hold on;
plot(time,1e6*error2);
%%
figure;
plot(time,1e6*out1);
hold on;
plot(time,1e6*out2);
%%
figure;
plot(time,1e6*error1);
hold on;
plot(time,1e6*error2);
plot(time,1e6*error3);
%%
figure;
plot(time * 1000,1e6*out1);
hold on;
plot(time * 1000,1e6*out2);
plot(time * 1000,1e6*out3);
xlim([0,20]);
%%
alpha1 = 0.1;
alpha2 = 0.56;
alpha3 = 0.81;
alpha4 = 0.95;
alpha5 = 0.95;
alpha6 = 0.95;
figure;
plot(0:5,[alpha1,alpha2,alpha3,alpha4,alpha5,alpha6])
%%
time = noise.time;
noiseValue = noise.signals.values;
figure;
plot(time,noiseValue,'linewidth',2);
ylabel('\mu m');
xlabel('ʱ¼ä (s)');
grid on;
set(gca,'fontsize',14);
%%
fn = 700;
zeta = 0.06
wn = fn * 2 * pi;
m1 = 5; m2 = 20;
k = wn * wn * m1 * m2 /(m1+m2);
c = 2*zeta*wn*m1 * m2 /(m1+m2);
tempG = tf(1,[c,k]);
Op=bodeoptions;
Op.FreqUnits='Hz';
Op.xlim={[1 500]};
Op.PhaseVisible = 'on';
Op.Grid='on';
figure;
bodeplot(tempG,Op);%%
%%
figure;
subplot(3,1,1);
plot(out.time * 1000,out.signals.values * 1e6,'linewidth',2);
hold on;
plot(out.time * 1000,30 * ones(size(out.time)),'linewidth',1);
xlabel('time (ms)');
ylabel('step response (\mum)');
subplot(3,1,2);
plot(Err.time * 1000,Err.signals.values * 1e6,'linewidth',2);
hold on;
plot(out.time * 1000,zeros(size(out.time)),'linewidth',1);
xlabel('time (ms)');
ylabel('error (\mum)');
subplot(3,1,3);
plot(nonlinearU.time * 1000,nonlinearU.signals.values * 1e6,'linewidth',2);
hold on;
plot(out.time * 1000,zeros(size(out.time)),'linewidth',1);
xlabel('time (ms)');
ylabel('u (\mum)');