How to perform RSM using MATLAB

rsm_site

For biology and science students, applying response surface methodology for the optimization of the response is a big challenging task. Let us make it simpler…

Choose the number of inputs that affect the output under study.

Each set of input conditions (reactants) define an experimental run.

For example, in order to estimate the biomass (g/ml) of the yield, the reactants may be temperature, peptone concentration and pH etc.

Temperature may vary from 30 to 70 deg C in steps of 10 degrees. The zero level being the middle one at 50 deg C. Peptone concentration may vary from 0.25 to 1.25 mg/ml with zero level at 0.75 mg/ml. pH may vary from 5 to 9 with zero level at 7.

Hence the levels are as follows:

Table 1: Reactant levels

Reactant -2 level -1 level zero level 1 level 2 level
Temperature (deg C) 30 40 50 60 70
Peptone concentration (mg/ml) 0.25 0.5 0.75 1 1.25
pH 5 6 7 8 9

Let the design chosen be the circumscribed central composite design (circumscribed CCD).

Use MATLAB to plan the experiment as follows:

exp = ccdesign(3,’type’,’circumscribed’) ;

This will yield the following table:

Table 2: Experiment design

Sl. No. Reactant 1 Reactant 2 Reactant 3
1. -1 -1 -1
2. -1 -1 1
3. -1 1 -1
4. -1 1 1
5. 1 -1 -1
6. 1 -1 1
7. 1 1 -1
8. 1 1 1
9. -1.6818 0 0
10. 1.6818 0 0
11. 0 -1.6818 0
12. 0 1.6818 0
13. 0 0 -1.6818
14. 0 0 1.6818
15. 0 0 0
16. 0 0 0
17. 0 0 0
18. 0 0 0
19. 0 0 0
20. 0 0 0
21. 0 0 0
22. 0 0 0
23. 0 0 0
24. 0 0 0

Now, in Table 2, replace 0 with zero level of reactants from Table 1, -1.6818 with -2 level, 1.6818 with 2 level, -1 with -1 level and 1 with 1 level from Table 1 to get the following table:

Table 3: Experiment runs

Run No. Temperature (deg C) Peptone concentration (mg/ml) pH
1. 40 0.5 6
2. 40 0.5 8
3. 40 1 6
4. 40 1 8
5. 60 0.5 6
6. 60 0.5 8
7. 60 1 6
8. 60 1 8
9. 30 0.75 7
10. 70 0.75 7
11. 50 0.25 7
12. 50 1.25 7
13. 50 0.75 5
14. 50 0.75 9
15. 50 0.75 7
16. 50 0.75 7
17. 50 0.75 7
18. 50 0.75 7
19. 50 0.75 7
20. 50 0.75 7
21. 50 0.75 7
22. 50 0.75 7
23. 50 0.75 7
24. 50 0.75 7

The experiments need to be performed in 24 sets as mentioned in Table 3. Run number 15 to 24 are performed at same input conditions. This enhances the accuracy of the theoretical model that may fit in to give better results for any other non-experimented conditions.

After performing the experiments data need to be collected (preferably in triplicates) to get the experimented output. Subsequently an RSM model is to be developed that may endorse and fit into the experimental data.

The output from the experiment can be appended to Table 3 as below:

Table 4: Experimental Output

Run No. Temperature (deg C) Peptone concentration (mg/ml) pH Biomass (mg/ml)
1. 40 0.5 6 1.5
2. 40 0.5 8 0.4
3. 40 1 6 1.125
4. 40 1 8 1.475
5. 60 0.5 6 0.1
6. 60 0.5 8 0.6
7. 60 1 6 0.937
8. 60 1 8 3.312
9. 30 0.75 7 0.625
10. 70 0.75 7 1.737
11. 50 0.25 7 0.2
12. 50 1.25 7 1.612
13. 50 0.75 5 1.5
14. 50 0.75 9 1.187
15. 50 0.75 7 1.25
16. 50 0.75 7 1.23
17. 50 0.75 7 1.22
18. 50 0.75 7 1.24
19. 50 0.75 7 1.25
20. 50 0.75 7 1.23
21. 50 0.75 7 1.22
22. 50 0.75 7 1.27
23. 50 0.75 7 1.25
24. 50 0.75 7 1.26

Column numbers 2 to 4 of Table 4 are the reactants and column number 5 is the experimental output. Define them as an array in MATLAB either by typing in the MATLAB command prompt or in a MATLAB file (the latter is better).

react = [40   0.5 6

40  0.5 8

40  1   6

40  1   8

60  0.5 6

60  0.5 8

60  1   6

60  1   8

30  0.75    7

70  0.75    7

50  0.25    7

50  1.25    7

50  0.75    5

50  0.75    9

50  0.75    7

50  0.75    7

50  0.75    7

50  0.75    7

50  0.75    7

50  0.75    7

50  0.75    7

50  0.75    7

50  0.75    7

50  0.75    7

];

e_out=[

1.5

0.4

1.125

1.475

0.1

0.6

0.937

3.312

0.625

1.737

0.2

1.612

1.5

1.187

1.25

1.23

1.22

1.24

1.25

1.23

1.22

1.27

1.25

1.26

];

Now we have two arrays. Array 1 i.e. react contains the reactants, where react(:,1) is temperature, react(:,2) is Peptone concentration and react(:,3) is pH. Array 2 is e_out which contains the output (Biomass).

You may type the same in MATLAB command prompt and verify.

To generate the theoretical model type following command in the MATLAB command prompt:

End of Part 1

Advertisements

1 Comment

  1. Hello Ms. Rashmi,

    I am third year undergrad working on similar project and wanted thankyou for the helpful blog. How can I get the second part of the same blogpost.
    Would be pleased if you could help me in this.

    Regards,
    Ashwin Munjewar

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s