• No results found

Appendix B – Octave code

N/A
N/A
Protected

Academic year: 2021

Share "Appendix B – Octave code"

Copied!
5
0
0

Loading.... (view fulltext now)

Full text

(1)

Appendix B – Octave code

% effekt.m

% Power and efficiency calculations for Absolicon X10 % 2009-01-05 Johannes Morfeldt

% The temperture intervals of the receiver. Use the two first lines if the temperatures should be specified manually when the program is started.

% T_0 = input('T_amb i C:'); % T_1 = input('T_R i C:'); T_0 = 25;

T_1 = 120;

% The choice of coating of the receiver is specified here. global T_amb AB11 AB10

fprintf('Select coating\n 1 = Original\n 2 = Solkote\n 3 = Suncolor\n 4 = Skultuna\n 5 = SolMax\n') AB10 = input('Your choice:');

T_R = (T_0 + 273):2:(T_1 + 273); T_amb = T_R(1);

% The effekt.m program calls the function losning.m, where the different initial conditions are specified in the file indata.m and the equations in func.m is solved through iteration. This is done for three different setups, the first is with an aluminum plate on top of the receiver, the second simulates an aluminum plate covering the top and the bottom of the receiver and the third and last case simulates the original setup of the receiver.

for AB11 = [1,2,3] switch AB11 case{1} [T_r1 , T_g1 , T_in1 , P1] = losning(T_R); case{2} [T_r2 , T_g2 , T_in2 , P2] = losning(T_R); case{3} [T_r3 , T_g3 , T_in3 , P3] = losning(T_R); endswitch endfor

% The global command is used in all the files used by this program to share constants.

global T_atm I_s alfa_ghigh alfa_rhigh alfa_PVhigh alfa_lamhigh alfa_tophigh ro_rhigh tau_ghigh e_PVhigh e_lamhigh e_tophigh e_colhigh e_toplow ro_rlow tau_glow alfa_PVlow alfa_lamlow alfa_toplow alfa_collow e_rblow e_rlow e_glow alfa_glow alfa_rlow sigma A_g A_PV A_col A_lam A_top A_r A_htop F_col h_IN h_UT A_hcol h_glaz

% The efficiency of the PV-cell is 16 % at 25 C and is then lowered with 0.4 % per each increased centigrade.

P_PV = I_s * tau_ghigh * ro_rhigh * (A_g - A_htop) * 0.16 * (1 - 0.004 * (T_R - 298)); t_a = (T_R - T_amb) / I_s;

IN = (tau_ghigh + alfa_ghigh) * I_s * A_g; IN_ = IN/A_g;

% Calculations of the effeciency of the solar collector and power loss data in the collector as a whole.

% The first case

UT_con_g1 = h_UT * A_g * (T_g1 - T_amb); UT_con_r1 = h_UT * A_r * (T_r1 - T_amb);

UT_rad_g1 = e_glow * A_g * sigma * (T_g1.^4 - T_atm^4); UT_rad_r1 = e_rblow * A_r * sigma * (T_r1.^4 - T_amb^4); P_th1 = P1 - P_PV;

% Preparations of power loss data. UT_11 = (UT_con_g1/A_g)'; UT_12 = (UT_con_r1/A_g)'; UT_13 = (UT_rad_g1/A_g)'; UT_14 = (UT_rad_r1/A_g)'; P11 = (P1/A_g)'; P13 = (P_th1/A_g)'; n_a = P1 / (A_g * I_s); poly = polyfit(t_a , n_a , 2);

poly1 = [poly(3),-poly(2),-poly(1)/I_s]; p1 = poly1';

fprintf('\nAluminum cover on the top of the receiver\n Optical Efficiency: %5.4f\n Efficiency value (first degree): %5.4f\n Efficiency value (second degree): %5.4f\n', poly1)

(2)

% The second case

UT_con_g2 = h_UT * A_g * (T_g2 - T_amb); UT_con_r2 = h_UT * A_r * (T_r2 - T_amb);

UT_rad_g2 = e_glow * A_g * sigma * (T_g2.^4 - T_atm^4); UT_rad_r2 = e_rblow * A_r * sigma * (T_r2.^4 - T_amb^4); P_th2 = P2 - P_PV;

% Preparations of power loss data. UT_21 = (UT_con_g2/A_g)'; UT_22 = (UT_con_r2/A_g)'; UT_23 = (UT_rad_g2/A_g)'; UT_24 = (UT_rad_r2/A_g)'; P21 = (P2/A_g)'; P23 = (P_th2/A_g)'; n_a = P2 / (A_g * I_s); poly = polyfit(t_a , n_a , 2);

poly2 = [poly(3),-poly(2),-poly(1)/I_s]; p2 = poly2';

fprintf('\nAluminum cover on the top and on the bottom of the receiver\n Optical Efficiency: %5.4f\ n Efficiency value (first degree): %5.4f\n Efficiency value (second degree): %5.4f\n', poly2) % The third case

UT_con_g3 = h_UT * A_g * (T_g3 - T_amb); UT_con_r3 = h_UT * A_r * (T_r3 - T_amb);

UT_rad_g3 = e_glow * A_g * sigma * (T_g3.^4 - T_atm^4); UT_rad_r3 = e_rblow * A_r * sigma * (T_r3.^4 - T_amb^4); P_th3 = P3 - P_PV;

% Preparations of power loss data. UT_31 = (UT_con_g3/A_g)'; UT_32 = (UT_con_r3/A_g)'; UT_33 = (UT_rad_g3/A_g)'; UT_34 = (UT_rad_r3/A_g)'; P31 = (P3/A_g)'; P33 = (P_th3/A_g)'; n_a = P3 / (A_g * I_s); poly = polyfit(t_a , n_a , 2);

poly3 = [poly(3),-poly(2),-poly(1)/I_s]; p3 = poly3';

fprintf('\nOriginal setup of the receiver\n Optical Efficiency: %5.4f\n Efficiency value (first degree): %5.4f\n Efficiency value (second degree): %5.4f\n', poly3)

% Calculation of power loss data in the receiver. % The first case

% Case specific constants

a9 = e_tophigh * A_htop + ro_rlow * (e_lamhigh * A_lam + e_tophigh * A_lam + 2 * e_PVhigh * A_PV); b9 = e_colhigh * A_col * (1-F_col) + e_lamhigh * A_lam + e_tophigh * A_lam + 2 * e_PVhigh * A_PV; c9 = A_htop; d9 = e_tophigh * A_htop;

% Power loss data

IN_R1 = alfa_PVhigh * tau_ghigh * ro_rhigh * I_s * (A_g - A_htop) + alfa_tophigh * tau_ghigh * I_s * c9;

UT_sida_c1 = 2 * h_IN * (A_PV + A_lam) * (T_R - T_in1); UT_top_c1 = h_glaz * A_htop * (T_R-T_g1);

UT_sida_r1 = sigma * (T_R.^4 - e_rlow * T_r1.^4 - e_glow * ro_rlow * T_g1.^4) * b9; UT_top_r1 = sigma * T_R.^4 * d9 - alfa_toplow * e_glow * sigma * T_g1.^4 * c9; P_R1 = IN_R1 - UT_top_r1 - UT_sida_r1 - UT_sida_c1 - UT_top_c1;

% Preparations of power loss data. IN1 = (IN_R1/A_g)'; UT_15 = (UT_sida_c1/A_g)'; UT_16 = (UT_top_c1/A_g)'; UT_17 = (UT_sida_r1/A_g)'; UT_18 = (UT_top_r1/A_g)'; P12 = (P_R1/A_g)'; % The second case

% Case specific constants

(3)

b9 = 2 * e_tophigh * A_lam + 2 * e_PVhigh * A_PV + e_tophigh * A_hcol; c9 = A_htop; d9 = e_tophigh * A_htop;

% Power loss data

IN_R2 = alfa_PVhigh * tau_ghigh * ro_rhigh * I_s * (A_g - A_htop) + alfa_tophigh * tau_ghigh * I_s * c9;

UT_sida_c2 = 2 * h_IN * (A_PV + A_lam) * (T_R - T_in2); UT_top_c2 = h_glaz * A_htop * (T_R-T_g2);

UT_sida_r2 = sigma * (T_R.^4 - e_rlow * T_r2.^4 - e_glow * ro_rlow * T_g2.^4) * b9; UT_top_r2 = sigma * T_R.^4 * d9 - alfa_toplow * e_glow * sigma * T_g2.^4 * c9; P_R2 = IN_R2 - UT_top_r2 - UT_sida_r2 - UT_sida_c2 - UT_top_c2;

% Preparations of power loss data. IN2 = (IN_R2/A_g)'; UT_25 = (UT_sida_c2/A_g)'; UT_26 = (UT_top_c2/A_g)'; UT_27 = (UT_sida_r2/A_g)'; UT_28 = (UT_top_r2/A_g)'; P22 = (P_R2/A_g)'; % The third case

% Case specific constants

a9 = 2 * e_tophigh * A_top + e_colhigh * A_col * (1-F_col) + 2 * ro_rlow * (e_lamhigh * A_lam + e_PVhigh * A_PV); b9 = e_colhigh * A_col * (1-F_col) + 2 * e_lamhigh * A_lam + 2 * e_PVhigh * A_PV; c9 = 2 * A_top; d9 = 2 * e_tophigh * A_top + e_colhigh * A_col * (1-F_col);

% Power loss data

IN_R3 = alfa_PVhigh * tau_ghigh * ro_rhigh * I_s * (A_g - A_htop) + alfa_tophigh * tau_ghigh * I_s * c9;

UT_sida_c3 = 2 * h_IN * (A_PV + A_lam) * (T_R - T_in3); UT_top_c3 = h_glaz * A_htop * (T_R-T_g3);

UT_sida_r3 = sigma * (T_R.^4 - e_rlow * T_r3.^4 - e_glow * ro_rlow * T_g3.^4) * b9; UT_top_r3 = sigma * T_R.^4 * d9 - alfa_toplow * e_glow * sigma * T_g3.^4 * c9; P_R3 = IN_R3 - UT_top_r3 - UT_sida_r3 - UT_sida_c3 - UT_top_c3;

% Preparations of power loss data. IN3 = (IN_R3/A_g)'; UT_35 = (UT_sida_c3/A_g)'; UT_36 = (UT_top_c3/A_g)'; UT_37 = (UT_sida_r3/A_g)'; UT_38 = (UT_top_r3/A_g)'; P32 = (P_R3/A_g)';

% The data from the different cases are saved to the file effekt.data.

save -text uteffekt.data p1 p2 p3 I_s IN_ IN1 IN2 IN3 UT_1* P11 P12 P13 UT_2* P21 P22 P23 UT_3* P31 P32 P33

% losning.m

% Equation solver for effekt.m % 2009-01-05 Johannes Morfeldt

% This function solves the equations in func.m with the constants given in indata.m. The data given to this function is the receiver temperatures T_R and the function then returns the temperatures; T_r, T_g, T_in and the output power; P.

function [T_r , T_g , T_in, P] = losning(t) n = 1; indata; global T_R for T_R = t [x,m] = fsolve('func',[300 ; 300 ; 300 ; 300]); T_r(n) = x(1); T_g(n) = x(2); T_in(n) = x(3); P(n) = x(4); n = n + 1; endfor endfunction % indata.m

% This program specifies the conditions of the Absolicon X10. % 2008-11-17 Johannes Morfeldt

global a1 b1 c1 d1 e1 f1 g1 h1 i1 j1 T_atm T_amb I_s alfa_ghigh alfa_rhigh alfa_PVhigh alfa_lamhigh alfa_tophigh ro_rhigh tau_ghigh e_PVhigh e_lamhigh e_tophigh e_colhigh ro_rlow tau_glow alfa_PVlow

(4)

alfa_lamlow alfa_toplow alfa_collow e_rblow e_rlow e_glow e_toplow alfa_glow alfa_rlow sigma A_g A_PV A_col A_lam A_htop A_top A_r A_hcol F_col h_IN AB10 h_UT h_glaz

a1 = 0.03906; b1 = 2; c1 = 1.05; d1 = 0.05328; e1 = 0.01; f1 = sqrt(a1^2 + d1^2); g1 = 0.11; h1 = 0.04; i1 = 0.265; j1 = 0.005; k1 = 1.21; sigma = 5.6704e-8; I_s = 800; T_atm = 298; alfa_ghigh = 0.0599; alfa_rhigh = 0.1286; alfa_PVhigh = 0.9242; alfa_lamhigh = 0.9359; ro_rhigh = 1-0.1286; tau_ghigh = 0.8880; e_PVhigh = 0.9384; e_lamhigh = 0.9354; ro_rlow = 0.1236; alfa_PVlow = 0.9372; alfa_lamlow = 0.9346; e_rblow = 0.7953; e_rlow = 0.8685; e_glow = 0.9957; alfa_glow = e_glow; alfa_rlow = e_rlow; alfa_collow = 0.8385; e_colhigh = 0.8317;

% The heat loss coefficients of convection are specified here. % h_UT = input('Konstant för konvektion ute:');

% h_IN = input('Konstant för konvektion inne:'); h_UT = 15; h_IN = 8; h_glaz = 4.5; % Beroende av beläggning switch AB10 case {1} % Original (AlO):

alfa_toplow = 0.8385; e_tophigh = 0.8317; alfa_tophigh = 0.9156; case {2}

% Solkote:

alfa_toplow = 0.0888; e_tophigh = 0.0957; alfa_tophigh = 0.7995; case {3}

% Suncolor:

alfa_toplow = 0.1241; e_tophigh = 0.1324; alfa_tophigh = 0.7764; case {4}

% Skultuna:

alfa_toplow = 0.2860; e_tophigh = 0.2870; alfa_tophigh = 0.9037; case {5}

% SolMax:

alfa_toplow = 0.0872; e_tophigh = 0.0949; alfa_tophigh = 0.9621; otherwise error('Felaktigt val!') end e_toplow = alfa_toplow; A_g = c1 * b1; A_PV = h1 * b1; A_col = d1 * b1; A_lam = (f1 - h1) * b1; A_top = a1 * b1; A_htop = b1 * (2 * a1 + e1); A_hcol = b1 * (e1 + f1 - h1); a5 = sqrt(c1^2 + 16 * i1^2);

(5)

b5 = c1^2 / (8 * i1); c5 = log(4 * i1 + a5 / c1); A_r = b1 * k1;

g5 = b1 / e1; h5 = d1 / e1;

i5 = g5 * (1 + h5^2)^0.5 * atan(g5/(1 + h5^2)^0.5) - g5 * atan(g5) + h5 * (1 + g5^2)^0.5 * atan(h5/ (1 + g5^2)^0.5) - h5 * atan(h5);

F_col = 2 * e1^2 / (pi * b1 * d1) * (log(((1 + g5^2) * (1 + h5^2) / (1 + g5^2 + h5^2))^0.5) + i5); global a9 b9 c9 d9 AB11

switch AB11 case {1}

% Setup 1 - Plate on top

a9 = e_tophigh * A_htop + ro_rlow * (e_lamhigh * A_lam + e_tophigh * A_lam + 2 * e_PVhigh * A_PV); b9 = e_colhigh * A_col * (1-F_col) + e_lamhigh * A_lam + e_tophigh * A_lam + 2 * e_PVhigh * A_PV; c9 = A_htop; d9 = e_tophigh * A_htop;

case {2}

% Setup 2 - Plate on top and bottom

a9 = e_tophigh * A_htop + ro_rlow * (e_lamhigh * A_lam + e_tophigh * A_lam + 2 * e_PVhigh * A_PV); b9 = 2 * e_tophigh * A_lam + 2 * e_PVhigh * A_PV + e_tophigh * A_hcol; c9 = A_htop; d9 = e_tophigh * A_htop;

case{3}

% Setup 3 - Original

a9 = 2 * e_tophigh * A_top + e_colhigh * A_col * (1-F_col) + 2 * ro_rlow * (e_lamhigh * A_lam + e_PVhigh * A_PV); b9 = e_colhigh * A_col * (1-F_col) + 2 * e_lamhigh * A_lam + 2 * e_PVhigh * A_PV; c9 = 2 * A_top; d9 = 2 * e_tophigh * A_top + e_colhigh * A_col * (1-F_col);

otherwise error('Felaktigt val!') end % func.m % The equations % 2009-01-27 Johannes Morfeldt

% This function describes the four equations mentioned in chapter 7.2 of the report. The only manipulation is that all the terms are moved to the right side of the equations, so they equal zero.

function y = func (x)

global T_atm T_amb I_s alfa_ghigh alfa_rhigh alfa_PVhigh alfa_lamhigh alfa_tophigh ro_rhigh tau_ghigh e_PVhigh e_lamhigh e_tophigh e_colhigh ro_rlow tau_glow alfa_PVlow alfa_lamlow alfa_toplow alfa_collow e_rblow e_rlow e_glow e_toplow alfa_glow alfa_rlow sigma A_g A_PV A_col A_lam A_htop A_top A_r A_hcol F_col h_IN AB10 h_UT h_glaz a9 b9 c9 d9 e9 T_R

y(1) = (tau_ghigh + alfa_ghigh) * I_s * A_g - h_UT * A_r * (x(1)-T_amb) - h_UT * A_g * (x(2)-T_amb) - e_rblow * A_r * sigma * (x(1)^4-T_amb^4) - e_glow * A_g * sigma * (x(2)^4-T_atm^4) - x(4); y(2) = alfa_ghigh * I_s * A_g - h_IN * (A_g-A_htop) * (x(2)-x(3)) - h_glaz * A_htop * (x(2)-T_R) - h_UT * A_g * (x(2)-T_amb) - e_glow * A_g * sigma * x(2)^4 + e_rlow * alfa_glow * (A_g-A_htop) * sigma * x(1)^4 + alfa_glow * sigma * T_R^4 * a9 - e_glow * A_g * sigma * (x(2)^4-T_atm^4);

y(3) = alfa_rhigh * tau_ghigh * I_s * A_r - h_IN * A_r * (x(1)-x(3)) - h_UT * A_r * (x(1)-T_amb) - e_rlow * A_r * sigma * x(1)^4 + e_glow * alfa_rlow * (A_g-A_htop) * sigma * x(2)^4 + alfa_rlow * sigma * T_R^4 * b9 - e_rblow * A_r * sigma * (x(1)^4-T_amb^4);

y(4) = alfa_PVhigh * ro_rhigh * tau_ghigh * I_s * (A_g-A_htop) + alfa_tophigh * tau_ghigh * I_s * c9 - 2 * h_IN * (A_PV + A_lam) * (T_R-x(3)) - h_glaz * A_htop * (T_R-x(2)) - sigma * (T_R^4 - e_rlow * x(1)^4 - e_glow * ro_rlow * x(2)^4) * b9 - sigma * T_R^4 * d9 + alfa_toplow * e_glow * sigma * x(2)^4 * c9 - x(4);

References

Related documents

[r]

Riksrevisionen (2013) menar att det tidigare inte har undersökts i vilken utsträckning riksintressen i praktiken stoppar byggandet av bostäder. Slutsatsen som dras

Dette indebærer at hvis 16:8 blev ophævet, ville man ikke længere kunne dømme en person efter TF 7:4 p.. 11, som siger at en handling er ulovlig, hvis den medfører "hets

Flutist should approach practice of the fourth octave pitches with care, following a ratio of about ten seconds in the first octave for every second spent in the

Ett företag som omfattas av artikel 4 i Europaparlamentets och rådets för- ordning (EG) nr 1606/2002 av den 19 juli 2002 om tillämpning av interna- tionella redovisningsstandarder ska

perennem durationem accederent eae qualitates, quibus individua et definita fubftantia, ab alia quavis differens, oritur, et omnis verse fubftantiae qualitatates et modifica- tiones

Ndzev prdce Diagnostic Tool for Initial Fixation of Acetabular Implant Druh zdv6redn6 prdce bakalStskd diplomovd disertatni I riqoroznl.. Vedouc[ prdce doc, Inq, Luk65

Appendix 1: Ambient Room Temperature Code Appendix 2: Kitchen Stove Temperature Code Appendix 3: Motion Detection Code.. Appendix 4: Alarm Code Appendix 5: