Você está na página 1de 50

CHE 317

COMPUTER
PACKAGES FOR
CHEMICAL ENGINEERS

10/22/14

CHE 317 presentation. Prepared by Dr. A.O.


Ayeni

SPREADSHEET
FOR ENGINEERS
USING
EXCEL
10/22/14

CHE 317 presentation. Prepared by Dr. A.O.


Ayeni

Usefulness of spreadsheet
programmes
Has special features for solving many
problems arising in engineering analysis.
It can be used to determine roots of algebraic
equations, fitting curves through data sets,
analysing data statistically, engineering
economic analysis,solving optimization
problems etc.

10/22/14

CHE 317 presentation. Prepared by Dr. A.O.


Ayeni

Engineering analysis
This involves a systematic process for
analysing and understanding problems in
engineering.
A preliminary understanding of a problem is
needed for efficient analysis.

10/22/14

CHE 317 presentation. Prepared by Dr. A.O.


Ayeni

How do I solve the problem


Think before trying to solve the problem.
Try to draw a sketch of the problem before
solving it.
Understand the overall purpose of the
problem.
Ask yourself what information is known and
which one is not known.
What fundamental engineering principle
applies to the problem.
10/22/14

CHE 317 presentation. Prepared by Dr. A.O.


Ayeni

Think on how to solve the problem before you


start to solve it. Note that many problems can
be solved in many different ways.
Develop your solution in an orderly and logical
manner.
Does your solution make a sense? Think about
it.
Is the solution presented in an orderly
manner?.

10/22/14

CHE 317 presentation. Prepared by Dr. A.O.


Ayeni

How do I solve a problem?

What is the overall purpose of problem


What information is known.
What information needed to be determined.
What engineering principle is needed?
What is the solution strategy?

10/22/14

CHE 317 presentation. Prepared by Dr. A.O.


Ayeni

Some mathematical solution


procedures
Data analysis techniques: these are simple
statistical techniques as calculating the mean,
median, modes, standard deviations, and
histograms
Curve fitting techniques: This involves passing
a curve through aggregate of data rather than
through individual data points.

10/22/14

CHE 317 presentation. Prepared by Dr. A.O.


Ayeni

Interpolation techniques: Helps to obtain


accurate values for the dependent variable
when the corresponding independent variable
falls within a set of tabulated data points.
Techniques for solving simultaneous linear
algebraic equations.
Techniques for solving integrals.
Techniques for engineering economic analysis.
Optimization techniques.

10/22/14

CHE 317 presentation. Prepared by Dr. A.O.


Ayeni

Approaches to solution procedures


Classical methods through the use of algebra
and calculus.
Computer solutions for complicated problems:
using;
1. symbolic procedures which resembles the
classical method. Most times too complex to
be of any practical valu.
2. Numerical procedures results in solutions
expressed in terms of numbers(or graphs
based on the numbers)
10/22/14

CHE 317 presentation. Prepared by Dr. A.O.


Ayeni

10

Numerical solutions can usually be obtained


quickly and easily, even for large and
complicated problems.

10/22/14

CHE 317 presentation. Prepared by Dr. A.O.


Ayeni

11

Features of Excel spreadsheet


A page of excel is called worksheet
The worksheet is divided into columns and
rows.
Each row is numbered, and each coumn is
identified with a letter.
The intercession of a row and column defines
a cell.

10/22/14

CHE 317 presentation. Prepared by Dr. A.O.


Ayeni

12

In entering your data you make them


descriptive through labeling. For example
R1 = Resistance 1
V1 = Volumetric flow 1
Any active cell in excel is outlined
automatically by a rectangular block.
Title bar
Menu bar
Standard tool bar
10/22/14

CHE 317 presentation. Prepared by Dr. A.O.


Ayeni

13

Formatting tool bar


Formula bar.
Task pane.
Worksheet tabs.
Status bar.
Horizontal scroll bar.
Vertical scroll bar.
Getting help.
The mouse/cursor is positioned in any active
place on the spreadsheet.

10/22/14

CHE 317 presentation. Prepared by Dr. A.O.


Ayeni

14

Numerical numbers are entered as ordinary


numbers. For example, these can be entered
as:
2, -6, 3.33, 2.55E-12, -7.08E+6, 0.0, 0.004, -1.2e7, 4E8, 1e10
Arithmetic operations:
+ = addition, A1+B1
- = substraction, A1-B1
* = Multiplication
10/22/14

CHE 317 presentation. Prepared by Dr. A.O.


Ayeni

15

/ = Division, A1/B1
^ = Exponentiation, A1^3
% = Percentage (divide by 100) A1%

Place exercises here!

10/22/14

CHE 317 presentation. Prepared by Dr. A.O.


Ayeni

16

GRAPHING DATA
Its one of the most common tasks carried out
with a spreadsheet program.
Excel can generate a wide variety of graphs.
The graphs are referred to as charts.
We have;
Bar graphs (Column charts)
Line graphs (Line charts)
X-Y graphs (Scatter charts or XY charts).
These are the graphs most commonly used in
engineering applications.
10/22/14

CHE 317 presentation. Prepared by Dr. A.O.


Ayeni

17

Engineers refer to the horizontal axis (the xaxis) as the abscissa and the vertical axis (yaxis) as ordinate.
In excel the horizontal axis is called either the
Category Axis or the Value Axis depending on
the chart type.
CREATING A GRAPH
1. Select a block of contiguous cells containing
the data to be plotted (the source data).
2. The selection may include column headings or
row labels.
10/22/14

CHE 317 presentation. Prepared by Dr. A.O.


Ayeni

18

Click on insert.
Click on chart.
Select a chart type as appropriate.
A graph can be activated by clicking on it.
It can be dragged to any location when
activated.

10/22/14

CHE 317 presentation. Prepared by Dr. A.O.


Ayeni

19

In choosing graph type, note;


Data selected must be appropriate to the type
of graph desired.
A bar graph or line graph may be appropriate
for a single set of data.
An x-y graph should be used to represent a set
of x-values and a corresponding set of yvalues.
BAR CHART
Questions and solutions
10/22/14

CHE 317 presentation. Prepared by Dr. A.O.


Ayeni

20

Line Graphs

They are used to represent single-valued data.


This is different from graphs based upon
paired data points(where each data point is
defined in unique x- and y value)
Data points within a line are interconnected
by a curve or by a straight line segments.
Note that selection of data goes on to affect
the outlook of the graphs.
Place Questions and Solutions.
10/22/14

CHE 317 presentation. Prepared by Dr. A.O.


Ayeni

21

X-Y GRAPHS
Its created by passing a line or a curve through
a series of paired data points.
Each paired data point consists of an x-value
and a y-value; hence, the same x-y graph.
Most engineering and scientific data are
recorded as paired data points and displayed
in the form of x-y graphs.
Do not confuse x-y graphs with line graphs.
Place questions and answers here.
10/22/14

CHE 317 presentation. Prepared by Dr. A.O.


Ayeni

22

SEMI-LOG GRAPHS
Sometimes we use logarithmic coordinates
when plotting y against x.
A graph in which the y-axis (the ordinate) has
a log scale and the x-axis (the abscissa) has an
arithmetic scale is known as semi-log graph.
They are commonly used in engineering,
chemistry, physics, biology

10/22/14

CHE 317 presentation. Prepared by Dr. A.O.


Ayeni

23

Why do we need a semi-log plot?


1. The range of y-values can be much greater
spanning several orders of magnitude (i.e.
several powers of 10)
2. The exponential equation y
Y = aebx
appears as a straight line when it is plotted on a
semi-log graph. Some variations also occur as
Y = a(1-ebx)
10/22/14

CHE 317 presentation. Prepared by Dr. A.O.


Ayeni

24

Therefore, if a data set shows up as a straight


line when plotted on a semi-log graph, we can
conclude that an exponential-type equation
will best represent the data.
In excel, a semi-log graph can easily be
generated from an ordinary(arithmetic) x-y
graph, provided the y-values are all positive.
This can be performed by a click on the y-axis
and check the box labelled log scale from the
Format menu.
10/22/14

CHE 317 presentation. Prepared by Dr. A.O.


Ayeni

25

ANALYSING DATA
Engineers gather data to measure variability
or consistency.
Measured data tell us in interpreting the
results.
Tedious arithmetic must be carried out in
order to interpret the results, particularly for
large data set.

10/22/14

CHE 317 presentation. Prepared by Dr. A.O.


Ayeni

26

Data Characteristics

Commonly used parameters to draw


conclusions about the characteristics of a data
set are mean, median, mode, min, max,
variance, and standard variation.
MEAN: most commonly used characteristics of
the data. It shows the expected behaviour of a
data set. In excel, the AVERAGE function is
used to determine the mean, e.g.
=AVERAGE(B1:B12), determines the mean
between cell B1 to B12.
10/22/14

CHE 317 presentation. Prepared by Dr. A.O.


Ayeni

27

MEDIAN: This is the value such that half the


data values lie above and half lie below.
Median function is used to determine the
median, =MEDIAN(B1:B12), detyermines the
median values from cell B1 to B12.
MODE: The value that occurs with the greatest
frequency within a data set, =MODE(B1:B12)
MIN and MAX: simply indicates the
extremities of the data set, =MIN(B1:B12),
=MAX(B1:B12). It returns the values that are
the smallest and the largest algebraically not
in magnitude.
10/22/14

CHE 317 presentation. Prepared by Dr. A.O.


Ayeni

28

e.g. -5, -2, 1, min function returns -5(smallest


algebraically) and max returns 1, the largest
algebraically.
VARIANCE: Provides an indication for the
degree of spread in the data. The greater the
variance, the greater the spread. VAR function
is used to determine the variance,
=VAR(B1:B12) returns the variance of the
numerical values in cells B1 through B12.

10/22/14

CHE 317 presentation. Prepared by Dr. A.O.


Ayeni

29

STANDARD DEVIATION
It also provides a measure of spread in the
data set. It is the square root of the variance.
If variance is large, SD is large. If variance is
small, SD will also be small.
To determine the a value for the SD, you must
first calculate the variance. In excel, the STDEV
returns the standard deviation of its
arguments, =STDEV(B1:B12) returns for cells
B1 to B12.
10/22/14

CHE 317 presentation. Prepared by Dr. A.O.


Ayeni

30

Excel can generate a summary of all applicable


descriptive statistics for a given data set (i.e.
one or more columns or rows of numerical
data)
Place problems here.

10/22/14

CHE 317 presentation. Prepared by Dr. A.O.


Ayeni

31

Histogram
Through this plot, data are plotted in a
manner that illustrates how the values are
distributed within their range.
It is also called relative frequency plot. From
this plot we can obtain a plot of cumulative
distribution.
Cumulative distribution allows us to estimate
the likelihood that a data value associated
with an item drawn at random is less than or
greater than some specified value.
10/22/14

CHE 317 presentation. Prepared by Dr. A.O.


Ayeni

32

FITTING EQUATIONS TO DATA


Paired data are common in engineering in
order to understand the characteristics of an
object or the behaviour of a system.
Many functions in engineering are often
developed graphically.
Data that represent measured values usually
show some scatter, which is due to
fluctuations or errors in the measurements.
Therefore, fitting a curve through the data
makes the curve to pass through the
aggregate data rather than individual data
points
10/22/14

CHE 317 presentation. Prepared by Dr. A.O.


Ayeni

33

Most times outliers(occasional isolated data


points that are far removed from the main
cluster possibly because of erroneous
measurements) are disregarded.
The fitting of curve allows us to capture the
overall trend reflected by the entire data set.
The goal is to determine the equation of a
curve that represents the aggregate of the
data.
The use of the method of least squares is a
commonly used method for fitting a straight
line or a curve to a set of data.
10/22/14

CHE 317 presentation. Prepared by Dr. A.O.


Ayeni

34

Least square curve fitting


Open a new worksheet and enter the x-data
(the independent variable) in the leftmost
column.
Enter the y-data (the dependent variable) in
the next column.
Plot the data as an X-Y graph (i.e. an XY chart)
with arithmetic coordinates. Do not
interconnect the individual data points.
Click on one of the plotted points, then
choose Add Trendline from the chart menu.
10/22/14

CHE 317 presentation. Prepared by Dr. A.O.


Ayeni

35

You may also right-click on any data point and


select Add Trendline.
You can specify the type of curve, any request
any pertninent options from the ensuing
dialog box.
You can request the equation of the curve and
its associated r2 value.
You may force the curve through a specified
intercept or extrapolate the curve fir forward
or backward.
Press OK button. The curve fitting is carried
out and results displayed automatically.
10/22/14

CHE 317 presentation. Prepared by Dr. A.O.


Ayeni

36

Regression features
The Analysis Toolpak provides for the
regression features.
It fits a straight line (called regression line) to a
set of data using the method of least squares.
The output includes coefficients of the
regression line equation, the sum of the
squares of errors, the r2 value, optional
outputs can also be requested( listing
individual error term called the residuals and a
plot of the data).
10/22/14

CHE 317 presentation. Prepared by Dr. A.O.


Ayeni

37

However, from the engineers perspective, the


regression feature may provide too much
statistical information in the output summary.
Most of the output may be confusing.
The trendline feature provides a more
straightforward approach to the problem of
fitting a straight line through a set of data.

10/22/14

CHE 317 presentation. Prepared by Dr. A.O.


Ayeni

38

Fitting other functions


Exponential function
We note that many different phenomena in
engineering is governed by the exponential
function, e.g.
Y = aebx
Which we can obtain to be
ln y = ln a + bx, which is an equation of a straight
line.
Therefore, we can fit an exponential function to a
set of data by proceeding in the step of plotting a
straight line graph.
10/22/14

CHE 317 presentation. Prepared by Dr. A.O.


Ayeni

39

In fitting an exponential function in excel, we


select the an exponential trendline instead of
the select for the straight line treadline.
Examples.
Logarithmic function
Is an equation of the form
Y = a lnx +b
In excel, the procedure for passing logarithmic
trendline through a given data set is identical
10/22/14

CHE 317 presentation. Prepared by Dr. A.O.


Ayeni

40

to that for straight line or an exponential


function except that the logarithm option is
selected for the type of trendline.
However, the function can only be used with
data set in which the values of the
independent variable (x-variable) are positive
since logarithm are undefined for zeros or
negative values.
Logarithmic function in engineering is relatively
uncommon.
10/22/14

CHE 317 presentation. Prepared by Dr. A.O.


Ayeni

41

Power function
Its an equation of the form
Y = axb
Place example.
If one or more data points are nonpositive, the
power icon will be inactive

10/22/14

CHE 317 presentation. Prepared by Dr. A.O.


Ayeni

42

Polynomial function
They are functions as
Y = C1 + C2X + C3X2 + + Ck+1Xk
K = degree of polynomial
K+1 = solutions of K+1 simultaneous equations.
Fitting a cubic equation involves solving four
equations in four unknowns.

10/22/14

CHE 317 presentation. Prepared by Dr. A.O.


Ayeni

43

Solving equations in excel using Goal seek


Goal seek feature permits rapid solutions of
algebraic equations using iterative (trial and
error) root finding technique, based upon
series of successive approximations derived
from an initial guess.
The accuracy of each successive value is
refined until the values converge to a stable
solution.

10/22/14

CHE 317 presentation. Prepared by Dr. A.O.


Ayeni

44

Enter the initial guess.


Enter a formula for the equation, in the form
f(x)=0 in another cell, expressing the formula
with the initial guess.
Select Goal seek dialog box from the tool
menu.
Enter the information in the dialog box
accordingly.
Select OK after appropriate entry.
A new box showing the Goal seek status
appears.
10/22/14

CHE 317 presentation. Prepared by Dr. A.O.


Ayeni

45

The value in the cell containing the formula


will show a value that is close to zero but not
actually zero.
Likely of obtaining a converge solution will be
enhanced if the initial guess is as close as
possible to the desired root.
An initial guess can be approximated using the
graphical or tabular technique (guess a range
of e.g. 0 x2 and see a point if f(x) =0 or
close to it). The x-value that make f(x) almost
0 can be the initial guess.
10/22/14

CHE 317 presentation. Prepared by Dr. A.O.


Ayeni

46

A warning message will be generated if the


computation does not converge of if an
inappropriate value (such as square root of a
negative number) is about to be generated in
the course of the computation.
If formula is not entered correctly in excel, an
error message is also displayed.

10/22/14

CHE 317 presentation. Prepared by Dr. A.O.


Ayeni

47

Using solver for solution


The solver can also be used to perform the
same operation as the goal seek method.
Enter the guess value
Enter equation in another cell.
Select solver from the tools menu.
To restrict the range of x, click the add button
under the heading Subject to constraint.
Then, provide the following information
within the add constraint dialog box
10/22/14

CHE 317 presentation. Prepared by Dr. A.O.


Ayeni

48

The address of the cell containing the initial


value for x in the cell reference location.
Specify the type of constraint less than or
equal to, or you choose greater than or equal
to.
Enter the bounding value in the constraint
data area. Then select OK to return to the
solver parameter dialog box.
When all the required information has been
correctly entered, select solve.
10/22/14

CHE 317 presentation. Prepared by Dr. A.O.


Ayeni

49

10/22/14

CHE 317 presentation. Prepared by Dr. A.O.


Ayeni

50

Você também pode gostar