1. Trang chủ >
  2. Công Nghệ Thông Tin >
  3. Kỹ thuật lập trình >

5 Analysis of Variance (ANOVA) and Factorial Designs: ANOVA[]

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (4.66 MB, 453 trang )


Statistics



355



Table 9.9



Data for Example 9.2

Factor B



Factor A



1

2

3



1



2



3



130, 155, 74, 180

150, 188, 159, 126

138, 110, 168, 160



34, 40, 80, 75

136, 122, 106, 115

174, 120, 150, 139



20, 70, 82, 58

25, 70, 58, 45

96, 104, 82, 60



{2,3,25},{2,3,70},{2,3,58},{2,3,45},

{3,1,138},{3,1,110},{3,1,168},{3,1,160},

{3,2,174},{3,2,120},{3,2,150},{3,2,139},

{3,3,96},{3,3,104},{3,3,82},{3,3,60}};

where the first value of each triplet is the level of A, the second value the level of B, and the

third value the output of the process. Then the analysis of variance is performed with

Needs["ANOVA‘"]

ANOVA[dat,{A,B,All},{A,B}]

which outputs the following ANOVA table



ANOVA->



A

B

AB

Error

Total



DF

2

2

4

27

35



SumOfSq

10683.7

39118.7

9613.78

18230.8

77647.



MeanSq

5341.86

19559.4

2403.44

675.213



FRatio

7.91137

28.9677

3.55954



PValue

0.00197608

1.9086 × 10-7

0.0186112



and the following mean values of the main factors and their interactions at each level



CellMeans→



All

A[1]

A[2]

A[3]

B[1]

B[2]

B[3]

A[1]

A[1]

A[1]

A[2]

A[2]

A[2]

A[3]

A[3]

A[3]



B[1]

B[2]

B[3]

B[1]

B[2]

B[3]

B[1]

B[2]

B[3]



105.528

83.1667

108.333

125.083

144.833

107.583

64.1667

134.75

57.25

57.5

155.75

119.75

49.5

144.

145.75

85.5



An Engineer’s Guide to Mathematica®



356



From the ANOVA table, it is seen that the main factors and their interactions are statistically

significant at better than the 98% level. Consequently, from an examination of the cell means,

if the objective is to find the combination of parameters that produces the maximum output,

then one should run the process with factor A at level 2, denoted A[2], and factor B at level 1,

denoted B[1]. The output of the process at these levels will be, on average, 155.8. If the interaction term was not statistically significant, then all these interactions would have been ignored;

they would be considered a random occurrence. The first value in CellMeans designated

All is the overall mean of the data; that is, N[Mean[dat[[All,3]]]] = 105.528.



Example 9.3

Four-Factor Factorial Analysis

Consider the data in Table 9.10, which is for a process with four factors U, V, W, and Y, each

taken at two levels. In addition, each combination of levels of these factors is replicated two

times. The data given in Table 9.10 are placed in the appropriate form resulting in the array

datfac={

{1,1,1,1,159},{1,1,1,1,163},{2,1,1,1,168},{2,1,1,1,175},

{1,2,1,1,158},{1,2,1,1,163},{2,2,1,1,166},{2,2,1,1,168},

{1,1,2,1,175},{1,1,2,1,178},{2,1,2,1,179},{2,1,2,1,183},

{1,2,2,1,173},{1,2,2,1,168},{2,2,2,1,179},{2,2,2,1,182},

{1,1,1,2,164},{1,1,1,2,159},{2,1,1,2,187},{2,1,1,2,189},

{1,2,1,2,163},{1,2,1,2,159},{2,2,1,2,185},{2,2,1,2,191},

{1,1,2,2,168},{1,1,2,2,174},{2,1,2,2,197},{2,1,2,2,199},

{1,2,2,2,170},{1,2,2,2,174},{2,2,2,2,194},{2,2,2,2,198}};

Then the analysis of variance is performed with

Needs[ANOVA‘”] (* Not needed if already executed *)

ANOVA[datfac,{U,V,W,Y,All},{U,V,W,Y}]

which outputs the following ANOVA table



ANOVA →



U

V

W

Y

UV

UW

UY

VW

VY

WY

UVW



DF

1

1

1

1

1

1

1

1

1

1

1



SumOfSq

2312.

21.125

946.125

561.125

0.125

3.125

666.125

0.5

12.5

12.5

4.5



MeanSq

2312.

21.125

946.125

561.125

0.125

3.125

666.125

0.5

12.5

12.5

4.5



FRatio

241.778

2.20915

98.9412

58.6797

0.0130719

0.326797

69.6601

0.0522876

1.30719

1.30719

0.470588



PValue

4.45067 × 10-11

0.156633

2.95785 × 10-8

9.69219 × 10-7

0.910397

0.575495

3.18663 × 10-7

0.822026

0.269723

0.269723

0.502537



Statistics



357



Table 9.10



Data for Example 9.3

Factors and their levels



Response (ym, j )



U



V



W



Y



j=1



j=2



1

2

1

2

1

2

1

2

1

2

1

2

1

2

1

2



1

1

2

2

1

1

2

2

1

1

2

2

1

1

2

2



1

1

1

1

2

2

2

2

1

1

1

1

2

2

2

2



1

1

1

1

1

1

1

1

2

2

2

2

2

2

2

2



159

168

158

166

175

179

173

179

164

187

163

185

168

197

170

194



163

175

163

168

178

183

168

182

159

189

159

191

174

199

174

198



UVY

UWY

VWY

UVWY

Error

Total



1

1

1

1

16

31



2.

0.

0.125

21.125

153.

4716.



2.

0.

0.125

21.125

9.5625



0.20915

0.

0.0130719

2.20915



0.653583

1.

0.910397

0.156633



From this table, it is seen that main factors U, W, and Y and the interaction UY have a

statistically meaningful effect on the output. Since the list of mean values of the main factors

and their interactions is quite long, we shall only list those associated with the statistically

meaningful effects. These mean values at each level are

U[1]

U[2]

W[1]

W[2]

Y[1]

Y[2]

U[1]Y[1]

U[1]Y[2]

U[2]Y[1]

U[2]Y[2]



166.75

183.75

169.813

180.688

171.063

179.438

167.125

166.375

175.

192.5



From these mean values, it is seen that the maximum response will be obtained when factor

U is at its high level (U[2]) and factor Y is at its high level (Y[2]).



An Engineer’s Guide to Mathematica®



358



9.6



Functions Introduced in Chapter 9



A list of functions introduced in Chapter 9 is given in Table 9.11.



Table 9.11



Commands introduced in Chapter 9



Command



Usage



ANOVA

BoxWhiskerChart

CDF



Performs an analysis of variance

Creates a box whisker chart

Gives the cumulative distribution function for a specified

distribution

Estimates the parameters of a specified distribution for a set

of data

Estimates the parameters of a specified distribution for a set

of data

Plots a histogram

Determines the inverse of a specified CDF

Performs a simple or a multiple linear regression analysis

Performs hypothesis tests on means

Obtains the mean of a list of values

Determines the confidence interval between the means of

two lists of values

Obtains the median of a list of values

Determines the parameters of a nonlinear model assumed

described a list of values

Determines the probability of an event for a specified

probability distribution

Gives the symbolic expression or the numerical value of the

probability density function for a specified distribution

Gives the probability of an event for a specified distribution

Creates a probability plot of a list of values for a specified

distribution

Give the specified quartile for a list of values

Generates a list of values that have a specified distribution

Determines the root mean square of a list of values

Gives the confidence interval of the mean of a list of values

Obtains the standard deviation of a list of values

Obtains the variance of a list of values

Used to test the hypothesis that the variances of two lists of

values are equal



EstimatedDistribution

FindDistributionParameters

Histogram

InverseCDF

LinearModelFit

LocationTest

Mean

MeanDifferenceCI

Median

NonlinearModelFit

NProbability

PDF

Probability

ProbabilityScalePlot

Quartile

RandomVariate

RootMeanSquare

StudentTCI

StandardDeviation

Variance

VarianceTest



10

Control Systems and

Signal Processing

10.1



Introduction



A control system is often employed to provide a physical system with the ability to meet

specified performance goals. In order to design such a system, one usually creates a model

of the physical system and a model of the control system so that the combined system can

be analyzed and the appropriate control system characteristics chosen. Mathematica provides

a collection of commands that allows one to model the system, analyze the system, and plot

the characteristics of the system in different ways. In this chapter, we shall demonstrate the

usage of several commands that can be employed to design control systems. In addition, we

shall illustrate several commands that can be used in various aspects of signal processing and

spectral analysis: filters and windows.



10.2

10.2.1



Model Generation: State-Space and Transfer

Function Representation

Introduction



Before illustrating the various Mathematica commands that can be used to represent control

systems, we shall introduce a permanent magnet motor as a physical system to be modeled and

controlled. This system will be used as the specific linear system when many of the commands

are introduced. The governing equations for one such system are [1]

d𝜃

di

+ km

+ Ri = v

dt

di

d𝜃

d2 𝜃

− kg i = 0

J 2 +𝜁

di

di



L



An Engineer’s Guide to Mathematica® , First Edition. Edward B. Magrab.

© 2014 John Wiley & Sons, Ltd. Published 2014 by John Wiley & Sons, Ltd.

Companion Website: www.wiley.com/go/magrab



(10.1)



An Engineer’s Guide to Mathematica®



360



where v = v(t) is the input voltage to the motor windings, i = i(t) is the current in the motor coil,

𝜃 = 𝜃(t) is the angular position of the rotor, R is the motor resistance, L is the inductance of the

winding, km is the conversion coefficient from current to torque, kg is the back electromotive

force generator constant, 𝜁 represents the motor friction, and J is the mass moment of inertia

of the system and its load.



10.2.2



State-Space Models: StateSpaceModel[]



Equation (10.1) can be converted to a system of first-order differential equations with the

definitions

x1 (t) = 𝜃(t)

d𝜃

x2 (t) =

dt

x3 (t) = i(t)

Then Eq. (10.1) becomes the following system of first-order equations

dx1

= x2

dt

kg

dx

𝜁

ẋ 2 = 2 = − x2 + x3

dt

J

J

dx3

km

R

v

ẋ 3 =

= − x2 − x3 +

dt

L

L

L



ẋ 1 =



which can be written in matrix form as

̇ = [A] {x} + {B} {u}

{x}

where {x} is the state vector, {u} is the input vector, and

⎧ x1 ⎫

⎪ ⎪

{x} = ⎨ x2 ⎬ ,

⎪x ⎪

⎩ 3⎭



⎧ ẋ 1 ⎫

⎪ ⎪

̇ = ⎨ ẋ 2 ⎬ ,

{x}

⎪ ẋ ⎪

⎩ 3⎭



⎡0

1



[A] = ⎢ 0 −𝜁 ∕J

⎢ 0 k ∕L

m





0 ⎤



kg ∕J ⎥ ,

−R∕L ⎥⎦



⎧0⎫

⎪ ⎪

{u} = ⎨ 0 ⎬

⎪v⎪

⎩ ⎭

⎧ 0 ⎫





[B] = ⎨ 0 ⎬

⎪ 1∕L ⎪







The matrix [A] is called the state matrix and the matrix [B] the input matrix.

In addition, we define an output vector {y} as follows

{y} = [C] {x} + {D} {u}



Xem Thêm
Tải bản đầy đủ (.pdf) (453 trang)

×