32
Quality of Curve Fitting P M V Subbarao Professor Mechanical Engineering Department Suitability of A Model to a Data Set…..

Quality of Curve Fitting P M V Subbarao Professor Mechanical Engineering Department Suitability of A Model to a Data Set…

Embed Size (px)

Citation preview

Page 1: Quality of Curve Fitting P M V Subbarao Professor Mechanical Engineering Department Suitability of A Model to a Data Set…

Quality of Curve Fitting

P M V SubbaraoProfessor

Mechanical Engineering Department

Suitability of A Model to a Data Set…..

Page 2: Quality of Curve Fitting P M V Subbarao Professor Mechanical Engineering Department Suitability of A Model to a Data Set…

Goodness of fit and the correlation coefficient

• A measure of how good the regression curve as a representation of the data.

• It is possible to fit two curves to data by • (a) treating x as the independent variable : y=ax+b, y as

the dependent variable or by• (b) treating y as the independent variable and x as the

dependent variable. • This is described by a relation of the form x= a'y +b'. • The procedure followed earlier can be followed again to

find best values of a’ and b’.

Page 3: Quality of Curve Fitting P M V Subbarao Professor Mechanical Engineering Department Suitability of A Model to a Data Set…

N

iii

N

ii

N

ii yxybya

11

'

1

2'

N

ii

N

ii xNbya

1

'

1

'

In matrix form

N

iii

N

ii

N

ii

N

ii

N

ii

yx

x

a

b

yy

yN

1

1

'

'

1

2

1

1

N

iii

N

ii

N

ii yxxbxa

111

2

N

ii

N

ii ybNxa

11

N

iii

N

ii

N

ii

N

ii

N

ii

yx

y

a

b

xx

xN

1

1

1

2

1

1

Page 4: Quality of Curve Fitting P M V Subbarao Professor Mechanical Engineering Department Suitability of A Model to a Data Set…

Recast the second fit line as:

'

'

'

1

a

bx

ay

'

1

ais the slope of this second line, which not same as the first line

2

11

2

111'''

N

ii

N

ii

N

ii

N

ii

N

iii

yyN

yxyxNabyax

Page 5: Quality of Curve Fitting P M V Subbarao Professor Mechanical Engineering Department Suitability of A Model to a Data Set…

•The ratio of the slopes of the two lines is a measure of how good the form of the fit is to the data.•In view of this the correlation coefficient ρ defined through the relation

'2

line Regression second of Slope

line Regressionfirst of slopeaa

Page 6: Quality of Curve Fitting P M V Subbarao Professor Mechanical Engineering Department Suitability of A Model to a Data Set…

2

11

2

111'''

N

ii

N

ii

N

ii

N

ii

N

iii

yyN

yxyxNabyax

2

11

2

111

N

ii

N

ii

N

ii

N

ii

N

iii

xxN

yxyxNabaxy

Page 7: Quality of Curve Fitting P M V Subbarao Professor Mechanical Engineering Department Suitability of A Model to a Data Set…

2

11

2

2

11

2

2

1112

N

ii

N

ii

N

ii

N

ii

N

ii

N

ii

N

iii

yyNxxN

yxyxN

2

11

2

2

11

2

111

N

ii

N

ii

N

ii

N

ii

N

ii

N

ii

N

iii

yyNxxN

yxyxN

Page 8: Quality of Curve Fitting P M V Subbarao Professor Mechanical Engineering Department Suitability of A Model to a Data Set…

Correlation Coefficient

• The sign of the correlation coefficient is determined by the sign of the covariance.

• If the regression line has a negative slope the correlation coefficient is negative

• while it is positive if the regression line has a positive slope. • The correlation is said to be perfect if ρ = ± 1.• The correlation is poor if ρ ≈ 0.• Absolute value of the correlation coefficient should be greater

than 0.5 to indicate that y and x are related!• In the case of a non-linear fit a quantity known as the index of

correlation is defined to determine the goodness of the fit. • The fit is termed good if the variance of the deviates is much

less than the variance of the y’s. • It is required that the index of correlation defined below to be

close to ±1 for the fit to be considered good.

Page 9: Quality of Curve Fitting P M V Subbarao Professor Mechanical Engineering Department Suitability of A Model to a Data Set…

N

i

N

ii

i

N

iii

N

yy

xfy

1

2

1

1

2

1

Page 10: Quality of Curve Fitting P M V Subbarao Professor Mechanical Engineering Department Suitability of A Model to a Data Set…

2=1.000 2=0.991 2=0.904

2=0.821 2=0.493 2=0.0526

Page 11: Quality of Curve Fitting P M V Subbarao Professor Mechanical Engineering Department Suitability of A Model to a Data Set…

Multi-Variable Regression Analysis

• Cases considered so far, involved one independent variable and one dependent variable.

• Sometimes the dependent variable may be a function of more than one variable.

• For example, the relation of the form

• is a common type of relationship for flow through an Orifice or Venturi.

• mass flow rate is a dependent variable and others are independent variables.

pipe

orifice

d

dApTpfm ,,,,

Page 12: Quality of Curve Fitting P M V Subbarao Professor Mechanical Engineering Department Suitability of A Model to a Data Set…

Set up a mathematical model as:e

pipe

orificedcb

d

dAp

RT

pam

Taking logarithm both sides

pipe

orifice

d

deAdpc

RT

pbam lnlnlnlnlnln

Simply: eodncmblay ln

where y is the dependent variable, l, m, n, o and p are independent variables and a, b, c, d, e are the fit parameters.

Page 13: Quality of Curve Fitting P M V Subbarao Professor Mechanical Engineering Department Suitability of A Model to a Data Set…

The least square method may be used to determine the fit parameters.

Let the data be available for set of N values of y, l, m, n, o, p values.

The quantity to be minimized is given by

N

iiiiiii fpeodncmblayError

1

2

What is the permissible value of N ?

Page 14: Quality of Curve Fitting P M V Subbarao Professor Mechanical Engineering Department Suitability of A Model to a Data Set…

The normal linear equations are obtained by the usual process of setting the first partial derivatives with respect to the fit parameters to zero.

N

iiiiiii fpeodncmblay

a

Error

1

02

N

iiiiiiii fpeodncmblayl

b

Error

1

02

Page 15: Quality of Curve Fitting P M V Subbarao Professor Mechanical Engineering Department Suitability of A Model to a Data Set…

N

ii

N

ii

N

ii

N

ii

N

ii

N

ii ypfoendmclbNa

111111

N

iii

N

iii

N

iii

N

iii

N

iii

N

ii

N

ii ylplfolenldmlclbla

111111

2

1

These equations are solved simultaneously to get the six fit parameters.

We may also calculate the index of correlation as an indicator of the quality of the fit. This calculation is left to you!

Page 16: Quality of Curve Fitting P M V Subbarao Professor Mechanical Engineering Department Suitability of A Model to a Data Set…

Power Law Curve for Multi Variable Regression

AnalysisTrue Power of Power Law……

Page 17: Quality of Curve Fitting P M V Subbarao Professor Mechanical Engineering Department Suitability of A Model to a Data Set…

Newton’s Law of Viscosity/Cooling

• 1701: Sir Newton published a paper titled: Scala Graduum Caloris.

• How to Realize the Law?• A general heat transfer surface may not be isothermal !?!• Fluid temperature will vary from inlet to exit !?!?!• The local velocity of flow will also vary from inlet to exit ?!?!• How to use Newton’s Law in a Real life?

Page 18: Quality of Curve Fitting P M V Subbarao Professor Mechanical Engineering Department Suitability of A Model to a Data Set…

Scale Analysis

Define characteristic parameters:

L : length

u ∞ : free stream velocity

T ∞ : free stream temperature

CA, ∞ : free stream concentration of species A

Page 19: Quality of Curve Fitting P M V Subbarao Professor Mechanical Engineering Department Suitability of A Model to a Data Set…

General parameters:

x, y : positions (independent variables)

u, v : velocities (dependent variables)

T : temperature (dependent variable)

C : species concentration (dependent variable)

also, recall that momentum requires a pressure gradient for the movement of a fluid:

p : pressure (dependent variable)

Page 20: Quality of Curve Fitting P M V Subbarao Professor Mechanical Engineering Department Suitability of A Model to a Data Set…

Define dimensionless variables:

L

xx *

L

yy *

u

uu*

u

vv*

s

s

TT

TT

sAA

sAA

CC

CCC

A

,,

,*

2*

u

pp

Page 21: Quality of Curve Fitting P M V Subbarao Professor Mechanical Engineering Department Suitability of A Model to a Data Set…

Similarity parameters can be derived that relate one set of flow conditions to geometrically similar surfaces for a different set of flow conditions:

Page 22: Quality of Curve Fitting P M V Subbarao Professor Mechanical Engineering Department Suitability of A Model to a Data Set…

0*

*

*

*

x

v

x

u

2*

*2

*

*

*

**

*

**

Re

1

y

u

x

p

y

vv

x

uu

L

2*

2

**

**

PrRe

1

yyv

xu

L

2*

*2

*

**

*

**

Re

1

y

C

Scy

Cv

x

Cu

AAA

L

Page 23: Quality of Curve Fitting P M V Subbarao Professor Mechanical Engineering Department Suitability of A Model to a Data Set…

Reynolds Analogy

2*

*2

*

**

*

**

Re

1

y

u

y

vv

x

uu

L

2*

2

**

**

Re

1

yyv

xu

L

2*

*2

*

**

*

**

Re

1

y

C

y

Cv

x

Cu

AAA

L

Page 24: Quality of Curve Fitting P M V Subbarao Professor Mechanical Engineering Department Suitability of A Model to a Data Set…

Reynolds Analogy

**ACu

At the wall :

*

*

**

*

y

C

yy

u A

Page 25: Quality of Curve Fitting P M V Subbarao Professor Mechanical Engineering Department Suitability of A Model to a Data Set…

Prandtl’s Momentum Boundary Layer

Page 26: Quality of Curve Fitting P M V Subbarao Professor Mechanical Engineering Department Suitability of A Model to a Data Set…

Define a parameter that describes a dimensionless temperature gradient at a fluid-surface interface:

Pr,,Re,*

**

0*

* dx

dpxf

k

hL

yNu L

fluidy

Local Nusselt Number:

Average Nusselt Number

Pr,,Re

*

*

dx

dpfNu Lavg

Page 27: Quality of Curve Fitting P M V Subbarao Professor Mechanical Engineering Department Suitability of A Model to a Data Set…

Define a parameter that describes a dimensionless concentration gradient at a fluid-surface interface:

Scdx

dpxf

D

Lh

y

CSh L

AB

m

y

A ,,Re,*

**

0

*

*

*

Local Sherwood Number:

Average Sherwood Number

Sc

dx

dpfSh Lavg ,,Re

*

*

Page 28: Quality of Curve Fitting P M V Subbarao Professor Mechanical Engineering Department Suitability of A Model to a Data Set…

Boundary Layer Analogies

• Heat and Mass Transfer Analogy:

• Two or more processes governed by dimensionless equations of the same form.

• Accordingly heat and mass transfer relations for a particular geometry are interchangeable.

nL

fluidy

prdx

dpxf

k

hL

yNu

*

**

0*

,Re,*

nL

AB

m

y

A Scdx

dpxf

D

Lh

y

CSh

*

**

0

*

*

,Re,*

Page 29: Quality of Curve Fitting P M V Subbarao Professor Mechanical Engineering Department Suitability of A Model to a Data Set…

then

nn Sc

ShNu

Pr

Page 30: Quality of Curve Fitting P M V Subbarao Professor Mechanical Engineering Department Suitability of A Model to a Data Set…

ShNuC f 2

Re

Replacing Nu and Sh by The Stanton number (St) and mass transfer Stanton number (Stm) respectively,

PrRe

Nu

VC

hSt

p

Sc

Sh

V

hSt m

m Re

mf StSt

C

2

Page 31: Quality of Curve Fitting P M V Subbarao Professor Mechanical Engineering Department Suitability of A Model to a Data Set…

Closing Remarks

• The goal of any experimental activity is to get the maximum realistic information about a system.

• It is not always true that higher number of measurements will give maximum realistic information.

• Larger the number of measurements, huge will be the total error that enters into the measurement equation.

• Larger number of measurements lead to more costly experimentation.

• It is important to obtain maximum realistic information with the minimum number of well designed experiments.

• An experimental program recognizes the major “factors” that affect the outcome of the experiment.

• The factors may be identified by looking at all the quantities that may affect the outcome of the experiment.

Page 32: Quality of Curve Fitting P M V Subbarao Professor Mechanical Engineering Department Suitability of A Model to a Data Set…

• The most important among these may be identified using a few exploratory experiments or

• from past experience or based on some underlying theory or hypothesis.

• The next thing one has to do is to choose the number of levels for each of the factors.

• The data will be gathered for these values of the factors by performing the experiments by maintaining the levels at these values.