Functions > Design of Experiments > Regression Analysis > Example: Second-Order Response Surface
  
Example: Second-Order Response Surface
Use the boxwilson, polyfitc, and polyfit functions to design an experiment and to create a model of the process being studied. Use a solve block to find the maximum yield predicted by the model.
1. Define a boxwilson design matrix.
Click to copy this expression
2. Define the real values for A (reaction time in minutes) and B (temperature in Fahrenheit) which are the natural variables for the chemical process under study.
Click to copy this expression
3. Call the doelabel function to convert the coded values of the design matrix into the real values of the natural variables.
Click to copy this expression
4. Record the yield of the chemical process for each run.
Click to copy this expression
5. Call polyfitc to carry out a second-order polynomial regression with the coded values.
Click to copy this expression
6. Extract the coefficients of regression from the output of polyfitc.
Click to copy this expression
7. Create a function of coded values that models the chemical reaction. Use this function to predict the yield at A=-1 and B=1.
Click to copy this expression
Click to copy this expression
8. Call polyfit to create a function of real values that models the chemical reaction. Use this function to predict the yield at t=80 min and T=170F.
Click to copy this expression
Click to copy this expression
As expected, the calculated yield is the same as in step 7.
9. Use a solve block to find the maximum yield.
Click to copy this expression
Click to copy this expression
10. Use a contour plot to visualize how the yield changes around t_max and T_max.
Click to copy this expression
Click to copy this expression
Click to copy this expression
Click to copy this expression
Reference
Montgomery, D.C., Design and Analysis of Experiments, 5th ed., John Wiley & Sons, New York, 2001, pp. 442.