Plotting Curves with a Spreadsheet Wilfrid Laurier University Terry Sturtevant January 30, 2014

advertisement
Introduction
Plotting Curves with a Spreadsheet
Wilfrid Laurier University
Terry Sturtevant
Wilfrid Laurier University
January 30, 2014
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
Using a spreadsheet to graph data is convenient once you know
what you’re doing, and even plotting error bars and straight lines is
relatively simple.
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
Using a spreadsheet to graph data is convenient once you know
what you’re doing, and even plotting error bars and straight lines is
relatively simple.
However, once you need to plot data which is not linear, things
become a bit more complicated.
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
Consider the data here:
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
Consider the data here:
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
First of all, the graph does not have error bars.
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
First of all, the graph does not have error bars.
However it it also not smooth.
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
First of all, the graph does not have error bars.
However it it also not smooth.
Error bars have not been shown so that the smoothness of the
curve can be seen easily.
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
First of all, the graph does not have error bars.
However it it also not smooth.
Error bars have not been shown so that the smoothness of the
curve can be seen easily.
As always, error bars should be included unless you are
specifically told to omit them.
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
You might be tempted to do this:
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
You might be tempted to do this:
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
You might be tempted to do this:
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
You might be tempted to do this:
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
You might be tempted to do this:
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
You might be tempted to do this:
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
You might be tempted to do this:
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
Dot-to-dot drawings do not usually belong in scientific
reports!
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
Dot-to-dot drawings do not usually belong in scientific
reports!
Smooth curves are usually more appropriate.
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
Dot-to-dot drawings do not usually belong in scientific
reports!
Smooth curves are usually more appropriate.
The following discussion should help you to use a spreadsheet to
produce non–linear plots.
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
Displaying Curves
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
Displaying Curves
A line can be drawn by simply connecting its endpoints.
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
Displaying Curves
A line can be drawn by simply connecting its endpoints.
A curve can be approximated by a series of very short line
segments between points along the curve.
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
Displaying Curves
A line can be drawn by simply connecting its endpoints.
A curve can be approximated by a series of very short line
segments between points along the curve.
If the points are close enough, the line will look smooth.
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
If we wish to plot a curve in a spreadsheet, proceed as follows:
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
If we wish to plot a curve in a spreadsheet, proceed as follows:
Instead of just using two values, xmin and xmax , for an x–series,
create a series of values xi , i = 0 . . . N where
xmax − xmin
xi = xmin + i
N
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
If we wish to plot a curve in a spreadsheet, proceed as follows:
Instead of just using two values, xmin and xmax , for an x–series,
create a series of values xi , i = 0 . . . N where
xmax − xmin
xi = xmin + i
N
so that
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
If we wish to plot a curve in a spreadsheet, proceed as follows:
Instead of just using two values, xmin and xmax , for an x–series,
create a series of values xi , i = 0 . . . N where
xmax − xmin
xi = xmin + i
N
so that
x0 = xmin
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
If we wish to plot a curve in a spreadsheet, proceed as follows:
Instead of just using two values, xmin and xmax , for an x–series,
create a series of values xi , i = 0 . . . N where
xmax − xmin
xi = xmin + i
N
so that
x0 = xmin
and
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
If we wish to plot a curve in a spreadsheet, proceed as follows:
Instead of just using two values, xmin and xmax , for an x–series,
create a series of values xi , i = 0 . . . N where
xmax − xmin
xi = xmin + i
N
so that
x0 = xmin
and
xN = xmax
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
If we wish to plot a curve in a spreadsheet, proceed as follows:
Instead of just using two values, xmin and xmax , for an x–series,
create a series of values xi , i = 0 . . . N where
xmax − xmin
xi = xmin + i
N
so that
x0 = xmin
and
xN = xmax
and for each point
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
If we wish to plot a curve in a spreadsheet, proceed as follows:
Instead of just using two values, xmin and xmax , for an x–series,
create a series of values xi , i = 0 . . . N where
xmax − xmin
xi = xmin + i
N
so that
x0 = xmin
and
xN = xmax
and for each point
yi = f (xi )
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
Consider the example, with N = 5:
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
Consider the example, with N = 5:
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
Consider the example, with N = 5:
x0
x0 = xmin
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
Consider the example, with N = 5:
x0
x5
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
x5 = xmax
Introduction
Displaying Curves
Piecewise Defined Functions
Consider the example, with N = 5:
x0
x1 = x0 + 1
xmax −xmin
5
x1
x5
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
Consider the example, with N = 5:
x0
x2 = x0 + 2
xmax −xmin
5
x1
x2
x5
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
Consider the example, with N = 5:
x0
x3 = x0 + 3
xmax −xmin
5
x1
x2
x3
x5
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
Consider the example, with N = 5:
x0
x4 = x0 + 4
xmax −xmin
5
x1
x2
x3
x4
x5
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
Calculate the points on the curve:
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
Calculate the points on the curve:
u
f (x0 )
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
Calculate the points on the curve:
u
u
f (x1 )
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
Calculate the points on the curve:
u
u
u
Terry Sturtevant
f (x2 )
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
Calculate the points on the curve:
u
u
u
u
Terry Sturtevant
f (x3 )
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
Calculate the points on the curve:
u
u
u
u
u
Terry Sturtevant
f (x4 )
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
Calculate the points on the curve:
u
u
u
u
u
u
Terry Sturtevant
f (x5 )
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
Joint the points on the curve with line segments:
u
f (x0 )
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
Joint the points on the curve with line segments:
u
u
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
Joint the points on the curve with line segments:
u
u
u
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
Joint the points on the curve with line segments:
u
u
u
u
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
Joint the points on the curve with line segments:
u
u
u
u
u
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
Joint the points on the curve with line segments:
u
u
u
u
u
u
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
The final product:
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
The final product:
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
The final product:
Obviously if we used more points we could make it much smoother.
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
The final product:
Obviously if we used more points we could make it much smoother.
(Like this.)
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
Note that even though the x values for the first and last point are
taken from the original data, the y values are not, since the
purpose is to find points on the curve.
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
Note that even though the x values for the first and last point are
taken from the original data, the y values are not, since the
purpose is to find points on the curve.
A value of 100 for N should be sufficient to make a smooth curve.
If not, make it bigger. You can try making it smaller if that many
points aren’t needed.
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
Note that even though the x values for the first and last point are
taken from the original data, the y values are not, since the
purpose is to find points on the curve.
A value of 100 for N should be sufficient to make a smooth curve.
If not, make it bigger. You can try making it smaller if that many
points aren’t needed.
1
For each of the xi , calculate the corresponding yi value from
the curve equation and add this series to the graph.
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
Note that even though the x values for the first and last point are
taken from the original data, the y values are not, since the
purpose is to find points on the curve.
A value of 100 for N should be sufficient to make a smooth curve.
If not, make it bigger. You can try making it smaller if that many
points aren’t needed.
1
For each of the xi , calculate the corresponding yi value from
the curve equation and add this series to the graph.
2
Remove the markers and add lines for this series. All points in
this series will thereby be joined with line segments. You
should be able to produce a graph such as the following.
(Error bars have been left off for simplicity. They can be
produced in the usual way.)
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
Note that in the graph shown, none of the data points actually fall
on the curve. This is often the case.
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
Note that in the graph shown, none of the data points actually fall
on the curve. This is often the case.
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
Piecewise Defined Functions
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
Piecewise Defined Functions
In some cases, a curve must be made from data which must
be fit to different equations in different regions.
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
Piecewise Defined Functions
In some cases, a curve must be made from data which must
be fit to different equations in different regions.
In this case the trick comes in trying to join the two fit
equations smoothly.
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
Piecewise Defined Functions
In some cases, a curve must be made from data which must
be fit to different equations in different regions.
In this case the trick comes in trying to join the two fit
equations smoothly.
Here’s an example where two lines have to join.
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Terry Sturtevant
Displaying Curves
Piecewise Defined Functions
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Terry Sturtevant
Displaying Curves
Piecewise Defined Functions
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
H
Y
H
Linear portion here
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Terry Sturtevant
Displaying Curves
Piecewise Defined Functions
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
Linear portion here
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Terry Sturtevant
Displaying Curves
Piecewise Defined Functions
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
A
K
A
Smooth curve to join
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Terry Sturtevant
Displaying Curves
Piecewise Defined Functions
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
K
A
A
y and y 0 need to match
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Terry Sturtevant
Displaying Curves
Piecewise Defined Functions
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
y and y 0 need to match
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Terry Sturtevant
Displaying Curves
Piecewise Defined Functions
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
In this case,
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
In this case,
f (x) =
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
In this case,
f (x) =
(
F1 (x), if x ≤ x1 ;
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
In this case,
(
F1 (x), if x ≤ x1 ;
f (x) =
F2 (x), if x ≥ x2 .
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
In this case,
(
F1 (x), if x ≤ x1 ;
f (x) =
F2 (x), if x ≥ x2 .
where x2 > x1 .
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
To make the function f (x) continuous, we require that
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
To make the function f (x) continuous, we require that
f (x1 ) = F1 (x1 )
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Displaying Curves
Piecewise Defined Functions
Introduction
To make the function f (x) continuous, we require that
f (x1 ) = F1 (x1 )
and
f (x2 ) = F2 (x2 )
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
To produce a smooth fit, then in addition we require that
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
To produce a smooth fit, then in addition we require that
f 0 (x1 ) = F1 0 (x1 )
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Displaying Curves
Piecewise Defined Functions
Introduction
To produce a smooth fit, then in addition we require that
f 0 (x1 ) = F1 0 (x1 )
and
f 0 (x2 ) = F2 0 (x2 )
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
For two straight lines, this becomes:
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
For two straight lines, this becomes:
f (x1 ) = m1 x1 + b1
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
For two straight lines, this becomes:
f (x1 ) = m1 x1 + b1
f (x2 ) = m2 x2 + b2
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
For two straight lines, this becomes:
f (x1 ) = m1 x1 + b1
f (x2 ) = m2 x2 + b2
f 0 (x1 ) = m1
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
For two straight lines, this becomes:
f (x1 ) = m1 x1 + b1
f (x2 ) = m2 x2 + b2
f 0 (x1 ) = m1
f 0 (x2 ) = m2
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
These 4 equations can be solved exactly by a polynomial in 4
unknowns,
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
These 4 equations can be solved exactly by a polynomial in 4
unknowns, i.e. an equation of the form
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
These 4 equations can be solved exactly by a polynomial in 4
unknowns, i.e. an equation of the form
f (x) = αx 3 + βx 2 + γx + δ
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
These 4 equations can be solved exactly by a polynomial in 4
unknowns, i.e. an equation of the form
f (x) = αx 3 + βx 2 + γx + δ
and therefore
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
These 4 equations can be solved exactly by a polynomial in 4
unknowns, i.e. an equation of the form
f (x) = αx 3 + βx 2 + γx + δ
and therefore
f 0 (x) = 3αx 2 + 2βx + γ
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
To solve this, we need to set up a system of equations as follows: If
we let
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
To solve this, we need to set up a system of equations as follows: If
we let
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
To solve this, we need to set up a system of equations as follows: If
we let
 3

x1
x1 2 x1 1
 x2 3 x2 2 x2 1

A=
3x1 2 2x1 1 0
3x2 2 2x2 1 0
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
To solve this, we need to set up a system of equations as follows: If
we let
 3

x1
x1 2 x1 1
 x2 3 x2 2 x2 1

A=
3x1 2 2x1 1 0
3x2 2 2x2 1 0
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
To solve this, we need to set up a system of equations as follows: If
we let
 3

x1
x1 2 x1 1
 x2 3 x2 2 x2 1

A=
3x1 2 2x1 1 0
3x2 2 2x2 1 0
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
To solve this, we need to set up a system of equations as follows: If
we let
 3

x1
x1 2 x1 1
 x2 3 x2 2 x2 1

A=
3x1 2 2x1 1 0
3x2 2 2x2 1 0
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
To solve this, we need to set up a system of equations as follows: If
we let
 3

x1
x1 2 x1 1
 x2 3 x2 2 x2 1

A=
3x1 2 2x1 1 0
3x2 2 2x2 1 0
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Displaying Curves
Piecewise Defined Functions
Introduction
and
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
and


F1 (x1 )
 F2 (x2 ) 

B=
F1 0 (x1 )
F2 0 (x2 )
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
and


F1 (x1 )
 F2 (x2 ) 

B=
F1 0 (x1 )
F2 0 (x2 )
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
and


F1 (x1 )
 F2 (x2 ) 

B=
F1 0 (x1 )
F2 0 (x2 )
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
and


F1 (x1 )
 F2 (x2 ) 

B=
F1 0 (x1 )
F2 0 (x2 )
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
and


F1 (x1 )
 F2 (x2 ) 

B=
F1 0 (x1 )
F2 0 (x2 )
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
Then it should be clear that
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
Then it should be clear that
AX = B
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Displaying Curves
Piecewise Defined Functions
Introduction
Then it should be clear that
AX = B
or
X = A−1 B
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
where
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
where
Displaying Curves
Piecewise Defined Functions
 
α
β 

X = 
γ 
δ
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
where
Displaying Curves
Piecewise Defined Functions
 
α
β 

X = 
γ 
δ
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
where
Displaying Curves
Piecewise Defined Functions
 
α
β 

X = 
γ 
δ
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
where
Displaying Curves
Piecewise Defined Functions
 
α
β 

X = 
γ 
δ
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
where
Displaying Curves
Piecewise Defined Functions
 
α
β 

X = 
γ 
δ
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
For two straight lines this becomes
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
For two straight lines this becomes


m1 x1 + b1
m2 x2 + b2 

B=


m1
m2
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
For two straight lines this becomes


m1 x1 + b1
m2 x2 + b2 

B=


m1
m2
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
For two straight lines this becomes


m1 x1 + b1
m2 x2 + b2 

B=


m1
m2
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
For two straight lines this becomes


m1 x1 + b1
m2 x2 + b2 

B=


m1
m2
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
For two straight lines this becomes


m1 x1 + b1
m2 x2 + b2 

B=


m1
m2
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
(F1 0 (x1 ) can be determined by using x1 and the fit point
immediately to its left, and F2 0 (x2 ) can be determined by using x2
and the fit point immediately to its right.)
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
(F1 0 (x1 ) can be determined by using x1 and the fit point
immediately to its left, and F2 0 (x2 ) can be determined by using x2
and the fit point immediately to its right.)
This system can then be solved using the matrix invert and
multiply features of a spreadsheet.
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Introduction
Displaying Curves
Piecewise Defined Functions
Note: This will produce a smooth graph; whether it produces an
accurate graph remains to be seen, (although smooth transitions
are more common than others).
Terry Sturtevant
Plotting Curves with a Spreadsheet Wilfrid Laurier University
Download