Você está na página 1de 34

The University of Nottingham, Malaysia Campus

School of Mechanical, Materials and Manufacturing Engineering

MM4 ISA Integrated System Analysis Coursework Assignment #2


Title of Work:

A Design of Experiments Exercise


Student Name: Ang Mao Lin Student ID No.: UNIMKL-007815 SID Number: 1 Module Name: Intergrated System Analysis Module Code: MM4 ISA Lecturer: Dr. Woo Ko Choong Tutor: Dr. Wong Kok Cheong Date Due: 13/12/2013

Table 1: SID number and individual details SID Student ID 1 8007815

Surname Ang

Forename Mao Lin

Table 2: Independent variables for present study, including their ranges and corresponding variable names Independent variable Min. Value Max. value Variable name Mean value CO2 concentration (% by mass) 0 1.8 a 0.9 Salt concentration (% by mass) 0 4 b 2 O2 concentration (% by mass) 0.01 0.05 c 0.03 Agitation level (rms shear strain rate, (s-1) ) 0 20 d 10 -2 Sunlight intensity (W/m ) 0 200 e 100 Sum of squares of residuals = sum of squared differences between the actual response, R and the best fit response, Rn, where n is the order of best fit, e.g. n = 3 is cubic best fit. Sum of squares of residuals = (R Rn)2 Task 1 The Screening Experiment Part 1 Task 1(i) To investigate how the independent variable {a} effect on the algae production rates (response, R). Set the independent variable {a} in the range of: Range {a} = [ 0, 0.18, 0.36, 0.54, 0.72, 0.90, 1.08, 1.26, 1.44, 1.62, 1.80] Other variables {b, c, d, e} are set to mean value as shown in Table 2 and keep constant. With noise switched OFF, noise flag {NF} is set to zero in <f_algae.m> matlab function. Result 1(i):

Figure 1: Plot of the response, R (algae growth rate) vs. value of the independent variable {a}

On the same plot, plot the best fit straight line (linear), best fit quadratic line and best fit cubic line. By using Matlab function <polyfit (x , y, n)>, where n is the order of the best fit (e.g. n = 3 for cubic best fit) to get the coefficients of the new equation according the order we demand for. The example of using <polyfit> function to plot the best fit line is show in table below. Table 3: Matlab script (extracted) of <polyfit> function example
a = polyfit (x , y, 2); % get the coefficient for new quadratic best fit equation. y_new = a(1)*(x^2) + a(2)*x + a(3); % the new equation for quadratic best fit. plot(x,y); hold on; % plot the actual Responses. plot(x, y_new); % plot the quadratic best fit Response, same plot with actual Response. hold off;

Figure 2: Plot of actual response, R and together with best fit straight line (linear) R1, best fit quadratic line R2 and best fit cubic line R3 in the same plot, Responses vs. {a}. Report the sum of squares of residuals for each best fit in Task 1(i): Take straight line best fit (linear) as example showing the calculation of sum of squares of residuals:

Sum of squares of residuals = (R Rn)2 Sum of squares of residuals = 22.9441 + 6.0842 + 0.0434 + 3.0211 + 9.9258 + 14.7756 + 13.5814 + 6.7843 + 0.3565 + 5.1691 + 34.5883 Sum of squares of residuals = 117.2738 Table 4: Matlab script (extracted) of example to calculate sum of squares of residuals
R; r_1; SSR1 = sum((R - r_1).^2); % array of actual responses % array of linear best fit responses % sum of squares of residuals for linear

Table 5: Sum of squares of residuals for all 3 best fit Order of best fit Sum of Squares of Residuals Straight line (linear) 117.2738 Quadratic 1.6886 Cubic 0.2329

Task 1(ii) To investigate how the independent variable {b} effect on the algae production rates (response, R). Set the independent variable {b} in the range of: Range {b} = [ 0, 0.4, 0.8, 1.2, 1.6, 2.0, 2.4, 2.8, 3.2, 3.6, 4.0] Other variables {a, c, d, e} are set to mean value as shown in Table 2 and keep constant. With noise switched OFF, noise flag {NF} is set to zero in <f_algae.m> matlab function.

Result 1(ii):

Figure 3: Plot of the response, R (algae growth rate) vs. value of the independent variable {b}

On the same plot, plot the best fit straight line (linear), best fit quadratic line and best fit cubic line by using Matlab function <polyfit (x , y, n)>, where n is the order of the best fit.

Figure 4: Plot of actual response, R and together with best fit straight line (linear) R1, best fit quadratic line R2 and best fit cubic line R3 in the same plot, Responses vs. {b}. Report the sum of squares of residuals for each best fit in Task 1(ii): Table 6: Sum of squares of residuals for all 3 best fit Order of best fit Sum of Squares of Residuals Straight line (linear) 19.6675 Quadratic 2.1903 Cubic 0.0057

Task 1(iii) To investigate how the independent variable {c} effect on the algae production rates (response, R). Set the independent variable {c} in the range of: Range {c} = [ 0.010, 0.014, 0.018, 0.022, 0.026, 0.030, 0.034, 0.038, 0.042, 0.046, 0.050] Other variables {a, b, d, e} are set to mean value as shown in Table 2 and keep constant. With noise switched OFF, noise flag {NF} is set to zero in <f_algae.m> matlab function.

Result 1(iii):

Figure 5: Plot of the response, R (algae growth rate) vs. value of the independent variable {c}

On the same plot, plot the best fit straight line (linear), best fit quadratic line and best fit cubic line by using Matlab function <polyfit (x , y, n)>, where n is the order of the best fit.

Figure 6: Plot of actual response, R and together with best fit straight line (linear) R1, best fit quadratic line R2 and best fit cubic line R3 in the same plot, Responses vs. {c}. Notice that R2 and R3 best line are very close together.

Report the sum of squares of residuals for each best fit in Task 1(iii): Table 7: Sum of squares of residuals for all 3 best fit Order of best fit Sum of Squares of Residuals Straight line (linear) 0.4269 Quadratic 0.00094698 or 9.4698 10-4 Cubic 0.0000024184 or 2.4184 10-6

Task 1(iv) To investigate how the independent variable {d} effect on the algae production rates (response, R). Set the independent variable {d} in the range of: Range {d} = [ 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20 ] Other variables {a, b, c, e} are set to mean value as shown in Table 2 and keep constant. With noise switched OFF, noise flag {NF} is set to zero in <f_algae.m> matlab function.

Result 1(iv):

Figure 7: Plot of the response, R (algae growth rate) vs. value of the independent variable {d}

On the same plot, plot the best fit straight line (linear), best fit quadratic line and best fit cubic line by using Matlab function <polyfit (x , y, n)>, where n is the order of the best fit.

Figure 8: Plot of actual response, R and together with best fit straight line (linear) R1, best fit quadratic line R2 and best fit cubic line R3 in the same plot, Responses vs. {d}. Notice that R2 and R3 best line are very close together.

Report the sum of squares of residuals for each best fit in Task 1(iv): Table 8: Sum of squares of residuals for all 3 best fit Order of best fit Sum of Squares of Residuals Straight line (linear) 2.6344 Quadratic 0.0024 Cubic 0.00093883 or 9.3883 10-4

Task 1(v)
To investigate how the independent variable {e} effect on the algae production rates (response, R). Set the independent variable {e} in the range of: Range {e} = [ 0,20, 40, 60, 80, 100, 120, 140, 160, 180, 200 ] Other variables {a, b, c, d} are set to mean value as shown in Table 2 and keep constant. With noise switched OFF, noise flag {NF} is set to zero in <f_algae.m> matlab function.

Result 1(v):

Figure 9: Plot of the response, R (algae growth rate) vs. value of the independent variable {e}

On the same plot, plot the best fit straight line (linear), best fit quadratic line and best fit cubic line by using Matlab function <polyfit (x , y, n)>, where n is the order of the best fit.

Figure 10: Plot of actual response, R and together with best fit straight line (linear) R1, best fit quadratic line R2 and best fit cubic line R3 in the same plot, Responses vs. {e}. Notice that R2 and R3 best line are very close together.

Report the sum of squares of residuals for each best fit in Task 1(v): Table 8: Sum of squares of residuals for all 3 best fit Order of best fit Sum of Squares of Residuals Straight line (linear) 36092 Quadratic 314.7216 Cubic 0.00000074126 or 7.4126 10-7 Task 1 The Screening Experiment Part 2 Screening experiment is carried out by set each independent variable into 2 extreme difference values while the other variables are held constant. Variables which cause no much difference in response between their 2 extremes are probably not highly influential on the response. Table 9: One-quarter and three-quarters of each independent variable respective range Independent Variable a b c d e One-quarter 0.45 1 0.02 5 50 Three-quarter 1.35 3 0.04 15 150 With noise switched OFF, noise flag {NF} is set to zero in <f_algae.m> matlab function. Obtain the response (algae growth rate) for each pair of independent variable, while the other independent variables are keep constant at their mean value. Table 10: Responses for 1st pair (a, b) b = 1 (% by mass) b = 3 (% by mass) a = 0.45 (% by mass) 245.6380 226.2500 a = 1.35 (% by mass) 252.2120 232.8240

Table 11: Responses for 2nd pair (a, d) d = 5 (rms shear strain rate, s-1) d = 15 (rms shear strain rate, s-1) a = 0.45 (% by mass) 235.9720 237.0570 a = 1.35 (% by mass) 242.5460 243.6310

Table 12: Responses for 3rd pair (a, e) e = 50 (W/m2) e = 150 (W/m2) a = 0.45 (% by mass) 138.3590 412.8690 a = 1.35 (% by mass) 140.3020 427.7140

Table 13: Responses for 4th pair (c, d) d = 5 (rms shear strain rate, s-1) d = 15 (rms shear strain rate, s-1) c = 0.02 (% by mass) 243.6370 245.2540 c = 0.04 (% by mass) 239.7800 240.3080

Table 14: Responses for 5th pair: (c, e) e = 50 (W/m2) e = 150 (W/m2) c = 0.02 (% by mass) 140.6990 430.7420 c = 0.04 (% by mass) 139.4040 420.8480

Task 1 Part 2 Comment: Refer to Table 10, 11 & 12, variable {a} is probably not highly influential on the response because no much difference in response between variable {a} 2 extremes values (0.45% and 1.35%). Range of response difference for 2 extreme values of ,a- is 1.943 to 14.845 g/hr (correspond to Rmin to Rmax). Refer to Table 10, variable {b} is probably not highly influential on the response because no much difference in response between variable {b} 2 extremes values (1% and 3%). Response difference for 2 extreme values of {b} is 19.388 g/hr. Refer to Table 13 & 14, variable {c} is probably not highly influential on the response because no much difference in response between variable {c} 2 extremes values (0.02% and 0.04%). Range of response difference for 2 extreme values of {c} is 1.295 to 9.894 g/hr (correspond to Rmin to Rmax). Refer to Table 11 & 13, variable {d} is probably not highly influential on the response because no much difference in response between variable {d} 2 extremes values (50W/m2 to 150W/m2). Range of response difference for 2 extreme value of ,d- is 0.528 to 1.617 g/hr (correspond to Rmin to Rmax). Refer to 12 & 14, variable {e} is probably highly influential on the response because there is large difference in response between variable {e} 2 extremes values (5s-1 to 15s-1). Range of response difference for 2 extreme value of {d} is 274.510 to 290.043 g/hr (correspond to Rmin to Rmax). The evidence of interaction observed is there is a large response change corresponding to the change of {e} independent variable. Nuisance factor is the factor whose effects we require to prohibit, where factor that we choose not to include as factor within the experiment. The other nuisance factors which are likely to affect algae growth are temperature of air and water inside the reactor system and pressure inside reactor system.

Task 2 The Full-Factorial Experiment and the Full Response Model The company decides use 3 levels for each independent variable {a, b, c, d}. The company decides use 4 levels for independent variable {e}, sunlight intensity. Table 15: Physical level and encoding level for each independent variable {a, b, c, d, e} Variable Levels Physical Levels Encoding Levels a 3 {0, 0.9, 1.8} {-1, 0 , 1} b 3 {0, 2, 4} {-1, 0 , 1} c 3 {0.01, 0.03, 0.05} {-1, 0 , 1} d 3 {0, 10, 20} {-1, 0 , 1} e 4 {0, 66.67, 133.33, 200} {-3, -1, 1, 3} Total number of treatments are present in the Full-Factorial Experiment is 324. 3 3 3 3 4 = 324 treatment Replication is carrying out more than one test to a same given treatment, but is not simply repeating. Replicates should be genuinely independent test. The noise-contribution to the responses from different replicates of the same treatment should have the quality of statistical independence. Thus, Replication is necessary only because of noise. Benefit is the effect of noise is usually smaller on the average response of a number of replicates test, while effect of noise on one response only is larger. Having a number of replicates actually provides us with an estimate

of the noise present so that we can distinguish between changes in response which might only be scatter due to noise and those which are mostly probably genuine. Randomisation relates to the order in which different tests are done and to the selection of test samples or test methods etc. If some strict formulaic order is followed, it is possible that for one factor, A, the earlier test all happen to lie on, example the low side of the centre of the experiment space and the later tests all happen to lie on the high side. Now if it happens that some smooth trend is occurring where example the sensitivity of one important instrument is decreasing steadily, changes in the measured response are wrongly attributed to changes in the factor A. Blocking is about preventing some factors from making any contribution to response. To this extent, it has a lot in common with randomization. The key difference is that with blocking, the factors whose effects we require to prohibit are known nuisance factors that we choose not to include as factors within the experiment. Replication is applied for each treatment when noise is concern to affect the response, so that average response can be taken to reduce the effect of noise. Randomisation is applied due to condition of environment is changing. Therefore perform the test at randomly time and dont perform the test in a formulaic order. Blocking is applied due to some independent variable bring very small effect on the response. Therefore these variables we can negligible or we can prohibit these variable effects on the response.

Use Matlab function <doe_fullfact.m> to produce the Experiment Matrix, E and the Terms Matrix, T. Explain the meaning of E and T matrices. Report first 10 rows of E and T matrices and individual explanation for each row. Treatment is each different combination of independent variable levels. Experiment matrix, E is used to store the data of all different treatments in the full-factorial experiment. Each row of the Experiment matrix, E describes one treatment done in one experiment. Each column of Experiment matrix, E is corresponding to the levels of each independent variable {a, b, c, d, e} at that instant of treatment. In current algae growing experiments, we have 5 independent variables and 324 treatments. So the Experiment Matrix, E is [324 5] matrix, where E contains 324 rows and 5 columns. Experiment Matrix, E first 10 rows: [ {a} {b} {c} {d} {e} ]

[ ] Individual explanation for first 10 rows: The methodology below shows how we can find the different combination of factors levels and assembly into E. 1st row of E [ -1 -1 -1 -1 -3]: {a} = {-1 0 1}; {b} = {-1 0 1}; {c} = {-1 0 1}; {d} = {-1 0 1}; {e} = {-3 -1 1 3}; 2nd row of E [ -1 -1 -1 -1 -1]: {a} = {-1 0 1}; {b} = {-1 0 1}; {c} = {-1 0 1}; {d} = {-1 0 1}; {e} = {-3 -1 1 3}; 3rd row of E [ -1 -1 -1 -1 1]: {a} = {-1 0 1}; {b} = {-1 0 1}; {c} = {-1 0 1}; {d} = {-1 0 1}; {e} = {-3 -1 1 3};

4th row of E [ -1 -1 -1 -1 3]: {a} = {-1 0 1}; {b} = {-1 0 1}; {c} = {-1 0 1}; {d} = {-1 0 1}; {e} = {-3 -1 1 3}; 7th row of E [ -1 -1 -1 0 1]: {a} = {-1 0 1}; {b} = {-1 0 1}; {c} = {-1 0 1}; {d} = {-1 0 1}; {e} = {-3 -1 1 3}; 10th row of E [ -1 -1 -1 1 -1]: {a} = {-1 0 1}; {b} = {-1 0 1}; {c} = {-1 0 1}; {d} = {-1 0 1}; {e} = {-3 -1 1 3};

5th row of E [ -1 -1 -1 0 -3]: {a} = {-1 0 1}; {b} = {-1 0 1}; {c} = {-1 0 1}; {d} = {-1 0 1}; {e} = {-3 -1 1 3}; 8th row of E [ -1 -1 -1 0 3]: {a} = {-1 0 1}; {b} = {-1 0 1}; {c} = {-1 0 1}; {d} = {-1 0 1}; {e} = {-3 -1 1 3}; 324th row of E [ 1 1 1 1 3]: {a} = {-1 0 1}; {b} = {-1 0 1}; {c} = {-1 0 1}; {d} = {-1 0 1}; {e} = {-3 -1 1 3};

6th row of E [ -1 -1 -1 0 -1]: {a} = {-1 0 1}; {b} = {-1 0 1}; {c} = {-1 0 1}; {d} = {-1 0 1}; {e} = {-3 -1 1 3}; 9th row of E [ -1 -1 -1 1 -3]: {a} = {-1 0 1}; {b} = {-1 0 1}; {c} = {-1 0 1}; {d} = {-1 0 1}; {e} = {-3 -1 1 3};

Assembly of Experiment matrix, E:

[ {a}

{b}

{c}

{d}

{e} ]

Each row of the Term matrix, T describes one term in the response model. Each column of T represents power of each independent variable {a, b, c, d, e}. The values inside each row of Term matrix represent the non-negative integer power of each independent variable in one term of the response model, R. [ {a} {b} {c} {d} {e} ]

Term matrix, T first 10 rows:

In the full response model comprising the terms (Aa Bb Cc Dd ) n where *A, B, C, D .+ are variables and *a, b, c, d+ are non-negative integer power of the different variables. The values of these powers are stored in Terms Matrix, T. The first 10 terms of response model for current case is: R = 1 + 2 {a} + 3 {b} + 4 {c- + 5 ,d- + 6 ,e- + 7 {a2- + 8 ,ab- + 9 ,ac- + 10 ,ad- + + 324 {a2b2c2d2e3} Table 16: Assembly of Term matrix, T into a table Terms {a} {b} {c} {d} {e} 1 1 0 0 0 0 0 2 2 1 0 0 0 0 Note: 0 Zero power of independent variable multiply with current term 3 3 0 1 0 0 0 n, e.g. 1 4 4 0 0 1 0 0 1 Power of one of particular independent variable multiply 5 5 0 0 0 1 0 with current term n, e.g. ,a- 2 6 6 0 0 0 0 1 2 Power of two of particular independent variable multiply 7 7 2 0 0 0 0 with current term n, e.g. {a2} 7 8 8 1 1 0 0 0 9 9 1 0 1 0 0 10 10 1 0 0 1 0 n n 324 324 2 2 2 2 3 Explain how E and T matrices are related to the Describing Matrix, A (also produced by <doe_fullfact.m>): 1. Each row of Describing matrix A corresponds to a different treatment in the experiment. 2. Each column of Describing matrix A corresponds to a different terms in the response model of experiment. 3. Column 1 of Describing matrix A always contains all 1s because linked to the constant terms. 4. If there are n factors, column 2 to n+1 of A is equal to Experiment matrix E. 5. In present experiment, there are 5 variables, column 2 to 6 of A are equal to Experiment matrix E. 6. The general i-th column of A corresponds to term in the response model comprising (Aa Bb Cc Dd ) where *a, b, c, d+ are non-negative integer power of the different variables. The values of these powers are stored in a matrix called Terms Matrix, T. With NOISE switched OFF, write a short script in Matlab which call <f_algae.m> for each treatment in turn and stores these values (responses) in a column-vector, r. Table 17: Matlab script to calculate responses for each treatment in turn and store in r column vector
[EM, AM, TM] = doe_fullfact( [3; 3; 3; 3; 4] ); SID = 1; % Student Identifier = 1 NF = 0; % Noise switched off. mins = [ 0.0; 0.0; 0.01; 0.0; 0.0 ]; maxs = [ 1.8; 4.0; 0.05; 20.; 200 ]; Num_Treatments = size(EM,1); r = zeros(Num_Treatments,1); % Produce E,A and T matrices

% Minimum values for the 5 independent variables % Maximum values for the 5 independent variables.

% This just counts how many rows are in EM % Set up a vector for holding the responses values

for it=1:Num_Treatments % This loop cycles through the treatments one by one at = mins(1) + maxs(1)*(EM(it,1)+1)/2; % Decode the variable {a} to get <at> bt = mins(2) + maxs(2)*(EM(it,2)+1)/2; % Decode the variable {b} to get <bt> ct = mins(3) + (maxs(3)- mins(3))*(EM(it,3)+1)/2; % Decode the variable {c} to get <ct> dt = mins(4) + maxs(4)*(EM(it,4)+1)/2; % Decode the variable {d} to get <dt> et = mins(5) + maxs(5)*(EM(it,5)+3)/6; % Decode the variable {e} to get <et> rt = f_algae( SID, at, bt, ct, dt, et, NF ); r(it) = rt; %Responses for each treatment end Getha = (inv(AM))*r; %Calculate Getha by invert A matrix directly and multiply by response,r

Report first 20 values for response r:

Using Describing matrix, A and Responses matrix, r, determine a new column vector, , which contains the parameters of a predictive (polynomial) model. General response model equation: r=A Invert A directly and multiply responses, r to obtain : = A-1 r Describing matrix, A we produced by using <doe_fullfact.m> function. Response r we obtained from the Matlab script in Table 17. Determine column vector, and report first 20 values of :

Explanation for each one of first 20 values of : Full response model of first 20 terms are: R = 1 + 2 {a} + 3 {b} + 4 {c- + 5 ,d- + 6 ,e- + 7 {a2- + 8 ,ab- + 9 ,ac- + 10 {ad} + 11 ,ae- + 12 {b2- + 13 {bc} + 14 ,bd- + 15 ,be- + 16 {c2- + 17 {cd} + 18 ,ce- + 19 {d2- + 20 ,de- + + 324 {a2b2c2d2e3} contains the parameters of a predictive (polynomial) model. Values of are the coefficient of the difference combination of independent variable {a, b, c, d, e} in the Full Response Model. Values of also represent the magnitude of effect of given combination of independent variable on the Response, either increase, decrease or negligible effect on Response. 1 = 242.473 >> Responses magnitude of experiment without effected by all independent variable (constant). 2 = 5.132 >> Coefficient of variable {a} effect on Responses. Increase of {a} will increase the Responses. 3 = -17.624 >> Coefficient of variable {b} effect on Responses. Increase of {b} will decrease the Responses. 4 = -4.345 >> Coefficient of variable {c} effect on Responses. Increase of {c} will decrease the Responses. 5 = 1.040 >> Coefficient of variable {d} effect on Responses. Increase of {d} will increase the Responses. 6 = 92.989 >> Coefficient of variable {e} effect on Responses. Increase of {e} will increase the Responses and Response increases is relatively large compare to variable {a, b, c, d} 7 = -9.179 >> Coefficient of variable {a2} effect on Responses. Increase of {a2} will decrease the Responses. 8 = 5.106e-14 0 >> Coefficient of variable ,ab} effect on Responses. Increase of {ab} will increase the Response, however the effect can be negligible due 8 to very close to zero. 9 = 1.406e-4 0 >> Coefficient of variable {ac} effect on Responses. Increase of {ac} will increase the Response, however the effect can be negligible due 9 to very close to zero. 10 = 1.563e-4 0 >> Coefficient of variable {ad} effect on Responses. Increase of {ad} will increase the Response, however the effect can be negligible due 10 to very close to zero. 11 = 3.274 >> Coefficient of variable {ae} effect on Responses. Increase of {ae} will increase the Responses. 12 = -3.568 >> Coefficient of variable {b2} effect on Responses. Increase of {b2} will decrease the Responses. 13 = -2.045 >> Coefficient of variable {bc} effect on Responses. Increase of {bc} will decrease the Responses. 14 = -1.406e-4 0 >> Coefficient of variable {bd} effect on Responses. Increase of {bd} will decrease the Response, however the effect can be negligible due 14 to very close to zero. 15 = -11.245 >> Coefficient of variable {be} effect on Responses. Increase of {be} will decrease the Responses. 16 = -0.557 >> Coefficient of variable {c2} effect on Responses. Increase of {c2} will decrease the Responses. 17 = -0.967 >> Coefficient of variable {cd} effect on Responses. Increase of {cd} will decrease the Responses. 18 = -2.773 >> Coefficient of variable {ce} effect on Responses. Increase of {ce} will decrease the Responses. 19 = -1.385 >> Coefficient of variable {d2} effect on Responses. Increase of {d2} will decrease the Responses. 20 = 0.663 >> Coefficient of variable {de} effect on Responses. Increase of {de} will decrease the Responses.

Use the current full-response model to estimate the response for the condition: {a} = 0.3%, {b} = 0.05%, {c} = 0.045%, {d} = 12.5s-1, {e} = 110W/m2 Clearly explain how to obtain this response: Use linear extrapolation method to obtain encoding value of {a, b, c, d, e} for current physical condition: ( ( ) ) ( ( ) ) ( ( ) ) ( ( ) )

( (

) )

Table 18: Estimate the encoding level for current conditions Variable Levels Physical Levels Encoding Levels a b c d e 3 3 3 3 4 {0, 0.9, 1.8} {0, 2, 4} {0.01, 0.03, 0.05} {0, 10, 20} {0, 66.67, 133.33, 200} {-1, 0 , 1} {-1, 0 , 1} {-1, 0 , 1} {-1, 0 , 1} {-3, -1, 1, 3}

Current Physical Conditions 0.3 0.05 0.045 12.5 110

Encoding Value (Estimated) - 2/3 - 0.975 0.75 0.25 0.3

In the full response model comprising the terms (Aa Bb Cc Dd ) n where *A, B, C, D .+ are variables and *a, b, c, d+ are non-negative integer power of the different variables. The values of these powers are stored in a matrix called Terms Matrix, T. Each row of the Term matrix, T describes one term in the response model. Each column of T represents power of each independent variable {a, b, c, d, e}. The values inside each row of Term matrix represent the non-negative integer power of each independent variable in one term of the full response model, R. General Full Response Model, R equation is: R = (Aa Bb Cc Dd Ee) n where [A, B, C, D, E] are variables and [a, b, c, d, e] are non-negative integer power of the different variables. Take the variable {a} and power elements-wise with all elements in first column of Term Matrix, T, we can obtain the powered variable {a} of all 324 terms in Full Reponses Model. Repeat this step by taking variable {b} , {c}, {d} and {e} power element-wise with all elements in 2nd, 3rd, 4th, and 5th column of T respectively, we can obtain the powered variables {b, c, d, e} of all 324 terms in Full Responses Model. Take all 324 terms of each powered variable {a, b, c, d, e}, and element-wise multiply them together to form 324 terms where each terms is generally equal to Aa Bb Cc Dd Ee. After this, take the 324 terms element-wise multiply with column vector where we determined before to form the Full Response Model, R = (Aa Bb Cc Dd Ee) n. Finally sum all the 324 terms in Full Response Model to obtain the response for current condition of each independent variable. Matlab script below demonstrate the calculation explanation above.

Table 19: Matlab script to estimate the response for the condition {a} = 0.3%, {b} = 0.05%, {c} = 0.045%, {d} = 12.5s-1, {e} = 110W/m2
[EM, AM, TM] = doe_fullfact( [3; 3; 3; 3; 4] ); SID = 1; NF = 0; % Student Identifier = 1 % Keep the noise switched off. % Minimum values for the 5 independent variables % Maximum values for the 5 independent variables. % Call <doe_fullfact.m> function to produce E, A and T matrices

mins = [ 0.0; 0.0; 0.01; 0.0; 0.0 ]; maxs = [ 1.8; 4.0; 0.05; 20.; 200 ];

Num_Treatments = size(EM,1); % This just counts how many rows are in EM r = zeros(Num_Treatments,1); % Set up a vector for holding the responses values for it=1:Num_Treatments % This loop cycles through the treatments one by one at = mins(1) + maxs(1)*(EM(it,1)+1)/2; % Decode the variable {a} to get <at> bt = mins(2) + maxs(2)*(EM(it,2)+1)/2; % Decode the variable {b} to get <bt> ct = mins(3) + (maxs(3)- mins(3))*(EM(it,3)+1)/2; % Decode the variable {c} to get <ct> dt = mins(4) + maxs(4)*(EM(it,4)+1)/2; % Decode the variable {d} to get <dt> et = mins(5) + maxs(5)*(EM(it,5)+3)/6; % Decode the variable {e} to get <et> rt = f_algae( SID, at, bt, ct, dt, et, NF ); %Obtain responses by called <f_algae.m> r(it) = rt; %Responses for each treatment in column-vector end Getha = (inv(AM))*r; %Calculate Getha by invert A matrix directly and multiply by response, r %Task 2 - Part2 a = -2/3; b = -0.975; c = 0.75; d = 0.25; e = 0.3; % Independent variable new condition TM_1 TM_2 TM_3 TM_4 TM_5 a_1 b_2 c_3 d_4 e_5 = = = = = = = = = = TM(:,1); TM(:,2); TM(:,3); TM(:,4); TM(:,5); a.^(TM_1); b.^(TM_2); c.^(TM_3); d.^(TM_4); e.^(TM_5); % % % % % % % % % % Extract Extract Extract Extract Extract obtain obtain obtain obtain obtain 1st 2nd 3rd 4th 5th the the the the the column column column column column powered powered powered powered powered of of of of of term term term term term matrix, matrix, matrix, matrix, matrix, {a} {b} {c} {d} {e} of of of of of T T T T T all all all all all 324 324 324 324 324 terms terms terms terms terms in in in in in Full Full Full Full Full Reponses Reponses Reponses Reponses Reponses Model Model Model Model Model

variable variable variable variable variable

Full_R = ((a_1).*(b_2).*(c_3).*(d_4).*(e_5)).*Getha;

% Form general Full Response Model, R R = (AaBbCcDdEe)n

Response = sum(Full_R); % Sum of all 324 terms in Full Response Model to get overall response Respo = f_algae(1,0.3,0.05,0.045,12.5,110,0); % Responses directly obtained from <f_algae.m>

Table 20: Compare the response estimated for current condition against response value obtained directly from
<f_algae.m>

Response (g/hr)

Estimated for current condition 278.8240 g/hr

Obtained from <f_algae.m> 277.6520 g/hr

Differences 1.172 g/hr

Percentage difference of Response:

Task 3 Orthogonal Array Experiment Factors A, B, C, D are at three levels each, with NOISE switched OFF. Hold the sunlight intensity, {e} constant at {e} = 110W/m2. Write a Matlab script to calculate the response of each Treatment in orthogonal array L9 (3 4). Table 21: Matlab script calculate the response of each Treatment in orthogonal array L9 (34)
Oa = [ -1 -1 -1 -1; % Run the Orthogonal Array Experiment Matirx for -1 0 0 0; % L9(3^4) with factor A,B,C,D at three levels each -1 1 1 1; 0 -1 0 1; 0 0 1 -1; 0 1 -1 0; 1 -1 1 0; 1 0 -1 1; 1 1 0 -1 ]; SID = 1; % Student Identifier = 1 NF = 0; % Keep the noise switched off. e = 110; % Keep e constant at 110W/m2. mins = [ 0.0; 0.0; 0.01; 0.0]; maxs = [ 1.8; 4.0; 0.05; 20.]; % Minimum values for the 4 independent variables % Ranges of the 4 independent variables above min.

Num_Treatments = size(Oa,1); % This just counts how many rows are in EM r = zeros(Num_Treatments,1); % Set up a vector for holding the responses values for it=1:Num_Treatments % This loop cycles through the treatments one by one at = mins(1) + maxs(1)*(Oa(it,1)+1)/2; % Decode the factor {A} to get <at> bt = mins(2) + maxs(2)*(Oa(it,2)+1)/2; % Decode the factor {B} to get <bt> ct = mins(3) + (maxs(3)-mins(3))*(Oa(it,3)+1)/2; % Decode the factor {C} to get <ct> dt = mins(4) + maxs(4)*(Oa(it,4)+1)/2; % Decode the factor {D} to get <dt> rt = f_algae( SID, at, bt, ct, dt, e, NF ); %Obtain responses by called <f_algae.m> r(it) = rt; %Responses for each treatment in column-vector end

Report the Responses obtained from the orthogonal array experiment L9 (34) for factors A, B, C, D corresponding to independent variables {a, b, c, d}. Table 22: Experiment Matrix for L9 (34) and its corresponding Responses Treatment Factor A Factor B Factor C 1 -1 -1 -1 2 -1 0 0 3 -1 1 1 4 0 -1 0 5 0 0 1 6 0 1 -1 7 1 -1 1 8 1 0 -1 9 1 1 0

Factor D -1 0 1 1 -1 0 0 1 -1

Response (g/hr) 267.090 255.070 223.046 288.771 264.698 252.153 282.844 272.849 239.012

Using Analysis of Means method for orthogonal matrices to find the main factor effects and interaction for factors A, B, C, D: The conditions for using Analysis of Means method are: 1. This experiment must be balanced, (e.g. A = -1 happens exactly same as A = 0 and A = 1). 2. All the factors A, B, C, D have levels symmetrically disposed around 0, (e.g. levels of factors A, B, C, D are equal to {-1, 0, 1} ). 3. Also, the factor interactions are order 2 at most (e.g. A2, B2, C2, D2, AB, AC, BD) Refer to Response value in Table 22, to determine the Main Factor Effect for each level of factors A, B, C, D in term of average Response, (Analysis of Means method): The Main Factor Effect for A:

The Main Factor Effect for B:

The Main Factor Effect for C:

The Main Factor Effect for D:

Calculation of Interaction in between each factor in different levels:

Table 23: Summarize of average Response, (Analysis of Means method) calculation result Main Factor Effect for A Main Factor Effect for C Average Response, 248.402 268.541 264.902 Main Factor Effect for B Main Factor Effect for D Average Response, 279.568 264.206 238.070

Average Response, 264.031 260.951 256.863 Average Response, 256.933 263.356 261.555

Table 24: Summarize of Interaction between each factor in different levels Interaction factor A Interaction value Interaction factor C 20.139 -3.639 Interaction factor B Interaction value Interaction factor D -15.363 -26.135

Interaction value -3.080 -4.088 Interaction value 6.422 -1.800

By focusing on the coefficients associated with 1, A, A2, B, B2, C, C2, D and D2, state the response model for this orthogonal array experiment and estimate the unknown coefficients n for the response model by using main factor effect and interactions method.

The Response Model, R: R = 1 + 2{A} + 3,B- + 4,C- + 5,D- + 6{A2- + 7{B2- + 8{C2- + 9{D2}

To estimate 2 (coefficient of {A}), take

To estimate 3 (coefficient of {B}), take

To estimate 4 (coefficient of {C}), take

To estimate 5 (coefficient of {D}), take

To estimate 6 (coefficient of {A2}), take [ ] [ ]

To estimate 7 (coefficient of {B2}), take [ ] [ ]

To estimate 8 (coefficient of {C2}), take [ ] [ ]

To estimate 9 (coefficient of {D2}), take [ ] [ ]

To estimate 1 (coefficient of {1}), take any treatment from Table 22, for example I choose Treatment 1, and take all the calculated coefficients 2-9 with the Treatment 1 Data substitute into Response Model, R to obtain the estimated coefficient 1 Treatment 1 Factor A -1 Factor B -1 Factor C -1 Factor D -1 Response (g/hr) 267.090

Response Model, R: R = 1 + 2{A} + 3,B- + 4,C- + 5{D} + 6{A2} + 7{B2} + 8{C2} + 9{D2} 267.090 = 1 + (8.250 1) + (20.749 1) + (3.584 1) + (2.311 1) + (-11.889 [1]2) + (5.386 [1]2) + (0.504 [1]2) + (4.111 [1]2)

267.090 = 1 8.250 + 20.749 + 3.584 2.311 11.889 5.386 0.504 4.111 1 = 267.090 + 8.118 1 = 275.208 Note that other Treatment 2 9 will give us same result of coefficient 1. Table 25: Summarise of estimated coefficient for Response Model Coefficient Estimated Value 1 275.208 2 8.250 3 20.749 4 3.584 5 2.311 6 -11.889 7 5.386 8 0.504 9 4.111

Using another method, deduce the unknown coefficients for the Response Model by setting up an equation in the form r = A, where A is 9 9 matrix. Create A matix for this Response Model. Explain how A matrix generated. As defined previously inTask 2, 1. Each row of Describing matrix A corresponds to a different treatment in the experiment. 2. Each column of Describing matrix A corresponds to a different terms in the response model of experiment. 3. Column 1 of Describing matrix A always contains all 1s because linked to the constant terms. 4. If there are n factors, column 2 to n+1 of A is equal to Experiment matrix E. 5. In present experiment, there are 4 variables {A, B, C, D}, column 2 to 5 of A are equal to Experiment matrix E, where E is equal to the Orthogonal Array Experiment Matrix, L9(34).

Response Model, R: R = 1 + 2{A} + 3,B- + 4,C- + 5,D- + 6{A2- + 7{B2- + 8{C2- + 9{D2} Experiment matrix E = Orthogonal Array Experiment Matrix, L9(34) [{A} {B} {C} {D} ]

Column 6 9 of A matrix is obtained in this method: Sample calculation to obtain A2 column-vector: Factor A array obtained from Experiment Matrix, E first column, ( ( ( ) ) )

Table 26: The rest of B2, C2 and D2 column-vector are summarized at table below Treatment A B C D A2 B2 C2 1 -1 -1 -1 -1 1 1 1 2 -1 0 0 0 1 0 0 3 -1 1 1 1 1 1 1 4 0 -1 0 1 0 1 0 5 0 0 1 -1 0 0 1 6 0 1 -1 0 0 1 1 7 1 -1 1 0 1 1 1 8 1 0 -1 1 1 0 1 9 1 1 0 -1 1 1 0

D2 1 0 1 1 1 0 0 1 1

Response Model, R: R = 1 + 2{A} + 3,B- + 4,C- + 5,D- + 6{A2- + 7{B2- + 8{C2- + 9{D2} 9 9 Describing matrix A (in table form): Combination of factors in each term of Response model, corresponding to column

nth Treatment, corresponding to row

What is the individual entry in r present? Array r is the response corresponding to the Orthogonal Array Experiment Matrix, L9 (34) and sunlight intensity {e} keep constant at 110 W/m2. By using the Matlab script from Table 21, we can calculate the response of each Treatment in orthogonal array L9 (34). Array r is generated from this Matlab scripts, where r:

[ which is same to the response value reported in Table 22

What is the individual entry in present? Array is the coefficient of each term in Response Model, R. Response Model, R: R = 1 + 2{A} + 3,B- + 4,C- + 5,D- + 6{A2} + 7{B2- + 8{C2- + 9{D2} Array can be present in this form:

[ General response model equation: r=A

Invert Describing Matrix A directly and multiply responses, r to obtain : = A-1 r The Matlab script in Table 27 able to calculate array for Task 3:

Table 27: Matlab script to calculate


Oa = [ -1 -1 -1 -1; -1 0 0 0; -1 1 1 1; 0 -1 0 1; 0 0 1 -1; 0 1 -1 0; 1 -1 1 0; 1 0 -1 1; 1 1 0 -1 ]; SID = 1; NF = 0; e = 110;

array in Task 3 with Orthogonal Array Experiment L9 (34)

% Run the Orthogonal Array Experiment Matirx for % L9(3^4) with factor A,B,C,D at three levels each

% Student Identifier = 1 % Keep the noise switched off. % Keep {e} constant. % Minimum values for the 4 independent variables % Ranges of the 4 independent variables above min.

mins = [ 0.0; 0.0; 0.01; 0.0]; maxs = [ 1.8; 4.0; 0.05; 20.];

Num_Treatments = size(Oa,1); % This just counts how many rows are in EM r1 = zeros(Num_Treatments,1); % Set up a vector for holding the responses values for it=1:Num_Treatments % This loop cycles through the treatments one by one at = mins(1) + maxs(1)*(Oa(it,1)+1)/2; % Decode the variable {a} to get <at> bt = mins(2) + maxs(2)*(Oa(it,2)+1)/2; % Decode the variable {b} to get <bt> ct = mins(3) + (maxs(3)-mins(3))*(Oa(it,3)+1)/2; % Decode the variable {c} to get <ct> dt = mins(4) + maxs(4)*(Oa(it,4)+1)/2; % Decode the variable {d} to get <dt> rt = f_algae( SID, at, bt, ct, dt, e, NF ); r1(it) = rt; % Responses, r1 for each treatment for L9(3^4) end A1 = [1 -1 -1 -1 1 -1 0 0 0 1 1 -1 1 1 1 1 1 0 -1 0 1 0 1 0 0 1 -1 0 1 0 1 -1 0 0 1 1 -1 1 0 1 1 1 0 -1 1 1 1 1 1 0 -1 1 -1 1 1 1 1; 0 0 0; 1 1 1; 1 0 1; 0 1 1; 1 1 0; 1 1 0; 0 1 1; 1 0 1]; % Create Describing Matrix, A1 directly

Getha11 = inv(A1)*r1;

% Inverse Describing Matrix, A1 directly and multiply with Response, r1 % to obtain Getha (coefficient of Response Model)

By using Matlab script in Table 27 able to calculate array for Task 3, we get:

Array is the coefficient of each term in Response Model, R. Therefore the Response Model, R for Task 3: R = 1 + 2{A} + 3,B- + 4,C- + 5,D- + 6{A2- + 7{B2- + 8{C2- + 9{D2} R = 275.2087 + 8.2498{A} 20.7490{B} 3.5840{C} + 2.3110{D} 11.8888{A2} 5.3863{B2} 0.5043{C2} 4.1113{D2}

By focusing on the coefficients associated with 1, A, A2, B, B2, C, C2, D and D2, comment on differences/commonalities of Array between the result from Task 2 and result from the Orthogonal Array Experiment. Full Response Model in Task 2: R = 1 + 2 {a} + 3 {b} + 4 {c- + 5 ,d- + 6 ,e- + 7 {a2- + 8 ,ab- + 9 ,ac- + 10 {ad} + 11 {ae} + 12 {b2- + 13 ,bc- + 14 ,bd- + 15 ,be- + 16 {c2- + 17 ,cd- + 18 ,ce- + 19 {d2- + 20 ,de- + + 324 {a2b2c2d2e3} Focusing on the coefficients associated with 1, A, A2, B, B2, C, C2, D and D2, we get Response Model in Task 2: R = 1 + 2 {a} + 3 {b} + 4 {c- + 5 ,d- + 7 {a2- + 12 {b2- + 16 {c2- + 19 {d2} Extracted Array in Task 2:

Table 28: Compare array for Task 2 and Task 3 in table array for Task 2 242.7432 5.1321 17.6239 4.3455 1.0396 9.1750 3.5683 0.5572 1.3851

array for Task 3 275.2087 8.2498 20.7490 3.5840 2.3110 11.8888 5.3863 0.5043 4.1113

Comment on commonalities/ differences of Array for Task 2 & Task 3: Refer to Table 28, sign (e.g. or +) of coefficient in each corresponding factors is same for Array . However the magnitudes of coefficients n in Task 3 are slightly difference from Task 2.

Task 4 Maximising the response By using One Factor at a Time Experiments method (OFAAT), we can determine the combination of the independent variables {a, b, c, d, e} result in the maximum production of algae growth rate, Response. From the Matlab scripts in Table 28, we found out that with combination of {a} = 1.1520 % by mass CO2 concentration {b} = 0 % by mass of salt concentration {c} = 0.0284 % by mass of O2 concentration {d} = 14.100 s-1 (rms shear strain rate) of agitation level {e} = 200 W/m2 of sunlight intensity Which give us the maximum response, Rmax = 774.6161 g/hr. Table 28: Matlab script performing OFAAT method to maximizing the response
[EM, AM, TM] = doe_fullfact([3; 3; 3; 3; 4]); SID = 1; % Student Identifier = 1 NF = 0; % Keep the noise switched off. mins = [ 0.0; 0.0; 0.01; 0.0; 0.0 ]; maxs = [ 1.8; 4.0; 0.05; 20; 200 ]; Num_Treatments = size(EM,1); r = zeros(Num_Treatments,1); % Minimum values for the 5 independent variables % Maximum values of the 5 independent variables % Call <doe_fullfact.m> function to produce E, % A and T matrices

% This just counts how many rows are in EM % Set up a vector for holding the responses values

for it=1:Num_Treatments % This loop cycles through the treatments one by one at = mins(1) + maxs(1)*(EM(it,1)+1)/2; % Decode the variable {a} to get <at> bt = mins(2) + maxs(2)*(EM(it,2)+1)/2; % Decode the variable {b} to get <bt> ct = mins(3) + (maxs(3)-mins(3))*(EM(it,3)+1)/2; % Decode the variable {c} to get <ct> dt = mins(4) + maxs(4)*(EM(it,4)+1)/2; % Decode the variable {d} to get <dt> et = mins(5) + maxs(5)*(EM(it,5)+3)/6; % Decode the variable {e} to get <et> rt = f_algae( SID, at, bt, ct, dt, et, NF ); r(it) = rt; %Responses for each treatment disp([' Response ' int2str(it) ' = ' num2str(r(it)) ' (g/hr) ']); % This line prints out loop counter end Getha = (inv(AM))*r; TM_1 TM_2 TM_3 TM_4 TM_5 = = = = = TM(:,1); TM(:,2); TM(:,3); TM(:,4); TM(:,5); % % % % % 1st 2nd 3rd 4th 5th % Calculate the coefficient of each term in Full Response Model column column column column column of of of of of term term term term term matrix, matrix, matrix, matrix, matrix, T T T T T

% Determine the maximum response with respect to variable {a} % {a} set to ranges within the levels 1 to 1 with intervals 0.01 % Other variables {b, c, d, e} are keep constant at a certain levels. a = (-1:0.01:1)'; b = 0; c = 0; d = 0; e = 0; n_a = size(a,1); R_a = zeros(n_a,1); % This just counts how many rows are in {a} array % Set up a vector for holding the responses values

for im = 1:n_a % This loop cycles through the variable {a} one by one Response = (((a(im,1)).^(TM_1)).*(b.^(TM_2)).*(c.^(TM_3)).*(d.^(TM_4)).*(e.^(TM_5))).*Getha; %Solve each term value in Full Response Model with variable {a} in turn and other constant variables Sum_Response = sum(Response); % Sum of all terms in the full response model R_a(im) = Sum_Response; % Response of each difference variable {a} disp([' R_a ' int2str(im) ' = ' num2str(R_a(im)) ' (g/hr) ']); % This line prints out loop counter end [Rmax_a,I_a] = max(R_a); a_max = a(I_a); % Determine the maximum Response, and location of maximum Response occurs % Determine the value of variable {a} when maximum Response occurs.

% % % %

Determine the maximum response with respect to variable {b} {b} set to ranges within the levels 1 to 1 with intervals 0.01 Other variables {a, c, d, e} are keep constant at a certain levels. Variable {a} is set to a_max value, where this value gives maximum response as determined previously.

a = a_max; b = (-1:0.01:1)'; c = 0; d = 0; e = 0; n_b = size(b,1); R_b = zeros(n_b,1); % This just counts how many rows are in {b} array % Set up a vector for holding the responses values

for im = 1:n_b % This loop cycles through the variable {b} one by one Response = ((a.^(TM_1)).*((b(im,1)).^(TM_2)).*(c.^(TM_3)).*(d.^(TM_4)).*(e.^(TM_5))).*Getha; %Solve each term value in Full Response Model with variable {b} in turn and other constant variables Sum_Response = sum(Response); % Sum of all terms in the full response model R_b(im) = Sum_Response; % Response of each difference variable {b} disp([' R_b ' int2str(im) ' = ' num2str(R_b(im)) ' (g/hr) ']); % This line prints out loop counter end [Rmax_b,I_b] = max(R_b); b_max = b(I_b); % Determine the maximum Response, and location of maximum Response occurs % Determine the value of variable {b} when maximum Response occurs.

% % % % % a b c d

Determine the maximum response with respect to variable {c} {c} set to ranges within the levels 1 to 1 with intervals 0.01 Other variables {a, b, d, e} are keep constant at a certain levels. Variable {a} and {b} are set to a_max and b_max values respectively, where these values give maximum response as determined previously. = = = = a_max; b_max; (-1:0.01:1)'; 0; e = 0; % This just counts how many rows are in {c} array % Set up a vector for holding the responses values

n_c = size(c,1); R_c = zeros(n_c,1);

for im = 1:n_c % This loop cycles through the variable {c} one by one Response = ((a.^(TM_1)).*(b.^(TM_2)).*((c(im,1)).^(TM_3)).*(d.^(TM_4)).*(e.^(TM_5))).*Getha; %Solve each term value in Full Response Model with variable {c} in turn and other constant variables Sum_Response = sum(Response); % Sum of all terms in the full response model R_c(im) = Sum_Response; % Response of each difference variable {c} disp([' R_c ' int2str(im) ' = ' num2str(R_c(im)) ' (g/hr) ']); % This line prints out loop counter end [Rmax_c,I_c] = max(R_c); c_max = c(I_c); % % % % % % Determine the maximum Response, and location of maximum Response occurs % Determine the value of variable {c} when maximum Response occurs.

Determine the maximum response with respect to variable {d} {d} set to ranges within the levels 1 to 1 with intervals 0.01 Other variables {a, b, c, e} are keep constant at a certain levels. Variable {a}, {b} and {c} are set to a_max, b_max and c_max values respectively, where these values give maximum response as determined previously. c = c_max;

a = a_max; b = b_max; d = (-1:0.01:1)'; e = 0; n_d = size(d,1); R_d = zeros(n_d,1);

% This just counts how many rows are in {d} array % Set up a vector for holding the responses values

for im = 1:n_d % This loop cycles through the variable {d} one by one Response = ((a.^(TM_1)).*(b.^(TM_2)).*(c.^(TM_3)).*((d(im,1)).^(TM_4)).*(e.^(TM_5))).*Getha; %Solve each term value in Full Response Model with variable {d} in turn and other constant variables Sum_Response = sum(Response); % Sum of all terms in the full response model R_d(im) = Sum_Response; % Response of each difference variable {d} disp([' R_d ' int2str(im) ' = ' num2str(R_d(im)) ' (g/hr) ']); % This line prints out loop counter end [Rmax_d,I_d] = max(R_d); d_max = d(I_d); % Determine the maximum Response, and location of maximum Response occurs % Determine the value of variable {d} when maximum Response occurs.

% % % % %

Determine the maximum response with respect to variable {e} {e} set to ranges within the levels 3 to 3 with intervals 0.01 Other variables {a, b, c, e} are keep constant at a certain levels. Variable {a}, {b}, {c} and {d} are set to a_max, b_max, c_max and d_max values respectively, where these values give maximum response as determined previously.

a = a_max; b = b_max; c = c_max; d = d_max ; e=(-3:0.01:3)'; n_e = size(e,1); R_e = zeros(n_e,1); % This just counts how many rows are in {e} array % Set up a vector for holding the responses values

for im = 1:n_e % This loop cycles through the variable {e} one by one Response = ((a.^(TM_1)).*(b.^(TM_2)).*(c.^(TM_3)).*(d.^(TM_4)).*((e(im,1)).^(TM_5))).*Getha; %Solve each term value in Full Response Model with variable {e} in turn and other constant variables Sum_Response = sum(Response); % Sum of all terms in the full response model R_e(im) = Sum_Response; % Response of each difference variable {e} disp([' R_e ' int2str(im) ' = ' num2str(R_e(im)) ' (g/hr) ']); % This line prints out loop counter end [Rmax_e,I_e] = max(R_e); e_max = e(I_e); % Determine the maximum Response, and location of maximum Response occurs % Determine the value of variable {e} when maximum Response occurs.

% Decode all the variables obtained where maximum response occur to get physical value of these variables a_p b_p c_p d_p e_p = = = = = mins(1) mins(2) mins(3) mins(4) mins(5) + + + + + maxs(1)*(a_max+1)/2; maxs(2)*(b_max+1)/2; (maxs(3)-mins(3))*(c_max+1)/2; maxs(4)*(d_max+1)/2; maxs(5)*(e_max+3)/6; % % % % % Decode Decode Decode Decode Decode the the the the the a_max b_max c_max d_max e_max to to to to to get get get get get physical physical physical physical physical value value value value value of of of of of {a}, {b}, {c}, {d}, {e}, a_p b_p c_p d_p e_p

Explanation for the methodology OFAAT applied in this task One Factor at a Time Experiments method (OFAAT) is most often used to find an optimum set of parameters for some system. The basic idea for OFAAT is this: Start at a random reference treatment and measure the response there. Change Factor A upward or downward and measure the new response, while other factors keep constant at initial random reference treatment. Fix the value of A at the better response and then change Factor B upward or downward to find the better response. Repeat these for the remaining factors. In this task, we are ask to maximize the Response of experiment result which affected by 5 factors {A, B, C, D, E}. Factors A D are each 3 levels and Factor E has 4 levels. The OFAAT experiment on the system starts with a random combination of treatment, which is {B = 0, C = 0, D = 0, E = 0}. Factor A is discretized from 1 to 1 with interval 0.01. Then, substitute the constant Factors {B = 0, C = 0, D = 0, E = 0} into Full-Response Model, and in turn, substitute the discretized value of Factor A into the FullResponse Model to obtain the Response. Check the maximum response value obtained due to different values of A and determines the value of Factor A corresponding to this maximum response occurs. The result obtained is {A = 0.28, B = 0, C = 0, D = 0, E = 0}, which give the maximum response, R = 243.4605. Fixed the value A = 0.28 at the current maximum response, then discretized Factor B from 1 to 1 with interval 0.01. Then, substitute the constant Factors {A = 0.28, C = 0, D = 0, E = 0} into Full-Response Model, and in turn, substitute the discretized value of Factor B into the Full-Response Model to obtain the Response. Check the maximum response value obtained due to different values of B and determines the value of Factor B corresponding to this maximum response occurs. The result obtained is {A = 0.28, B = 1, C = 0, D = 0, E = 0}, which give the maximum response, R = 257.5162.

Fixed the value A = 0.28, B = 1 at the current maximum response, then discretized Factor C from 1 to 1 with interval 0.01. Then, substitute the constant Factors {A = 0.28, B = 1, D = 0, E = 0} into Full-Response Model, and in turn, substitute the discretized value of Factor C into the Full-Response Model to obtain the Response. Check the maximum response value obtained due to different values of C and determines the value of Factor C corresponding to this maximum response occurs. The result obtained is {A = 0.28, B = 1, C = 0.08, D = 0, E = 0}, which give the maximum response, R = 257.5235. Fixed the value A = 0.28, B = 1, C = 0.08 at the current maximum response, then discretized Factor D from 1 to 1 with interval 0.01. Then, substitute the constant Factors {A = 0.28, B = 1, C = 0.08, E = 0} into Full-Response Model, and in turn, substitute the discretized value of Factor D into the Full-Response Model to obtain the Response. Check the maximum response value obtained due to different values of D and determines the value of Factor D corresponding to this maximum response occurs. The result obtained is {A = 0.28, B = 1, C = 0.08, D = 0.41, E = 0}, which give the maximum response, R = 257.7497. Fixed the value A = 0.28, B = 1, C = 0.08 at the current maximum response, then discretized Factor D from 1 to 1 with interval 0.01. Then, substitute the constant Factors {A = 0.28, B = 1, C = 0.08, E = 0} into Full-Response Model, and in turn, substitute the discretized value of Factor D into the Full-Response Model to obtain the Response. Check the maximum response value obtained due to different values of D and determines the value of Factor D corresponding to this maximum response occurs. The result obtained is {A = 0.28, B = 1, C = 0.08, D = 0.41, E = 0}, which give the maximum response, R = 257.7497. Fixed the value A = 0.28, B = 1, C = 0.08, D = 0.41 at the current maximum response, then discretized Factor E from 3 to 3 with interval 0.01. Then, substitute the constant Factors {A = 0.28, B = 1, C = 0.08, D = 0.41} into Full-Response Model, and in turn, substitute the discretized value of Factor E into the Full-Response Model to obtain the Response. Check the maximum response value obtained due to different values of E and determines the value of Factor E corresponding to this maximum response occurs. The result obtained is {A = 0.28, B = 1, C = 0.08, D = 0.41, E = 3}, which give the maximum response, R = 774.6161. Then we must return to Factor A again because the presence of interaction terms might mean that A = 0.28 is no longer the best value. Use add-on Matlab script in Table 29 to check the value of Factor A. The result remain unchanged, which the optimum value for each factor is {A = 0.28, B = 1, C = 0.08, D = 0.41, E = 3}, which give the maximum response, R = 774.6161.

Table 29: Add-on Matlab script to check value of Factor A


% % % % % Because the presence of interaction terms might mean that A = 0.28 is no longer the best value. Determine the maximum response with respect to variable {a2} {a2} set to ranges within the levels 1 to 1 with intervals 0.01 Other variables {b, c, d, e} are keep constant at the previous optimum value. eg. B = -1, C = -0.08, D = 0.41, E = 3

a2 = (-1:0.01:1)'; b2 = b_max; c2 = c_max; d2 = d_max; e2 = e_max; n_a2 = size(a2,1); R_a2 = zeros(n_a2,1); % This just counts how many rows are in {a2} array % Set up a vector for holding the responses values

for im2 = 1:n_a2 % This loop cycles through the variable {a2} one by one Response = (((a2(im2,1)).^(TM_1)).*(b2.^(TM_2)).*(c2.^(TM_3)).*(d2.^(TM_4)).*(e2.^(TM_5))).*Getha; %Solve each term value in Full Response Model with variable {a2} in turn and other constant variables Sum_Response = sum(Response); % Sum of all terms in the full response model R_a2(im2) = Sum_Response; % Response of each difference variable {a2} disp([' R_a2 ' int2str(im2) ' = ' num2str(R_a2(im2)) ' (g/hr) ']); % This line prints out loop counter

end [Rmax_a2,I_a2] = max(R_a2); a_max2 = a2(I_a2); % Determine the maximum Response, and location of maximum Response occurs % Determine the value of variable {a2} when maximum Response occurs.

Task 5 How significant are the differences in Response? Within this task, set constant for {a} = 0.3 (%), {b} = 0.05 (%), {c} = 0.045 (%) and {e} = 110 (W/m2) With NOISE now switched ON, Treatment 1: set {d} = 4 (s-1) and obtain 5 different values for algae production. Treatment 2: set {d} = 16 (s-1) and obtain another 5 different values for algae production. Table 30: Matlab scripts to generate the Response for Treatment 1 and 2, and calculate for the probability of Response increase at least 5 g/hr by using t-statistics and <ct.m> function
SID = 1; NF = 1; % student identifier % switch ON the noise

% Generate unique data for SID = 1 by seeding the random number generator. FID = fopen('randseed.dat','w'); % Open a file for writing. iok = fprintf(FID,' %8d ',(10000+SID)); % Write the seed into file. iok = fclose(FID); % Close the file a = 0.3; b =0.05; c = 0.045; e = 110; % Set constant values for {a}, {b}, {c}, {e}

% Obtain the 5 Responses in Treatment 1 d_1 = 4; R11 = f_algae( SID, a, b, c, d_1, e, NF ); R12 = f_algae( SID, a, b, c, d_1, e, NF ); R13 = f_algae( SID, a, b, c, d_1, e, NF ); R14 = f_algae( SID, a, b, c, d_1, e, NF ); R15 = f_algae( SID, a, b, c, d_1, e, NF ); R1 = [R11; R12; R13; R14; R15]; % Assembly the response in vector column array % Obtain the 5 Responses in Treatment 2 d_2 = 16; R21 = f_algae( SID, a, b, c, d_2, e, NF ); R22 = f_algae( SID, a, b, c, d_2, e, NF ); R23 = f_algae( SID, a, b, c, d_2, e, NF ); R24 = f_algae( SID, a, b, c, d_2, e, NF ); R25 = f_algae( SID, a, b, c, d_2, e, NF ); R2 = [R21; R22; R23; R24; R25]; % Assembly the response in vector column array mean_R1 = mean(R1); mean_R2 = mean(R2); var_R1 = var(R1); var_R2 = var(R2); % % % % Calculate Calculate Calculate Calculate the the the the mean Response for mean Response for variance Response variance Response Treatment 1 Treatment 2 for Treatment 1 for Treatment 2

% Calculate t-statistics n = 5; % n = number of responses mean_diff = mean_R2 - mean_R1; % mean difference between hypo_diff = 5; % hypothesised difference t = (mean_diff - hypo_diff)/(sqrt((var_R1 + var_R2)/n)); DoF = 2*n-2; prob = ct(t,DoF)

obtained in each treatments 2 treatments between 2 treatment given in Task 5 % determine the t-statistics

% Degree of freedom, DoF = (2*n - 2) % Probability of algae production at least 5g/hr increase from Treatment 1 to 2 by called <ct.m> function

Table 31: The Response generated by Matlab Script Treatment Rep. 1 Rep. 2 Rep. 3 Rep. 4

Rep. 5

Mean, Mn

1 ( d=4 ) 287.3050 291.2690 274.1970 291.1170 264.3930 281.6562 2 (d = 16) 262.9040 280.0590 273.9180 291.9090 272.7550 276.3090

Variance, Sn2 Standard Deviation, Sn 141.8698 11.9109 113.8661 10.6708

Sample Calculation for Treatment 1 Mean of Treatment 1, M1 ( )

Variance of Treatment 1, S12 ( [( ( ) ) ) ( ( ) ( ) ] )

Standard Deviation of Treatment 1, S1

Mean difference = Mean difference = Standard Deviation difference = Standard Deviation difference =

Comment whether differences in Response correspond to the variation of independent variable {d} are real or they may have occurred as a result of noise on the measurements. Intuitively, we observe that if differences in mean response are very large compared with the standard deviation difference, e.g. ( ) ( ), then we have confidence that these differences in Response correspond to the variation of a factor is real. From the calculation above, , and . This result show that is not relatively large different compare to . Therefore, we have confidence that these differences are not real, and they may have occurred as a result of noise on the measurements.

Use t-statistics to estimate the probability that increasing the agitation rate from d = 4 (s-1) to d = 16 (s-1) result in an increase in algae production of at least 5 g/hr. Calculate the t-statistics: ( ) ( ( Where = Mean difference = Hypothesised difference of mean Response between 2 treatments = number of responses obtained in each treatments, this case n = 5. In this task, the hypothesized difference of mean Reponse is increase in Response at least 5g/hr, which ( ) ( ( ( ( ) ) ( ) ( ) ) ) ) )

The cumulative probability distribution function for the t-distribution has (2n 2) Degrees of Freedom, DoF. The number of DoF here is 8. DoF = ( 2 5 2 ) = 8
) ( ), it is clearly that the probability of our hypothesis is Because the , which means ( true less that 50%. Use Matlab function, <ct.m> as shown in Table 30 Matlab script, we can assess accurately the probability of our hypothesis is. The instruction is: prob = ct(t,DoF) >> prob = ct(-1.4468,8) And we get the probability is 0.0930, which is equal to 9.3%. Therefore, probability that increasing the agitation rate from d = 4 (s-1) to d = 16 (s-1) result in an increase in algae production of at least 5 g/hr is 9.3%.

Você também pode gostar