Skip to content
Snippets Groups Projects
Commit 76738aa1 authored by JuanPi Carbajal's avatar JuanPi Carbajal
Browse files

rename experiment

parent 639c63b3
Branches
No related tags found
No related merge requests found
......@@ -4,7 +4,7 @@
## Measured Veriables
Rotational speed of the turbine: f [rad/s]
Rotational speed of the turbine: f [Hz]
Voltage in the power supply: U [Volts]
Current in the power supply: I [Amps]
Wind generator power index: P [%]
......
......@@ -19,64 +19,103 @@
## Script to preprocess measured data
#
## Friction
## Load Friction
# Torque due to friction as indentified independently, see |s_friction.m| for
# the generation of the file used here
fname_F = 'tauF.dat';
load (fname_F)
## Load pre-processed data
# The raw data, collected with |s_rawdata.m|, is pre-processed in the script
# |s_preprocess_rawdata.m|.
fname_vp = @(w) sprintf ("vp%s.dat", strrep (num2str (w), '.', '_'));
fname_raw = @(w) sprintf ("rawdata_vp%s.dat", strrep (num2str (w), '.', '_'));
##
# We load the data form the two wind speeds we used
vp = [12.5, 15];
A = 2 * radiusR * 0.7;
for i=1:2
load (fname_raw(vp(i)),'Temp', 'Hum', 'Pres','v','v_std');
load (fname_vp(vp(i)));
v_w{i} = v;
tsr{i} = vtR_data / v_w{i};
#tsr_std{i} = vtR_data_std / v;
tau{i} = - tauR - tauF(omegaR);
#tau_std{i} = tauR_std;
A = 2 * radiusR * 0.7;
A_std_rel = 0.01 + 0.01;
v_w{i} = v;
v_w_std_rel = v_std ./ v_w{i};
vt{i} = vtR_data;
vt_std{i} = vtR_data_std;
tsr{i} = vt{i} / v_w{i};
tsr_std{i} = (vt_std{i} ./ vt{i} + v_w_std_rel) .* tsr{i};
load (fname_raw(vp(i)),'Temp', 'Hum', 'Pres');
rho{i} = air_density (Temp, Pres, Hum);
tau{i} = - tauR - tauF(omegaR);
tau_std{i} = tauR_std; % + tauF_std; # TODO
Pw{i} = 0.5 * A * v^3 * rho{i};
C_p{i} = tau{i} .* omegaR ./ Pw{i};
rho{i} = air_density (Temp, Pres, Hum);
Pw{i} = 0.5 * A * v^3 * rho{i};
Pw_std_rel = 3 * v_w_std_rel + A_std_rel;
Cp{i} = tau{i} .* omegaR ./ Pw{i};
Cp_std{i} = (tau_std{i} ./ tau{i} + omegaR_std ./ omegaR + Pw_std_rel) .* Cp{i};
endfor
## Plots
#
txt_label = @(v) {sprintf('%.1f m/s down',v), sprintf('%.1f m/s up',v)};
figure (1)
clf
#h1 = errorbar (tsr{1}, tau{1}, tsr_std{1}, tau_std{1}, '~>o');
h1 = plot (tsr{1}, tau{1}, 'o');
h1 = errorbar (vt{1}, tau{1}, vt_std{1}, tau_std{1}, '~>o');
hold on
#h2 = errorbar (tsr{2}, tau{2}, tsr_std{2}, tau_std{2}, '~>^');
h2 = plot (tsr{2}, tau{2}, '^');
h2 = errorbar (vt{2}, tau{2}, vt_std{2}, tau_std{2}, '~>^');
hold off
axis tight
xlabel ('TSR [a.u.]')
xlabel ('Tangential speed rotor [m/s]')
ylabel ('\tau_W [Nm]')
lbl = horzcat (txt_label(v_w{1}), txt_label(v_w{2}));
legend ([h1; h2], lbl, ...
'Location', 'NorthOutside','Orientation', 'horizontal');
set (h1(1), 'color', get (h2(1), 'color'))
set (h1(2), 'color', get (h2(2), 'color'))
legend ([h1; h2], lbl, ...
'Location', 'NorthOutside','Orientation', 'horizontal');
print ('-dpng', 'TauW_vs_vt.png');
figure (2)
clf
h1 = plot (tsr{1}, C_p{1}, 'o');
h1 = errorbar (tsr{1}, Cp{1}, tsr_std{1}, Cp_std{1}, '~>o');
hold on
h2 = plot (tsr{2}, C_p{2}, '^');
h2 = errorbar (tsr{2}, Cp{2}, tsr_std{2}, Cp_std{2}, '~>^');
hold off
axis tight
xlabel ('TSR [a.u.]')
ylabel ('C_p [a.u.]')
lbl = horzcat (txt_label(v_w{1}), txt_label(v_w{2}));
legend ([h1; h2], lbl, ...
'Location', 'NorthOutside','Orientation', 'horizontal');
set (h1(1), 'color', get (h2(1), 'color'))
set (h1(2), 'color', get (h2(2), 'color'))
legend ([h1; h2], lbl, ...
'Location', 'NorthOutside','Orientation', 'horizontal');
print ('-dpng', 'Cp_vs_tsr.png');
figure (3)
y = cell2mat (Cp)(:);
x = cell2mat (tsr)(:);
sig =@(p,t) 0.5 + 0.5 * tanh (p(1) * (t - p(2)));
model = @(p,t,s=0) p(3) * sig(p(1:2),t) .* (1 - sig([p(1) p(2)+s], t));
p0 = [1; 2; 0.2];
xt = linspace (0, 6, 5e2).';
s = [0 logspace(log10(1),log10(5),5)];
for i=1:length(s)
p = sqp (p0, @(l)sumsq(y - model(l,x,s(i))));
yt(:,i) = model (p, xt, s(i));
endfor
clf
h = plot (x, y, 'o', xt, yt, '--');
hold off
axis tight
xlabel ('TSR [a.u.]')
ylabel ('C_p [a.u.]')
print ('-dpng', 'Cp_vs_tsr_fit.png');
......@@ -41,20 +41,20 @@ if ~exist ('vtR', 'var')
# Error of the mean from interval
# Measurements are consider 0.99 confidence intervals
coeff = 1 ./ erfinv (0.99);
lu2std = @(LU) squeeze (std (LU, 0, 2)) * coeff;
lu2std = @(LU) squeeze (std (LU, 0, 2)) * coeff / sqrt (2);
##
# Motor/rotor torque and rotation
[TM, WM, TR, WR] = maxonRE50_model (U, I, gearGP52);
[TMlu, WMlu, TRlu, WRlu] = maxonRE50_model (U, lu2std(I_lu), gearGP52);
[TMlu, WMlu, TRlu, WRlu] = maxonRE50_model (U, I_lu, gearGP52);
tauM = TM; tauM_std = TMlu;
tauR = TR; tauR_std = TRlu;
omegaM = WM; omegaM_std = WMlu;
omegaR = WR; omegaR_std = WRlu;
tauM = TM; tauM_std = lu2std (TMlu);
tauR = TR; tauR_std = lu2std (TRlu);
omegaM = WM; omegaM_std = lu2std (WMlu);
omegaR = WR; omegaR_std = lu2std (WRlu);
##
# Segmentation of measured data, see s_segment_omega.m
# Segmentation of measured data, see |s_segment_omega.m|
fn = sprintf ("freq_vp%s.dat", strrep (num2str (vp), '.', '_'));
load (fn,'freqR_data', 'freqR_data_std');
omegaR_data = 2 * pi * freqR_data;
......@@ -95,8 +95,9 @@ if ~exist ('vtR', 'var')
h = errorbar (fm, fe, errf, fe_err*ones(size(errf)),'~>o');
ff = [fm(:) fe(:)]; ff(!isfinite(ff(:,2)),:) = [];
vax = [min(ff(:)) max(ff(:))];
axis (vax([1 2 1 2]));
line (vax, vax);
vax = vax([1 2 1 2]);
axis (vax);
line (vax(1:2), vax(3:4));
xlabel ('Freq. motor (model) [Hz]')
ylabel ('Freq. encoder (measured) [Hz]')
legend (h, txt_label(v), ...
......@@ -111,8 +112,12 @@ endif
ferr = fe_err * ones(size(fm));
h = errorbar (fm, fe, ferr, ferr,'~>o');
axis tight
vax = axis ();
if exist ('vtR', 'var')
axis tight;
vax = axis ();
else
axis (vax);
endif
line (vax(1:2), vax(3:4));
xlabel ('Freq. motor (model) [Hz]')
ylabel ('Freq. encoder (measured) [Hz]')
......@@ -154,5 +159,6 @@ ylabel ('\tau_M [Nm]')
legend (h, txt_label(v), ...
'Location', 'NorthOutside','Orientation', 'horizontal');
save (fname(vp), vars{:});
fn = fname (vp);
save (fn, vars{:});
printf ("Saved to %s\n", fn); fflush (stdout);
......@@ -19,7 +19,7 @@
## Script to collect and save measured data
#
fname = @(w) sprintf ("rawdata_vp%s.dat", strrep (num2str (w), '.', '_'));
vars = {'vp', 'v', 'U', 'I', 'I_lu', 'fe', 'fe_err', 'Temp', 'Pres', 'Hum'};
vars = {'vp', 'v', 'v_std', 'U', 'I', 'I_lu', 'fe', 'fe_err', 'Temp', 'Pres', 'Hum'};
## Voltage ramp up and down
# Last index is down (=1) and up (=2)
......@@ -31,6 +31,7 @@ U(:,2) = flipud (U(:,1));
# Wind speed from anemometer @ 12.5 %
vp = 12.5;
v = 5.0; # m/s
v_std = 0.05;
##
# Current @ 12.5 %
......@@ -54,12 +55,15 @@ Pres = 963.0e2 * [1 1]; #Pa
Hum = [0.45 0.47];
Temp = [14.9 13.5]; #C
save (fname (vp), vars{:});
fn = fname (vp);
save (fn, vars{:});
printf ("Saved to %s\n", fn); fflush (stdout);
## Wind power 15 %
# Wind speed from anemometer @ 15 %
vp = 15;
v = 6.0; # m/s
v_std = 0.05;
##
# Current @ 15 %
......@@ -84,4 +88,6 @@ Pres = 963.0e2 * [1 1]; #Pa
Hum = [0.49 0.51];
Temp = [12.2 11.4]; #C
save (fname (vp), vars{:});
fn = fname (vp);
save (fn, vars{:});
printf ("Saved to %s\n", fn); fflush (stdout);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment