Post on 06-Apr-2018
8/2/2019 3 Excel Trendline
http://slidepdf.com/reader/full/3-excel-trendline 1/20
Trendline Analysis
• Experimental measurements are never
perfect which results in data “scatter”
• From an inspection of a plot of the data, it
is apparent that there is a clear “trend” in
the dependent variable y ( x ) with respect to
the independent parameter x .
• A “trendline” analysis is used to find the
best “fit” of a function or best choice of a
set of coefficients for a function to match
the trend indicated by the data.
• For the example shown, the functional
form is a second order polynomial,
• MS Excel automatically determines that
the polynomial best represents or fits the
data when the coefficients are
cbxax y 2
8810
9416
9440
.
.
.
c
b
a
y = 0.944x2 - 6.941x - 10.88
R² = 0.965
-200
0
200
400
0 10 20 30
y ( x ) - ( d e p e
n d e n t p a r a m e t e r )
x - (independent parameter)
Trendline Analysis
exper imental data
2nd order polynomial
8/2/2019 3 Excel Trendline
http://slidepdf.com/reader/full/3-excel-trendline 2/20
y = 0.944x2 - 6.941x - 10.88
R² = 0.965
-200
0
200
400
0 10 20 30
y ( x ) - ( d e p e
n d e n t p a r a m e t e r )
x - (independent parameter)
Trendline Analysis
exper imental data
2nd order polynomial
Trendline Analysis
The trendline analysis uses a “least squares”
curve fitting procedure.
• the deviation of the i th data point is the
difference between the value of thedependent variable y i at x i and the curve
fitting function f() evaluated at x i .
• the coefficients a, b, and c in f ( x ) are
chosen to minimized the total sum of the
deviations squared,
iii x f yd
n
iid S
1
2
8/2/2019 3 Excel Trendline
http://slidepdf.com/reader/full/3-excel-trendline 3/20
inlet
exit
motor
The function of a water pump is to
cause an increase in the fluid pressureas it passes through the pump.
The pressure increase depends on the
flow rate and the pump speed. In a
pump test, these parameters must be
measured.
inlet
pressure
transducer
exit
inP
out V computerized
DACQ
A pressure transducer is used to
“transform” the pressure differential
across the pump into a proportional
voltage. The voltage is measured and
recorded by the computerized data
acquisition system (DACQ).
A calibration is need to establish the
relationship between the pressure
input to the transducer and the output
voltage.
Transducer Calibration
8/2/2019 3 Excel Trendline
http://slidepdf.com/reader/full/3-excel-trendline 4/20
Transducer Calibration
• apply known pressure differentials to
the transducer and measure the
corresponding transducer output
voltage
(known pressures might be determined
by using another previously calibrated
pressure measurement system)• Apply a Trendline Analysis to find the
best fit of a linear curve fit equation to
the data
fitcurvefromfound
offsetzero
ysensitivit
0
0
0
V a
V
a
V PaV
,
• Use the calibrated pressure transducer
to determine unknown pressures by
measuring the transducer output
voltage and applying the calibration
relation
01
V V aP
8/2/2019 3 Excel Trendline
http://slidepdf.com/reader/full/3-excel-trendline 5/20
• Type in the data values shown
• Create the table headings and
format the table as shown
• Plot the data on a Scatter Plot
(refer to the previous tutorial as
necessary)
• Format the plot as shown:
axis range,
tick mark intervals,
tick mark type,
number format
horizontal & vertical gridlines
data point marker style
8/2/2019 3 Excel Trendline
http://slidepdf.com/reader/full/3-excel-trendline 6/20
Add a Trendline to the plot by:
• right-click on a data point
marker and select Add
Trendline from the popup
window• select a Linear curve fit
• set the Trendline Name for
the plot legend
• display the curvefit equation
on the plot
•display the r-squared valueon the plot (indicates how
well the curve fit matches
the data - the closer it is to
one, the better the fit)
8/2/2019 3 Excel Trendline
http://slidepdf.com/reader/full/3-excel-trendline 7/20
Change the format for the Trendline
Label by:
• right-clicking on the label
• select Format Trendline Label• select the Number option group
and choose the Scientific format
with 3 decimal places
• select the Fill option group and
choose a Solid Fill with the Color
set to White
• select the Border Color option
group and choose a Solid Line with
the Color set to Black
8/2/2019 3 Excel Trendline
http://slidepdf.com/reader/full/3-excel-trendline 8/20
We have established the relationship
between the pressure applied to the
transducer and it’s corresponding voltageoutput.
In a normal experimental application, an
unknown pressure will be applied to the
transducer and the calibration equation
will be used to find the pressure from themeasured voltage.
offsetzeroV0.1195
ysensitivitPa
V00220
0
0
V
a
V PaV
.
01
V V a
P
8/2/2019 3 Excel Trendline
http://slidepdf.com/reader/full/3-excel-trendline 9/20
• Start a new worksheet Sheet2
•
Create a data table: type in the measured
transducer output voltages
enter the coefficients
determined from the trendline
analysis
enter the formula to calculatethe pressures corresponding to
each voltage
complete the table formatting
as shown
•
Create a plot of the pressures withthe formatting shown
8/2/2019 3 Excel Trendline
http://slidepdf.com/reader/full/3-excel-trendline 10/20
0
2000
4000
6000
8000
0 20 40 60
y ( x ) = 3 * x ^ 2
x
Power Law y = a*x^b, b>1
Power Law Trendlines
• Many processes of interest to engineers
follow a power-law relationship,
• The plot above is for a power-law
relationship with an exponent greater
than 1.
b xa y
0
20
40
60
80
0 200 400 600
y ( x ) = 3 * x ^ 0 . 5
x
Power Law y = a*x^b, b<1
•
The plot above illustrates the typicaltrend for a power-law variation with an
exponent less than 1.
8/2/2019 3 Excel Trendline
http://slidepdf.com/reader/full/3-excel-trendline 11/20
10
100
1000
10000
1 10 100
y ( x ) = 3 * x ^ 2
x
Power Law y = a*x^b, b>1
1
10
100
10 100 1,000
y ( x ) = 3
* x ^ 0 .
5
x
Power Law y = a*x^b, b<1
Log-Log Plots
•
Data that follows a power-law is oftenshown on a log-log plot. This is the same
data that was presented on the previous
slide.
• Note that the data follows a linear trend on
the log-log plot.
•
On log-log plots, the distance along an axisis proportional to the log of the parameter.
8/2/2019 3 Excel Trendline
http://slidepdf.com/reader/full/3-excel-trendline 12/20
10
100
1000
10000
1 10 100
y ( x ) = 3 * x ^ 2
x
Power Law y = a*x^b, b>1
Log-Log Plots• On log-log plots, the distance along an axis is
proportional to the log of the parameter.
• Taking the log of the power-law relation,
note that log y is linear with respect log x.
• Since the difference between log(100) and
log(10) is the same as the difference
between log(1000) and log(100), it follows
that the distance between the corresponding
tick marks is the same.
• The minor grid lines from 1-10 are 2, 3, 4,etc.and from 10-100 are 20, 30, 40, etc.
• Note that the coordinates for the first 3
points are (5,75), (10,300), and (15,675).
a xb y
xa yb
logloglog
loglog
8/2/2019 3 Excel Trendline
http://slidepdf.com/reader/full/3-excel-trendline 13/20
To find the trendline for data that
follows a power-law relationship:
•
key-in the data and format the tableas shown
• create the plot with the formatting
features shown
• right-click on one of the data points
and select Add Trendline from thepopup menu
• set the Trend/Regression Type to
Power
• set the Trendline Name to “power-
law curve fit”
• display the equation and R-squared
value on the plot
8/2/2019 3 Excel Trendline
http://slidepdf.com/reader/full/3-excel-trendline 14/20
• Format the trendline label as shown
• right-click on the x-axis and select
format axis
• turn-on the auto-scaling
• select the Logarithmic Scale
• repeat these selections for the y-axis
8/2/2019 3 Excel Trendline
http://slidepdf.com/reader/full/3-excel-trendline 15/20
• select Major & Minor Gridlines for
the vertical and horizontal axis
8/2/2019 3 Excel Trendline
http://slidepdf.com/reader/full/3-excel-trendline 16/20
The final forma of the plot
8/2/2019 3 Excel Trendline
http://slidepdf.com/reader/full/3-excel-trendline 17/20
Exponential Trendlines
• Many processes of interest to engineers
follow an exponential relationship,
• The plot above is for an exponential
relationship with a positive exponent .
• The process is described as exponential
growth.
bxea y
• The plot above illustrates the typical
trend for an exponential process with anegative exponent.
• The process is described as exponential
decay.
0
100
200
300
0 5 10 15 20
y = 8 * e x p ( 0 . 2
* x )
x
Exponential, y = a*exp(b*x), b>0
0
2
4
6
8
0 5 10 15 20
y = 8 * e x p ( - 0 . 2
* x )
x
Exponential, y = a*exp(b*x), b<0
8/2/2019 3 Excel Trendline
http://slidepdf.com/reader/full/3-excel-trendline 18/20
Semi-Log Plots
•
Data that follows an exponential variation isoften shown on a semi-log plot. This is the
same data that was presented on the
previous slide.
• Note that the data follows a linear trend on
the semi-log plot.
•
On semi-log plots, the distance along the x-axis is proportional to the parameter and
distance along the y-axis is proportional to
the log of the parameter
1
10
100
1000
0 5 10 15 20
y = 8 * e x p ( 0 . 2
* x )
x
Exponential, y = a*exp(b*x), b>0
0
1
10
0 5 10 15 20
y = 8 * e x p ( - 0 . 2
* x )
x
Exponential, y = a*exp(b*x), b<0
8/2/2019 3 Excel Trendline
http://slidepdf.com/reader/full/3-excel-trendline 19/20
Log-Log Plots• On semi-log plots, the distance along the y-
axis is proportional to the log of the
parameter and along the x-axis, the distanceis proportional to the parameter.
• Taking the log of the exponential relation,
note that log y is linear with respect x.
a xeb yaebx y
ea y bx
loglogloglogloglog
loglog
1
10
100
1000
0 5 10 15 20
y = 8 * e x p ( 0 . 2
* x )
x
Exponential, y = a*exp(b*x), b>0
8/2/2019 3 Excel Trendline
http://slidepdf.com/reader/full/3-excel-trendline 20/20
On Sheet4 of your workbook:
•
Create and format the datatable as shown.
• Create and format the plot
as shown – you will choose
the Exponential Trendline
Type.