Sei sulla pagina 1di 134

ENCE 202

FORTRAN
Handout 1
Introduction to FORTRAN
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

by

Dr. Ibrahim A. Assakkaf


ENCE 202
Spring 2000
Department of Civil and Environmental Engineering
University of Maryland

Dr. Assakkaf
Slide No. 1

ENCE 202
FORTRAN
Handout 1
Introduction
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n FORTRAN
FORTRAN = FORmula TRANslation
Developed for the IBM 704 Computer
Developed by John Backus and a team of
13 other programmers
Developed between 1954 and 1957

Dr. Assakkaf
Slide No. 2

1
ENCE 202
FORTRAN
Handout 1
Introduction
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n FORTRAN is a high-level language


such as BASIC, C, and C++
n A compiler translates each statement in
the program into a sequence of basic
machine language instruction

X = A* B + C
Dr. Assakkaf
Slide No. 3

ENCE 202
FORTRAN
Handout 1
Introduction
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

Source Program
(high level language)

Compiler
Object Program
(machine language)

Dr. Assakkaf
Slide No. 4

2
ENCE 202
FORTRAN
Handout 1
Program Development
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n A program consists of
Input
An execution logic (computation)
Output
n A flow chart is used to develop the
structure

Dr. Assakkaf
Slide No. 5

ENCE 202
FORTRAN
Handout 1
Program Development
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n EXAMPLE 1: Volume of a Cylinder


Input:
Diameter, D
Height, h
Computation
D 2
V= h
4

Output:
Volume, V

Dr. Assakkaf
Slide No. 6

3
ENCE 202
FORTRAN
Handout 1
Program Development
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Flow Chart for Example 1

CALCULATE:
V
OUTPUT:
ENTER:
BEGIN Display END
D and h 2
D Volume(V)
V= h
4

A flow chart is a block diagram that summarizes


the program structure and logic flow

Dr. Assakkaf
Slide No. 7

ENCE 202
FORTRAN
Handout 1
Program Development
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n EXAMPLE 2: Height of a Cylinder


Input:
Diameter, D
Volume, V
Computation
4V
h=
2
D

Output:
Height, h

Dr. Assakkaf
Slide No. 8

4
ENCE 202
FORTRAN
Handout 1
Program Development
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Flow Chart for Example 2


CALCULATE:
V
OUTPUT:
ENTER:
BEGIN 4V Display END
D and V
h= Height(h)
2
D

A flow chart is a block diagram that summarizes


the program structure and logic flow

Dr. Assakkaf
Slide No. 9

ENCE 202
FORTRAN
Handout 1
Fundamentals of FORTRAN
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n The following is a format of a simple


program:
PROGRAM NAME
Opening documentation use
Variables declaration
Program statements
END

Dr. Assakkaf
Slide No. 10

5
ENCE 202
FORTRAN
Handout 1
Fundamentals of FORTRAN
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n FORTRAN Statements
Positions 7 to 72 of a line can be used. To
continue on the next line, use any character on
position 6 of the next line
n Constants
Examples
-12
1.2345
12.45-e10

Dr. Assakkaf
Slide No. 11

ENCE 202
FORTRAN
Handout 1
Fundamentals of FORTRAN
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

1 2 3 4 5 6 7 8
1234567890123456789012345678901234567890123456789012345678901234567890 1234567890
C

Statement in columns 7 to 72

Column 73
Character different from 0 or blank in column 6 And beyond
Indicates a continuation of the preceding line Are ignored

Statement labels in columns 1 to 5

C or * in column 1 indicates a comment


Dr. Assakkaf
Slide No. 12

6
ENCE 202
FORTRAN
Handout 1
Fundamentals of FORTRAN
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Data Types
Integer
Real
Double Precision
Complex
Character
Logical

Dr. Assakkaf
Slide No. 13

ENCE 202
FORTRAN
Handout 1
Fundamentals of FORTRAN
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Variables
Variables starts with a letter
The first letter defines the variable type
Integer or real
The default types are
I, J, K, L, M, and N
These are integers variables if they are used as
the first letter in names
Otherwise, they are treated as real variables

Dr. Assakkaf
Slide No. 14

7
ENCE 202
FORTRAN
Handout 1
Fundamentals of FORTRAN
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Type Statements
REAL list of variables
INTEGER list of variables
CHARACTER*n list of variables with size
n (default n = 1)
PARAMETER (param1 = value1, param2 =
value2, .etc)
DATA list1/data1/, list2/data2/, , listn/datan?

Dr. Assakkaf
Slide No. 15

ENCE 202
FORTRAN
Handout 1
Fundamentals of FORTRAN
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Examples: Type statements


REAL X, Speed, Height
INTEGER I, M, Q
CHARACTER*2 Var1, Var2
PARAMETER (PI = 3.14159, E = 2.71)
DATA w/1.3/, x,y/2.3, 5.6/
DATA w,x,y/1.3, 2.3, 5.6

Dr. Assakkaf
Slide No. 16

8
ENCE 202
FORTRAN
Handout 1
Fundamentals of FORTRAN
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Arithmetic Operations
Addition +
Subtraction -
Multiplication *
Division /
Exponentiation **
Example:
Area = (3.14)*(D**2)/4

Dr. Assakkaf
Slide No. 17

ENCE 202
FORTRAN
Handout 1
Fundamentals of FORTRAN
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Priority Rules
** from right to left
* and / from left to right
+ and - from left to right

NOTE:
To avoid confusion, always use parentheses

Dr. Assakkaf
Slide No. 18

9
ENCE 202
FORTRAN
Handout 1
Fundamentals of FORTRAN
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Standard Library Functions


Examples
SQRT (argument), Square Root
ABS (x), Absolute value
COS (y) Cosine of argument
LN(x) Natural Logarithm
Etc.

Dr. Assakkaf
Slide No. 19

ENCE 202
FORTRAN
Handout 1
Fundamentals of FORTRAN
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Assignment Statements

Variable = expression

Examples
x = 0.234
y = sqrt(x) / 2 + height**3

Dr. Assakkaf
Slide No. 20

10
ENCE 202
FORTRAN
Handout 1
Fundamentals of FORTRAN
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n List-directed Input and Output

PRINT *, output-list (separators are commas)

n Examples:
PRINT * (print a blank line)
PRINT *, Test, Test Test, Test
PRINT *, Interest =, Int Interest = 5

Dr. Assakkaf
Slide No. 21

ENCE 202
FORTRAN
Handout 1
Fundamentals of FORTRAN
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n List-directed Input and Output


READ *, input-list (separators are commas)
n Examples:
PRINT *, Enter Velocity and Time?
READ *, VELOC0, TIME
READ *, Int, A
Note: It is a good practice to prompt the user that
input is needed, using PRINT statement before
READ with prompt information
Dr. Assakkaf
Slide No. 22

11
ENCE 202
FORTRAN
Handout 1
Example: Simple Program
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n This program calculates the velocity and


height of a projectile given its initial
height, velocity,and constant
acceleration
1 2
Height : h = at + v0t + h0
2
Velocity : v = at + v0

Dr. Assakkaf
Slide No. 23

ENCE 202
FORTRAN
Handout 1
Example: Simple Program
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

PROGRAM PROJECT

C This program calculates the velocity and height of a projectile given its
C initial height, initial velocity, and constant acceleration. Variables used are:
C HGHT : initial height
C HGHT : height at any time
C VELOC : initial vertical velocity
C VELOC : vertical velocity at any time
C ACCEL : vertical acceleration (Gravity)
C TIME : time elapsed since projectile was launched

REAL HGHT , HGHT, VELOC , VELO, ACCEL, TIME

ACCEL = - .
PRINT *, `Enter initial height, initial velocity, and time?`
READ *, HGHT , VELOC , TIME

HGHT = . * ACCEL * TIME ** +VELOC * TIME + HGHT


VELOC = ACCEL * TIME + VELOC

PRINT *, `AT TIME `, TIME, ` THE VERTICAL VELOCITY IS `, VELOC


PRINT *, `AND THE HEIGHT IS `, HGHT
END

Dr. Assakkaf
Slide No. 24

12
ENCE 202
FORTRAN
Handout 2
Introduction to FORTRAN
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

by

Dr. Ibrahim A. Assakkaf


ENCE 202
Spring 2000
Department of Civil and Environmental Engineering
University of Maryland

Dr. Assakkaf
Slide No. 1

ENCE 202
FORTRAN
Handout 2
Structured Programming
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Control Structures
In a structured program, the logical flow
can be of the following types:
Sequential straight-line programs
Selection If statements
Repetition Do loops

Dr. Assakkaf
Slide No. 2

1
ENCE 202
FORTRAN
Handout 2
Structured Programming
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Logical Expressions
Relational Operators
Expression-1 relational-operator expression-2
Relational Operators are:
.LT. Is less than
.GT. Is greater than
.EQ. Is equal to
.LE. Is less than or equal to
.GE. Is greater than or equal to
.NE. Is not equal to

Dr. Assakkaf
Slide No. 3

ENCE 202
FORTRAN
Handout 2
Structured Programming
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Logical Operators
They can be used to combine the previous
operators or negate them
Logical operators are:
.NOT. negation
.AND. both true
.OR. one is true
.EQV. both true or false
.NEQV. negation of .EQV.

Dr. Assakkaf
Slide No. 4

2
ENCE 202
FORTRAN
Handout 2
Structured Programming
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Logical IF Statement
IF(logical-expression) statement

Logical
Statement TRUE
Expression

FALSE

Example
IF (1.5 .LE. X .AND. X .LE. 2.5) PRINT *, X
Dr. Assakkaf
Slide No. 5

ENCE 202
FORTRAN
Handout 2
Structured Programming
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Block IF Statement
Type I
IF (logical-expression) THEN
statement 1
statement 2 Block-1 Logical
Block 1 TRUE
Expression
:
:
FALSE

END IF

Dr. Assakkaf
Slide No. 6

3
ENCE 202
FORTRAN
Handout 2
Structured Programming
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Block IF Statement
Example: Type 1

IF (X .GT. 0) THEN
Y=X*X
Z = SQRT (X)
Slope = TAN (Z)
END IF

Dr. Assakkaf
Slide No. 7

ENCE 202
FORTRAN
Handout 2
Structured Programming
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Block IF Statement
Type II
IF (logical-expression) THEN
Block-1
Logical
Block 1 TRUE
ELSE Expression

Block-2 FALSE

END IF Block 2

Dr. Assakkaf
Slide No. 8

4
ENCE 202
FORTRAN
Handout 2
Structured Programming
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

Sample runs:

n Example: Type II ENTER 3 POLLUTION READINGS:


55, 39, 48
PROGRAM POLLUT SAFE CONDITION
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
C Program that reads 3 pollution LEVELS, calculates a pollution INDEX as their ENTER 3 POLUTION READINGS:
C average, and then displays a safe condition message if this index is less than some 68, 49, 57
C CUTOFF value, otherwise displays a hazardous condition message. HAZARDOUS CONDITION
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC

INTEGER CUTOFF, LEVEL1, LEVEL2, LEVEL3, INDEX


PARAMETER (CUTOFF = 50)

PRINT *, ` ENTER 3 POLLUTION READINGS:`


READ *, LEVEL1, LEVEL2, LEVEL3
INDEX = (LEVEL! + LEVEL2 + LEVEL3) / 3.0
IF (INDEX .LT. CUTOFF) THEN
PRINT *, `SAFE CONDITION`
ELSE
PRINT *, `HAZARDOUS CONDITION`
END IF
END

Dr. Assakkaf
Slide No. 9

ENCE 202
FORTRAN
Handout 2
Structured Programming
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Nested IF Statements
They are used for multi-alternative selection
structure as follows:
IF (logical-expression-1) THEN
Block-1
ELSE
IF (logical-expression-2) THEN
Block-2
ELSE
Block-3
END IF
END IF

Dr. Assakkaf
Slide No. 10

5
ENCE 202
FORTRAN
Handout 2
Structured Programming
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Nested IF Statements
An alternative format for the previous nested IF
structures is as follows:
IF (logical-expression-1) THEN
Block-1
ELSE IF (logical-expression-2) THEN
Block-2
ELSE IF (logical-expression-3) THEN
Block-3
:
ELSE
Block-n
END IF
Dr. Assakkaf
Slide No. 11

ENCE 202
FORTRAN
Handout 2
Structured Programming
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Repetition Structure (The DO and


CONTINUE statements)
DO n, control-variable = initial-value, limit, step-size
statement
:
DO n, control-
: variable =
Exit initial-value, loop
n continue limit, step-
size

Body

NOTE that the default for step size =1


Also, note that statement number must be in columns 1 to 5
Dr. Assakkaf
Slide No. 12

6
ENCE 202
FORTRAN
Handout 2
Structured Programming
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Nested DO Loops
Legal Structure Illegal Structure

DO 5, I = 1, 10 DO 5, I = 1, 10
Statement-Set-1 Statement-Set-1
DO 6, J = 1, 5 DO 6, J = 1, 5
Statement-Set-2 Statement-Set-2
6 CONTINUE 5 CONTINUE
Statement-Set-3 Statement-Set-3
5 CONTINUE 6 CONTINUE

DO 5, I = 1, 10 DO 5, I = 1, 10
Statement-Set-1 Statement-Set-1
IF (expression) THEN IF (expression) THEN
Statement-Set-2 Statement-Set-2
END IF 5 CONTINUE
Statement-Set-3 END IF
5 CONTINUE Statement-Set-3

Dr. Assakkaf
Slide No. 13

ENCE 202
FORTRAN
Handout 2
Structured Programming
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n The WHILE (repetition) Statement


The WHILE loop is similar to the DO loop with
unknown number of repetitions. The number of
repetitions is determined by a logical expression.
Two forms for WHILE statement can be used:
Form I of WHILE Loop Form II of WHILE Loop

WHILE (logical expression) DO DO WHILE (logical expression)


statements Statements
: :
: :
END WHILE END DO

Dr. Assakkaf
Slide No. 14

7
ENCE 202
FORTRAN
Handout 2
Structured Programming
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n GO TO Statement
Form I
n IF (logical-expression) THEN
Statements
:
:
GO TO n
END IF

Dr. Assakkaf
Slide No. 15

ENCE 202
FORTRAN
Handout 2
Structured Programming
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n GO TO Statement
Form II
n statements
:
:
IF (logical-expression) GO TO n

NOTE: Standard FORTRAN does not include a WHILE statement. Nevertheless, this
Important control structure can be implemented in standard FORTRAN by using a
GO TO statement within an IF construct

Dr. Assakkaf
Slide No. 16

8
ENCE 202
FORTRAN
Handout 2
Structured Programming
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Examples: DO WHILE & GO TO


DO WHILE GO TO
(standard Fortran)

DO WHILE (SUM .LE. LIMIT) 10 IF (SUM .LE. LLIMIT) THEN


NUMBER = NUMBER + 1 NUMBER = NUMBER + 1
SUM = SUM + NUMBER SUM = SUM + NUMBER
END DO GO TO 10
END IF

Dr. Assakkaf
Slide No. 17

ENCE 202
FORTRAN
Handout 2
Input and Output
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Non-formatted input and output was


discussed earlier
n Formatted Output
There are two output statement in
FORTRAN, the PRINT statement and the
WRITE statement. The PRINT statement
is the simpler of the two and has the form

PRINT format-identifier, output-list

Dr. Assakkaf
Slide No. 18

9
ENCE 202
FORTRAN
Handout 2
Input and Output
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n EXAMPLE: Formatted Output


PRINT 10, N, Y, Z
10 FORMAT (list of format descriptors)

OR

10 FORMAT (1X, I5, 2F8.2)


NOTE: the 2 is to repeat the instruction

Dr. Assakkaf
Slide No. 19

ENCE 202
FORTRAN
Handout 2
Input and Output
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Control Characters
I = integer
F = real number in decimal format
E = real number in scientific format
D = F or E input/output, depending on value
nX = horizontal spacing
/ = vertical spacing
A = character data
Example:
FORMAT (1X, 2(A, F6.2)) Dr. Assakkaf
Slide No. 20

10
ENCE 202
FORTRAN
Handout 2
Input and Output
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Formatted Input
The READ statement is for reading from the
default input device (such as the keyboard)

READ format-identifier, input-list

It is common to use non-formatted (or called free


format) read as follows:

READ *, input-list

Dr. Assakkaf
Slide No. 21

ENCE 202
FORTRAN
Handout 2
Input and Output
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n The WRITE Statement


This statement is used to write to output files

WRITE (control-list) output-list

Control-list consists of the following:


unit-specifier for output device such as printers (*prints
on screen)
Format-identifier statement (*means free format)

Dr. Assakkaf
Slide No. 22

11
ENCE 202
FORTRAN
Handout 2
Input an Output
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n EXAMPLES: WRITE Statement

WRITE (6, *) X, Y
WRITE (UNIT = 6, FMT = *) X, Y
WRITE (*, *) X, Y
same as PRINT *, X, Y

Dr. Assakkaf
Slide No. 23

ENCE 202
FORTRAN
Handout 2
Input and Output
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n The General READ Statement

READ (control-list) input-list


n Examples:
READ (UNIT = 5, FMT = *) X, Y
READ (5, *) X, Y
READ (*, *) X, Y ==> same as READ, * X, Y
READ (12, *, END = 50) X, Y
The last statement means go to statement 50 when the end of data is encountered
Dr. Assakkaf
Slide No. 24

12
ENCE 202
FORTRAN
Handout 2
Input and Output
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n File Processing
It is common to have a need for large
input/output. Files can be on magnetic
tapes, disks, or hard drive. Using files
requires the following steps:
To open an existing file or create a new file:
OPEN (open-list)
To close a file:
CLOSE (close-list)

Dr. Assakkaf
Slide No. 25

ENCE 202
FORTRAN
Handout 2
Input and output
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Example: File Processing

OPEN (UNIT = 13, FILE = `File-name`, SATAUS = `NEW`)


(You may use also STATUS = `OLD` to open an existing file)

CLOSE (13)
(where 13 is the unit number

Dr. Assakkaf
Slide No. 26

13
ENCE 202
FORTRAN
Handout 2
Input and Output
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n File Processing
Other features
REWIND unit
(go to initial point for unit such as 13 (use a
number))

BACKSPACE unit
(go to the beginning of preceding record in unit
such as 13 (use a number))

Dr. Assakkaf
Slide No. 27

14
ENCE 202
FORTRAN
Handout 3
Introduction to FORTRAN
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

by

Dr. Ibrahim A. Assakkaf


ENCE 202
Spring 2000
Department of Civil and Environmental Engineering
University of Maryland

Dr. Assakkaf
Slide No. 1

ENCE 202
FORTRAN
Handout 3
Nonnumeric Data Types
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Logical Data Type


Logical variables can take one of the
following two values
.TRUE.
.FALSE.
Declare logical variables using:

LOGICAL list-of-variables

Dr. Assakkaf
Slide No. 2

1
ENCE 202
FORTRAN
Handout 3
Nonnumeric Data Type
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Logical Data Type


Assignment Statements
logical-variable = logical-expression
e.g.
X = .TRUE.
Y=x
Logical Operators
.NOT. .AND. .OR. .EQV. .NEQV.

Dr. Assakkaf
Slide No. 3

ENCE 202
FORTRAN
Handout 3
Nonnumeric Data Type
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Logical Data Type


Examples
Z = X .OR. Y
Z = (X .LT. 1.5) .AND. .NOT. Y
The latter statement means assign the value
true to Z if an only if X < 1.5 and Y is false.
Note X = real variable, Y = logical variable

Dr. Assakkaf
Slide No. 4

2
ENCE 202
FORTRAN
Handout 3
Character Data Type
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Declare using the type statement


CHARACTER *n, list
where n = length of each variable in the list
Examples:
X = `COMPUTER`
X (4:6) = `PUT`
They are treated like arrays
X ( :4) = `COMP` (default is 1 for the first #)
X (n:n+2) = `COM` (for n = 1)
Dr. Assakkaf
Slide No. 5

ENCE 202
FORTRAN
Handout 3
Character Data Type
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

We can compare character values using


.LT., .GT., .EQ., .LE., and .NE. They are
based on the sequence of ASCEII number
equivalent.
Printing Logical Values

PRINT *, A, B

Dr. Assakkaf
Slide No. 6

3
ENCE 202
FORTRAN
Handout 3
One Dimensional Arrays
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Variables can be classified as:


Simple Variables
data structure or arrays
n To establish a data structure use
DIMENSION X(1:10)
REAL X
OR
REAL X(10)
DIMENSION X(10)
Dr. Assakkaf
Slide No. 7

ENCE 202
FORTRAN
Handout 3
One Dimensional Arrays
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

which means that X can take values X(1), X(2), ...


X(10). In general, the statement is as follows:

DIMENSION List

The list consists of array-name (l : u), where l =


lower size, and u = upper size as integers. l and u
are integers, e.g., -2, -1, 3, 10, 1000, 0.

Dr. Assakkaf
Slide No. 8

4
ENCE 202
FORTRAN
Handout 3
One dimensional Arrays
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Input and Output of Arrays


Three Methods:
1. Do loops
2. Array names
3. Implied Do loops

Dr. Assakkaf
Slide No. 9

ENCE 202
FORTRAN
Handout 3
One Dimensional Arrays
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Examples: Input and Output of Arrays


Example 1

DIMENSION X(5)
DO 10 I = 1, 5
10 READ *, X (I)

Dr. Assakkaf
Slide No. 10

5
ENCE 202
FORTRAN
Handout 3
One Dimensional Arrays
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Examples: Output and Input of Arrays


Example 2
READ *, X(1), X(2), X(3), X(4), X(5)

Example 3
READ 10, X
10 FORMAT (5F6.1)
Note: It reads X(1) to X(5)

Dr. Assakkaf
Slide No. 11

ENCE 202
FORTRAN
Handout 3
One Dimensional Arrays
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Examples: Output and Input of Arrays


Example 4

READ *, (X(I), I = 1, 5)
or
N=5
READ *, (X(I), I = 1, N)

Dr. Assakkaf
Slide No. 12

6
ENCE 202
FORTRAN
Handout 3
One Dimensional Arrays
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n In general the READ or PRINT can be:

READ *, (input/output list, control-variable = initial value, limit)

PRINT *, (input/output list, control-variable = initial value, limit)

Example
READ (*, *, END = 10) (X(I), I = 1, 100)
The END means that once data are read go to statement number 10

Dr. Assakkaf
Slide No. 13

ENCE 202
FORTRAN
Handout 3
One Dimensional Arrays
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n PARAMETER and DATA Statements


These statements are used to input
constants in programs. The values can be
real, integer, or character

PARAMETER (par1 = val1, par2 = val2, )

Dr. Assakkaf
Slide No. 14

7
ENCE 202
FORTRAN
Handout 3
One Dimensional Arrays
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Examples: PARAMETER Statements


Example
REAL PI
PARAMETER (PS = 3.14)
Example
CHARACTER * (*) X
PARAMETER (X = TEST)
The (*) in the firs statement means that length is the
same as the value of X. In the second statement
the length is 4

Dr. Assakkaf
Slide No. 15

ENCE 202
FORTRAN
Handout 3
One Dimensional Arrays
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n DATA Statement

DATA list1/data1/, list2/data2, ..., listk/datak/

Dr. Assakkaf
Slide No. 16

8
ENCE 202
FORTRAN
Handout 3
One Dimensional Arrays
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Examples: DATA Statements


Example
REAL X(5)
DATA X/1,2,3,4,5/
Example
INTEGER N, I
REAL X(10)
DATA N, (X(I), I = 1, 5)/5, 5 *0.0/

Dr. Assakkaf
Slide No. 17

ENCE 202
FORTRAN
Handout 3
Multi-Dimensional Arrays
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Multi-dimensional arrays can be


declared using DIMENSION statements
or type (e.g., REAL, INTEGER, etc.)
statements.
n Example

REAL array-name (l1 : u1, l2 : u2, ..., lk : uk)

Dr. Assakkaf
Slide No. 18

9
ENCE 202
FORTRAN
Handout 3
Multi-Dimensional Arrays
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Example
REAL X(2,5)
The result of statement is declaring X as a
2 by 5 array. Also, it can declared using
one of the following statements:

DIMENSION X(2, 5)
REAL X(1:2, 1:5)
Dr. Assakkaf
Slide No. 19

ENCE 202
FORTRAN
Handout 3
Multi-Dimensional Arrays
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Processing multi-dimensional arrays


Two-dimensional arrays can be processed
either (1) row-wise, (2) column-wise.
Column-wise processing is the default.
Multi-Dimensional arrays, process them
column wise that is first subscript is varied
first, then second subscript followed by
third ... and so on.

Dr. Assakkaf
Slide No. 20

10
ENCE 202
FORTRAN
Handout 3
Multi-Dimensional Arrays
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Input and Output of Arrays


The input and output of arrays can be
performed using (1) DO loops, (2) array
name, or (3) Implied Do loops
Example
REAL X(4,3)
DO 20 I = 1,4
DO 10 j = 1, 3
READ *, X(I, J)
10 CONTINUE
20 CONTINUE Dr. Assakkaf
Slide No. 21

ENCE 202
FORTRAN
Handout 3
Multi-Dimensional Arrays
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

Example
INTEGER X(2,3)
READ *, X
The above statements results in reading X
column wise. If we read 3, 4, 8, 9, 10, 5,
the result is the following matrix:

3 8 10

4 9 5
Dr. Assakkaf
Slide No. 22

11
ENCE 202
FORTRAN
Handout 3
Multi-Dimensional Arrays
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Example
In general use a read or write statement
with (input/output list, control-variable =
initial-value, limit) as an implied DO loop.
For example

READ*, ((X(I, J), J = 1,4), I = 1,3)



column row

Dr. Assakkaf
Slide No. 23

ENCE 202
FORTRAN
Handout 3
Multi-Dimensional Arrays
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

This is the same as


READ *, (X(I,1), X(I,2), X(I,3), X(I,4)), I = 1, 3)

which is the same as


READ *, X(1,1), X(1,2), X(1,3), X(1,4), X(2,1), X(2,2),
+X(2,3), X(2,4), X(3,1), X(3,2), X(3,3), X(3,4)

Dr. Assakkaf
Slide No. 24

12
ENCE 202
FORTRAN
Handout 4
Introduction to FORTRAN
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

by

Dr. Ibrahim A. Assakkaf


ENCE 202
Spring 2000
Department of Civil and Environmental Engineering
University of Maryland

Dr. Assakkaf
Slide No. 1

ENCE 202
FORTRAN
Handout 4
Functions and Subroutines
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n The objective herein is to use a top-


down approach to solve complex
problems by dividing them into a
structured modular computational form
n The following topics are covered:
(1) standard functions,
(2) statement functions,
(3) function subprograms, and
(4) subroutine subprograms

Dr. Assakkaf
Slide No. 2

1
ENCE 202
FORTRAN
Handout 4
Functions and Subroutines
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Standard (Library) Functions


SIN(x) Sine of x (in radian)
COS(x) Cosine of x (in radian)
TAN(x) Tangent of x (in radian)
LOG(x) Natural logarithm of x
LOG10(x) Common (base 10) logarithm
.
.
Refer to attached Table for more functions
Dr. Assakkaf
Slide No. 3

ENCE 202
FORTRAN
Handout 4
Functions and Subroutines
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Statement Functions
The statement should be used in the same
unit of program where function is used and
immediately after the specification
statements (before any executable
statements).

name (argument-list) = expression

Dr. Assakkaf
Slide No. 4

2
ENCE 202
FORTRAN
Handout 4
Functions and Subroutines
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Statement Functions (contd)


The function name follows the same rules
of variables for type (real or integer). The
argument list can be empty
Example:
REAL A, B, Z, T The result is T = 9
Z(A,B) = A+B
:
X=3
Y=4
T = Z(X,Y) + 2
PRINT *, T Dr. Assakkaf
Slide No. 5

ENCE 202
FORTRAN
Handout 4
Functions and Subroutines
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Function Subprograms
The structure for a function subprogram is the
same as a FORTRAN programs as follows:

FUNCTION name(argument-list)
Declaration part
Subprogram statements
RETURN
END

Dr. Assakkaf
Slide No. 6

3
ENCE 202
FORTRAN
Handout 4
Functions and Subroutines
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n The statement return is not needed all


the time
n It is used to return to the main program
n The computed value goes to the
location were the function was called
n The result from the function is returned
by the function name

Dr. Assakkaf
Slide No. 7

ENCE 202
FORTRAN
Handout 4
Functions and Subroutines
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Example:
FUNCTION F(X,Y,N)
REAL X, Y
INTEGER N
F = X**N + Y**N
RETURN
END

Dr. Assakkaf
Slide No. 8

4
ENCE 202
FORTRAN
Handout 4
Functions and Subroutines
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n The above function of the example can


be called in the main program as
follows:

W = F(A,B+3.0,2)
or
Z = F(R(I),SIN(A),K)

Dr. Assakkaf
Slide No. 9

ENCE 202
FORTRAN
Handout 4
Functions and Subroutines
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

FUNCTION FUNC (...)


Statements
Main Program RETURN
PROGRAM MAIN END
Statements
:
Y=FUNC (...) SUBROUTINE SUB (...)
: Statements
CALL SUBROUTINE SUB RETURN
: END
CALL SUBROUTINE SUB
:
:
END SUBROUTINE SUB (...)
Statements
RETURN
END

Dr. Assakkaf
Slide No. 10

5
ENCE 202
FORTRAN
Handout 4
Subroutines
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Subroutine Subprograms
Similar to Function subprograms with the following
differences:
1.Functions return one value; whereas Subroutines return
no value, one or more values.
2.Returned values by Functions are their names; whereas
Subroutine names do not return values, Subroutine
output is part of the arguments
3.A Function is referenced using its name in an
expression; whereas subroutines are referenced by a
CALL statement

Dr. Assakkaf
Slide No. 11

ENCE 202
FORTRAN
Handout 4
Subroutines
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Structure of Subroutines

SUBROUTINE name(argument-list)
Declaration Part
Subprogram Statements
RETURN
END

Dr. Assakkaf
Slide No. 12

6
ENCE 202
FORTRAN
Handout 4
Subroutines
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n The input and output list is the argument list


which can be empty
n The arrays in a subroutine can be of variable
sizes that are declared using the DIMENSION
or REAL statement (among others) with a
size that is specified by a variable in the
argument list
n In the main program, use CALL subroutine-
name (argument-list) to execute the
subroutine
Dr. Assakkaf
Slide No. 13

ENCE 202
FORTRAN
Handout 4
Subroutines
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Example:
SUBROUTINE MEAN(X,N,Z)
SUM = 0
INTEGER N
REAL X(N), Z, SUM
DO 10 I = I, N
SUM = SUM + X(I)
10 CONTINUE
Z = SUM/N
RETURN
END
Dr. Assakkaf
Slide No. 14

7
ENCE 202
FORTRAN
Handout 4
Subroutines
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n In the main program, the following is


permissible:

REAL Y(100) , AVERAG


M = 10
CALL MEAN(Y,M,AVERAG)

Dr. Assakkaf
Slide No. 15

ENCE 202
FORTRAN
Handout 4
Subroutines
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n COMMON Statement
This statement is used to share information
between main Program and Subprograms and
among subprograms. It takes the following form:

COMMON list

The list is the list of variables or arrays separated


by commas

Dr. Assakkaf
Slide No. 16

8
ENCE 202
FORTRAN
Handout 4
Subroutines
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Example
In the main program, use
COMMON A, B, C
In the subprograms, use
COMMON X, Y, Z
The results of these two statements is that
A takes on the same value as X, B takes
on same values as Y, and C takes on the
same value as Z.

Dr. Assakkaf
Slide No. 17

ENCE 202
FORTRAN
Handout 4
Subroutines
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n In general, the statement can be as follows:


COMMON /name1/list1/ name2/list2 ...
Example:
In the main programs, use
COMMON/N1/ X, Y, Z/N2/A, B, C/N3/D, E, F
In subprogram 1, use
COMMON/N1/ XX, YY, ZZ/N3/DD, EE, FF
In subprogram 2, use
COMMON/N3/DD, EE, FF

Dr. Assakkaf
Slide No. 18

9
ENCE 202
FORTRAN
Handout 4
Double Precision
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Real data are commonly treated using


single precision, i.e., single memory
location for each number which
corresponds to 32-bit word. The result
is an accuracy of about 7 significant
digits. Double precision allows for
doubling the above quantities

Dr. Assakkaf
Slide No. 19

ENCE 202
FORTRAN
Handout 4
Double Precision
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Use a type statement to specify double


precision as follows:
DOUBLE PRECISION Z, X(2, 3)
FUNCTION F(X, Y)
DOUBLE PRECISION F, X, Y
END
n In writing or printing numbers 1.E-3
becomes 1.D-3

Dr. Assakkaf
Slide No. 20

10
ENCE 202
FORTRAN
Handout 4
Double Precision
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n In general, the read and write control is

rDw.d

where
r = repetitions,
w = width, and
d = number of digits

Dr. Assakkaf
Slide No. 21

ENCE 202
FORTRAN
Handout 4
Fortran Application Examples
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Newtons Method (Numerical Analysis)


This program illustrates the Newtons
method on the function:

f ( x) = x 3 3x 2 x + 9 = 0
Calls: NEWT
Output (form Function F)
X=Value of X at current iteration
F=Functional value at x

Dr. Assakkaf
Slide No. 22

11
ENCE 202
FORTRAN
Handout 4
Fortran Application Examples
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

f
p( x) = f ( x0 ) + f ( x0 )( x x0 )

(Tangent line)

Approximation
Given by a
Newton Step f ( x0 )
f ( xi )
xi +1 = xi
f ( xi )
f (x )

x
x1
x0
Dr. Assakkaf
Slide No. 23

ENCE 202
FORTRAN
Handout 4
Fortran Application Examples
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

PROGRAM NEWTON
X0=-2.0
EPS=0.00001
C
C SUBROUTINE NEWT IS USED TO FIND A
C ROOT STARTING WITH THE INITIAL GUESS
C X0

CALL NEWT(X0,X,EPS)
STOP
END

Dr. Assakkaf
Slide No. 24

12
ENCE 202
FORTRAN
Handout 4
Fortran Application Examples
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

SUBROUTINE NEWT(X0,X,EPS)
C **************************************************************************
C * FUNCTION: THE SUBROUTINE APPROXIMATES THE ROOT
C* OF F(X)=0 GIVEN THE INITIAL POINT X0 AND
C* THE DERIVATIVE FUNCTION DF(X) USING THE
C* NEWTON METHOD
C * USAGE:
C* CALL SEQUENC: CALL NEWT(X0,X,EPS)
C* EXTERNAL FUNCTIONS/SUROUTINES:
C* FUNCTION F(X)
C* FUNCTION DF(X)

Dr. Assakkaf
Slide No. 25

ENCE 202
FORTRAN
Handout 4
Fortran Application Examples
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

C* PARAMETERS:
C* INPUT:
C* X0=INITIAL ROOT APPROXIMATION
C* EPS=ERROR BOUND
C* OUTPUT:
C* X=NEWTON APPROXIMATION OF THE ROOT
C ***********************************************************************
C **** INITIALIZATION ****
X=X0-(F(X0)/DF(X0))
C *** COMPUTE APPROXIMATE ROOT ITERATIVELY ***

Dr. Assakkaf
Slide No. 26

13
ENCE 202
FORTRAN
Handout 4
Fortran Application Examples
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

DO WHILE(ABS(X-X0) .GT. EPS)


X0=X
X=X0-(F(X0)/DF(X0))
END DO
RETURN
END

Dr. Assakkaf
Slide No. 27

ENCE 202
FORTRAN
Handout 4
Fortran Application Examples
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

C FUNCTION F IS CALLED BY NEWT TO CALCULATE


C FUNCTIONAL VALUES FOR THE PASSED POINT X
FUNCTION F(X)
F=X**3-3.0*X**2-X+9.0
WRITE(6,10)X,F
10 FORMAT(22X,F16.7,4X,F16.7)
RETURN
END

Dr. Assakkaf
Slide No. 28

14
ENCE 202
FORTRAN
Handout 4
Fortran Application Examples
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

C
C FUNCTION DF(X) IS CALLED BY NEWT TO CALCULATE
C THE DERIVATIVE AT X
C
FUNCTION DF(X)
DF=3.0*X**2-6.0*X-1.0
RETURN
END

Dr. Assakkaf
Slide No. 29

ENCE 202
FORTRAN
Handout 4
Fortran Application Examples
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Area of a Circle
Demonstrating the use of Input and Output files
PROGRAM AREA_CIRCLE
DIMENSION DIA(10), AREA(10)
OPEN(5,FILE='TEST.DAT', STATUS='UNKNOWN')
OPEN(6,FILE='TEST.OUT', STATUS='UNKNOWN')
PI=22./7
DO 1 I=1,10
READ(5,*)DIA(I)
AREA(I)=PI*DIA(I)**2/4
WRITE(6,*)DIA(I),AREA(I)1
1 CONTINUE
END Dr. Assakkaf
Slide No. 30

15
ENCE 202
FORTRAN
Handout 4
Fortran Application Examples
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n INPUT File (area.dat)


1
2
3
6
8
9
5
7
9
11

Dr. Assakkaf
Slide No. 31

ENCE 202
FORTRAN
Handout 4
Fortran Application Examples
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n OUTPUT File (area.out)


1.00000 0.785714
2.00000 3.14286
3.00000 7.07143
6.00000 28.2857
8.00000 50.2857
9.00000 63.6429
5.00000 19.6429
7.00000 38.5000
9.00000 63.6429
11.0000 95.0714

Dr. Assakkaf
Slide No. 32

16
ENCE 202
FORTRAN
Handout 4
Fortran Application Examples
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Numerical Analysis
The Trapezoidal Rule of Integration

xn
1 1

x1
f ( x )dx h f ( x0 ) + f ( x1 ) + ... + f ( xn 1 ) + f ( xn )
2 2

h = xi +1 xi

Dr. Assakkaf
Slide No. 33

ENCE 202
FORTRAN
Handout 4
Fortran Application Examples
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Numerical Analysis
The Trapezoidal Rule of Integration
f (x )
f ( xi ) f ( xi +1 ) h = xi +1 xi

x
x1 x2 xi xi +1
A B Dr. Assakkaf
Slide No. 34

17
ENCE 202
FORTRAN
Handout 4
Fortran Application Examples
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Numerical Analysis
Need for Trapezoidal Formula
Complex Integral that can not be evaluated
analytically
x cos( x 2 )
e x dx

Set of discrete values obtained from


experiments

Dr. Assakkaf
Slide No. 35

ENCE 202
FORTRAN
Handout 4
Fortran Application Examples
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Numerical Analysis
The Trapezoidal Rule of Integration
PROGRAM TRAPEZOID
A=0.0
B=10.0
N=10

CALL TRAP(A,B,N,EST)
WRITE(5,*)EST
END

Dr. Assakkaf
Slide No. 36

18
ENCE 202
FORTRAN
Handout 4
Fortran Application Examples
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n The Trapezoidal Rule of Integration (contd)


SUBROUTINE TRAP(A,B,N,E)
H = (B-A)/N
E = (F(A)+F(B))/2.0
IF (N.GT.1) THEN
X=A
DO 1 I=1, N-1
X=X+H
E = E+F(X)
1 CONTINUE
END IF
E=E*H
RETURN
END Dr. Assakkaf
Slide No. 37

ENCE 202
FORTRAN
Handout 4
Fortran Application Examples
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n The Trapezoidal Rule of Integration (contd)


FUNCTION F(X)
F = 1+(x**2*exp(x))/(1+x)
RETURN
END

Dr. Assakkaf
Slide No. 38

19
INTRODUCTION TO
ENGINEERING ECONOMICS
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

by

Dr. Ibrahim A. Assakkaf


ENCE 202
Spring 2000
Department of Civil and Environmental Engineering
University of Maryland

ENCE 202
Eng. Econ
Handout 6
Introduction
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Definition of Engineering
Engineering is the profession in which
knowledge (math and natural sciences
gained by study, experience and practice)
is applied with judgment to develop ways
to utilize, economically, the materials and
forces of nature for the benefit of mankind.

Dr. Assakkaf
Slide No. 2

1
ENCE 202
Eng. Econ
Handout 6
Introduction
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Two environments are needed for the


work of an engineer
physical and
economical environments
n An engineer needs to establish
efficiency in both environments that are
not independent

Dr. Assakkaf
Slide No. 3

ENCE 202
Eng. Econ
Handout 6
Introduction
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Engineering Process
Determination of objectives
Identification of strategic factors
Determination of means (engineering
proposals)
Evaluation of engineering proposals
Assistance in decision making

Dr. Assakkaf
Slide No. 4

2
ENCE 202
Eng. Econ
Handout 6
Introduction
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Engineering Economic Studies


Creative step
Definition step
Conversion step to same scale to facilitate
comparative evaluation
Decision step

Dr. Assakkaf
Slide No. 5

ENCE 202
Eng. Econ
Handout 6
Introduction
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n EXAMPLES:
Infrastructure expenditure decision
Replace versus repair decisions
Selection of inspection method
Selection of a replacement for an
equipment

Dr. Assakkaf
Slide No. 6

3
ENCE 202
Fundamental Economic
Eng. Econ
Handout 6
Concepts
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Economics deals with the behavior of


people

n Utility
Utility is the power of a good or service to
satisfy human needs

Dr. Assakkaf
Slide No. 7

ENCE 202
Fundamental Economic
Eng. Econ
Handout 6
Concepts
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Value
Value designate the worth that a person
attaches to an object or service
Value is a measure or appraisal of utility in
some medium of exchange.
Value is not the same as cost or price

Dr. Assakkaf
Slide No. 8

4
ENCE 202
Fundamental Economic
Eng. Econ
Handout 6
Concepts
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Consumer and Producer Goods


Consumer goods are the goods and
services that directly satisfy human wants.
For example, TV, shoes, houses.
Producer goods are the goods and
services that satisfy human wants indirectly
as a part of the production or construction
process. For example, factory equipment,
industrial chemicals ands materials.
Dr. Assakkaf
Slide No. 9

ENCE 202
Fundamental Economic
Eng. Econ
Handout 6
Concepts
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n The Utilities of Goods


Consumer goods: Basic human needs of
food, clothing and shelter. In commercial
advertisements, emphasis is given to
senses not reasoning. The utility in this
case is considered objectively and/or
subjectively.
Producer goods: The utility stems for their
means to get to an end. The utility in this
case is considered objectively. Dr. Assakkaf
Slide No. 10

5
ENCE 202
Fundamental Economic
Eng. Econ
Handout 6
Concepts
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Economy of Exchange
Economy of exchange occurs when utilities
are exchanged by two or more people.
It is possible because consumer utilities
are evaluated subjectively.
Mutual benefit in exchange
Persuasion in exchange. Salesperson

Dr. Assakkaf
Slide No. 11

ENCE 202
Fundamental Economic
Eng. Econ
Handout 6
Concepts
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Economy of Organization
Through organizations, ends can be
attained or attained more economically by:
1. Labor saving
2. Efficiency in manufacturing or capital use

Dr. Assakkaf
Slide No. 12

6
ENCE 202
Fundamental Economic
Eng. Econ
Handout 6
Concepts
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Classification of Cost (contd)


First (or initial) cost: Cost to get activity
started such as property improvement,
transportation, installation, and initial
expenditures)
Operation and maintenance cost: They
are experienced continually over the useful
life of the activity

Dr. Assakkaf
Slide No. 13

ENCE 202
Fundamental Economic
Eng. Econ
Handout 6
Concepts
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Classification of Cost (contd)


Fixed cost: It does not depend on output
volume (cost of management for example).
Variable cost: It is per unit produced.
Incremental or marginal cost: Cost per unit
or production increase. It is determined
from the variable cost.

Dr. Assakkaf
Slide No. 14

7
ENCE 202
Fundamental Economic
Eng. Econ
Handout 6
Concepts
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Classification of Cost (contd)


Sunk cost: It cannot be recovered or
altered by future actions. Usually this cost
is not a part of engineering economic
analysis.
Life-cycle cost: Feasibility, design,
construction, operation and disposal costs

Dr. Assakkaf
Slide No. 15

ENCE 202
Fundamental Economic
Eng. Econ
Handout 6
Concepts
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Supply and Demand


Demand curve shows the number of units
people are willing to buy and cost per unit
(decreasing curve).
Supply curve shows the number of units
that vendors will offer for sale and unit
price (increasing curve).
The intersection defines the exchange
price.
Dr. Assakkaf
Slide No. 16

8
ENCE 202
Fundamental Economic
Eng. Econ
Handout 6
Concepts
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Supply and Demand (contd)


Elasticity of demand. Price changes and
their effect on demand changes. It
depends on whether the consumer product
is a necessity or a luxury.
Law of diminishing return. A process can
be improved at a rate with a diminishing
return. Example: cost of inspection to
reduce cost of repair and lost production.
Dr. Assakkaf
Slide No. 17

ENCE 202
Fundamental Economic
Eng. Econ
Handout 6
Concept
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n The Interest Rate


Called also the rate of capital growth, it is the
rate of gain received from an investment.
It is expressed on an annual basis.
For the lender, it consists, for convenience, of
(1) risk of loss, (2) administrative expenses,
and (3) profit or pure gain.
For the borrower, it is the cost of using a
capital for immediately meeting his or her
needs.
Dr. Assakkaf
Slide No. 18

9
ENCE 202
Fundamental Economic
Eng. Econ
Handout 6
Concepts
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n The Time Value of Money (TVM)


As a result of the earning power of money
(through interest), time increases the
purchasing power of money by its increase
through earning

Dr. Assakkaf
Slide No. 19

ENCE 202
Fundamental Economic
Eng. Econ
Handout 6
Concepts
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n The Time Value of Money (TVM)


Money has a time value
One dollar today is worth more than $1
tomorrow
Failure to pay the bills results in additional
charge termed interest

Dr. Assakkaf
Slide No. 20

10
ENCE 202
Fundamental Economic
Eng. Econ
Handout 6
Concepts
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n The interest i
Interest is usually expressed as a
percentage of the amount owed
It is due and payable at the close of each
period of time involved in the agreed
transaction (usually every year or month).

Dr. Assakkaf
Slide No. 21

ENCE 202
Fundamental Economic
Eng. Econ
Handout 6
Concepts
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n The interest i
EXAMPLE:
If $ 1,000.00 is borrowed at 14% interest, then
interest on the principal of $ 1,000.00 after one
year is 0.14 x 1, 000, or $140.00

If the borrower pays back the total amount


owed after one year, she will pay $1,140.00

Dr. Assakkaf
Slide No. 22

11
ENCE 202
Fundamental Economic
Eng. Econ
Handout 6
Concepts
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n The interest i
EXAMPLE (contd):
If she does not pay back any of the amount
owed after one year, then normally the interest
owed, but not paid, is considered now to be
additional principal, and thus the interest is
compounded
After two years she will owe $1,140.00+0.14 X
1,140.00,or 1,299.60.

Dr. Assakkaf
Slide No. 23

ENCE 202
Fundamental Economic
Eng. Econ
Handout 6
Concepts
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Equivalency
The banker in the previous example normally
does not care whether you pay him $1,140.00
after one year or $1,299.60 after two years. To
him, the three values ($1,000, $1,140, and
$1,299.60) are equivalent.
$ 1,000 today is equivalent to $1,140 one year
from today,
$ 1,000 today is equivalent to $1,299.60 two
years from today.

Dr. Assakkaf
Slide No. 24

12
ENCE 202
Fundamental Economic
Eng. Econ
Handout 6
Concepts
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Equivalency
The banker in the previous example normally
does not care whether you pay him $1,140.00
after one year or $1,299.60 after two years. To
him, the three values ($1,000, $1,140, and
$1,299.60) are equivalent.
$ 1,000 today is equivalent to $1,140 one year
from today,
$ 1,000 today is equivalent to $1,299.60 two
years from today.
NOTE: The three values are not equal but equivalent Dr. Assakkaf
Slide No. 25

ENCE 202
Fundamental Economic
Eng. Econ
Handout 6
Concepts
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Equivalency
It is to be noted that:
1.The concept of equivalence involves time and
a specified rate of interest. The three
preceding values are only equivalent for an
interest rate of 14%, and then only at the
specified times.
2.Equivalence means that one sum or series
differs from another only by the accumulated
interest at rate i for n periods of time.
Dr. Assakkaf
Slide No. 26

13
ENCE 202
Fundamental Economic
Eng. Econ
Handout 6
Concepts
A. J. Clark School of Engineering Department of Civil and Environmental Engineering
F

n Cash Flows Over Time


A A A A A A A A

0 1 2 3 4 5 6 n-1
n

Dr. Assakkaf
Slide No. 27

ENCE 202
Fundamental Economic
Eng. Econ
Handout 6
Concepts
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Cash Flows Over Time


Symbols
P = a present single amount of money
F = a future single amount of money, after n
periods of time
A = a series of n equal payments
i = the rate of interest per interest period (usually
one year)
n = the number of periods of time (usually years)

Dr. Assakkaf
Slide No. 28

14
ENCE 202
Fundamental Economic
Eng. Econ
Handout 6
Concepts
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Cash Flows Over Time


Example
3,200
Cash Flow Diagram
4,500

0
12.34 (1,400)

3,200 3,200 3,200

6,000

45,000
Dr. Assakkaf
Slide No. 29

ENCE 202
Fundamental Economic
Eng. Econ
Handout 6
Concepts
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Financial Analysis
Single payment
Uniform series of payments
Discounted present worth analysis
Rate of return analysis

Dr. Assakkaf
Slide No. 30

15
ENCE 202
Fundamental Economic
Eng. Econ
Handout 6
Concepts
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n The earning power of money


This power is there because money can be
exchanged by production tools
n The purchasing power of money
The prices of goods and services can go
upward or downward, therefore the
purchasing power of money can change
with time

Dr. Assakkaf
Slide No. 31

ENCE 202
Fundamental Economic
Eng. Econ
Handout 6
Concepts
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Example Economic Studies


Design and Economy
Elimination of overdesign should not be an
objective.
Designing for economic production
Economy in the design of producer goods
Design for the economy of maintenance
Design for the economy of shipping
Economy of interchangeable design
Dr. Assakkaf
Slide No. 32

16
ENCE 202
Fundamental Economic
Eng. Econ
Handout 6
Concepts
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Example Economic Studies


Economy of Material Selection
Standardization and Simplification
Selection of Personnel
Range of human capacities
Economy of proficiency
Economy of specialization
Economy of dependability

Dr. Assakkaf
Slide No. 33

17
INTRODUCTION TO
ENGINEERING ECONOMICS
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

by

Dr. Ibrahim A. Assakkaf


ENCE 202
Spring 2000
Department of Civil and Environmental Engineering
University of Maryland

ENCE 202
Eng. Econ
Handout 7
Types of Interest
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Simple Interest
I = Pni
P = principal $1,000
i = interest rate 0.12
n = number of years or periods 1
I= interest $120.00

Interest is due at the end of the time period.


For fractions of a time period, multiply the
interest by the fraction Dr. Assakkaf
Slide No. 2

1
ENCE 202
Eng. Econ
Handout 7
Types of Interest
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Compound Interest: The interest of the


interest.
A loan of $1,000 is made at an interest of
12% for 5 years. The interest is due at the
end of each year with the principal is due
at the end of the fifth year. The following
table shows the resulting payment
schedule:

Dr. Assakkaf
Slide No. 3

ENCE 202
Eng. Econ
Handout 7
Type of Interest
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

P = principal $ ,
i = interest rate .
n = number of years or periods

Year Amount at start of year Interest at year end Owed amount at year end Payment
$ , . $ . $ , . $ .
$ , . $ . $ , . $ .
$ , . $ . $ , . $ .
$ , . $ . $ , . $ .
$ , . $ . $ , . $ , .

Dr. Assakkaf
Slide No. 4

2
ENCE 202
Eng. Econ
Handout 7
Types of Interest
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Compound Interest (contd)


A loan of $1,000 is made at an interest of
12% for 5 years. The principal and interest
are due at the end of the fifth year. The
following table shows the resulting
payment schedule:

Dr. Assakkaf
Slide No. 5

ENCE 202
Eng. Econ
Handout 7
Types of Interest
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

i = interest rate .
n = number of years or periods

Year Amount at start of year Interest at year end Owed amount at year end Payment
$ , . $ . $ , . $ .
$ , . $ . $ , . $ .
$ , . $ . $ , . $ .
$ , . $ . $ , . $ .
$ , . $ . $ , . $ , .

Dr. Assakkaf
Slide No. 6

3
ENCE 202
Eng. Econ
Handout 7
Cash Flow
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Cash flow over time: Upward arrow


means positive flow, downward arrow
means negative flow. There are two
cash flows to each problem (borrower
and lender flows).
n Net cash flow: The arithmetic sum of
receipts (+) and disbursements (-) that
occur at the same point in time.
Dr. Assakkaf
Slide No. 7

ENCE 202
Eng. Econ
Handout 7
Cash Flow
A. J. Clark School of Engineering Department of Civil and Environmental Engineering
F

A A A A A A A A

0 1 2 3 4 5 6 n-1
n

Dr. Assakkaf
Slide No. 8

4
ENCE 202
Eng. Econ
Handout 7
Notations
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

P = a present single amount of money


F = a future single amount of money, after
n periods of time
A = a series of n equal payments
i = the rate of interest per interest period
(usually one year)
n = the number of periods of time (usually
years)
Dr. Assakkaf
Slide No. 9

ENCE 202
Eng. Econ
Handout 7
Interest Formulas
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Single Payment Compound-Amount


Factor (SPCAF)

F = P(1 + i )
n

OR

F
F = , i, n
P
Dr. Assakkaf
Slide No. 10

5
ENCE 202
Eng. Econ
Handout 7
Interest Formulas
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Example:
Let the principle P = 1000, the interest rate
i = 12%, and the number of periods n = 4
years.
The future sum is therefore

F = P (1 + i ) = 1000 (1 + 0.12 ) = 1,573 .5


n 4

Dr. Assakkaf
Slide No. 11

ENCE 202
Eng. Econ
Handout 7
Interest Formulas
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Single Payment Present-Worth Factor


(SPPWF)
P
P=
(1 + i )n
OR

P
P = , i, n
F
Dr. Assakkaf
Slide No. 12

6
ENCE 202
Eng. Econ
Handout 7
Interest Formulas
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Example 1:
Let the principle F = 1000, the interest rate
i = 12%, and the number of periods n = 4
years.
The present worth is therefore
F 1000
P= = = 635.5
(1 + i ) (1 + 0.12)4
n

Dr. Assakkaf
Slide No. 13

ENCE 202
Eng. Econ
Handout 7
Interest Formulas
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Example 2:
Let the principle F = 1,573.5, the interest
rate i = 12%, and the number of periods n
= 4 years.
The present worth is therefore
F 1,573.5
P= = = 1000.0
(1 + i ) (1 + 0.12)4
n

Dr. Assakkaf
Slide No. 14

7
ENCE 202
Eng. Econ
Handout 7
Interest Formulas
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Uniform (Equal payment) Series


Compound-Amount Factor (USCAF)
(1 + i ) n 1
F = A
i
OR

F
F = , i, n
A
Dr. Assakkaf
Slide No. 15

ENCE 202
Eng. Econ
Handout 7
Interest Formulas
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Example:
Let A = 100, the interest rate i = 12%, and
the number of periods n = 4 years.
The future value is therefore

(1 + i ) n 1 (1 + 0.12) 4 1
F = A = 100 = 477.9
i 0 .12

Dr. Assakkaf
Slide No. 16

8
ENCE 202
Eng. Econ
Handout 7
Interest Formulas
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Uniform (Equal payment) Series


Sinking-Fund Factor (USSFF)
i
A = F
(1 + i )n
1
OR

A
A = , i, n
F
Dr. Assakkaf
Slide No. 17

ENCE 202
Eng. Econ
Handout 7
Interest Formulas
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Example:
Let the future value F = 1000, the interest
rate i = 12%, and the number of periods n
= 4 years.
Therefore
i 0.12
A = F = 1000 = 209.2
(1 + i ) n
1 (1 + 0. 12 )4
1

Dr. Assakkaf
Slide No. 18

9
ENCE 202
Eng. Econ
Handout 7
Interest Formulas
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Uniform (Equal payment) Series


Capital-Recovery Factor (USCRF)
i (1 + i ) n
A = P
(1 + i )n
1
OR

A
A = , i, n
P
NOTE: This is the case of loans (mortgages)
Dr. Assakkaf
Slide No. 19

ENCE 202
Eng. Econ
Handout 7
Interest Formulas
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Example:
Let the present worth P = 1000, the interest
rate i = 12%, and the number of periods n
= 4 years.
Therefore
i (1 + i )n 0.12(1 + 0.12 )4
A = P = 1000


(1 + 0.12)4 1 = 329.2
(1 + i ) n
1

Dr. Assakkaf
Slide No. 20

10
ENCE 202
Eng. Econ
Handout 7
Interest Formulas
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Uniform (Equal payment) Series


Present-Worth Factor (USPWF)
(1 + i ) n 1
P = A n

i (1 + i )
OR
P
P = , i, n
A
Dr. Assakkaf
Slide No. 21

ENCE 202
Eng. Econ
Handout 7
Interest Formulas
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Example:
Let A = 100, the interest rate i = 12%, and
the number of periods n = 4 years.
Therefore

(1 + i )n 1 (1 + 0.12 )4 1
P = A = 100
n

0.12(1 + 0.12)4 = 303.7
i (1 + i )

Dr. Assakkaf
Slide No. 22

11
ENCE 202
Eng. Econ
Handout 7
Interest Formulas
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Uniform Gradient-Series Factor


The gradient (G) is a value in the cash flow
that starts with 0 at the end of year 1, G at
the end of year 2, 2G at the end of year 3,
and so on to (n-1)G at the end of year n

1 n
P = G
i (1 + i ) 1
n

Dr. Assakkaf
Slide No. 23

ENCE 202
Eng. Econ
Handout 7
Interest Formulas
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Example:
Let G = 100, the interest rate i = 12%, and
the number of periods n = 4 years.
Therefore

1 n 1 4
A = G
= 100
0.12 (1 + 0.12 )4 1 = 135.9

i (1 + i ) n
1

Dr. Assakkaf
Slide No. 24

12
ENCE 202
Discrete and Continuous
Eng. Econ
Handout 7
Compounding
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Nominal Interest Rate


It is expressed in annual basis
Financial institutions refer to this rate as the
annual percentage rate or APR
n Effective Interest Rate
It is an interest rate that is compounded using a
time period less than a year
The nominal interest rate in this case is the
effective rate times the number of compounding
periods in a year
It is referred to as nominal rate compounded at the
period less than a year Dr. Assakkaf
Slide No. 25

ENCE 202
Discrete and Continuous
Eng. Econ
Handout 7
Compounding
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Example:
Effective rate is 1% per month
Therefore
Nominal Rate = 1% (12) = 12% compounded
monthly

Dr. Assakkaf
Slide No. 26

13
ENCE 202
Discrete and Continuous
Eng. Econ
Handout 7
Compounding
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Relationship Between the Effective


Interest Rate for any given time interval
and the Nominal Interest Rate per Year
n Define
r =nominal interest rate per year
i = effective interest rate in the time interval
l = length of the time interval (in years)
m = reciprocal of the length of the compounding
period (in years)

Dr. Assakkaf
Slide No. 27

ENCE 202
Discrete and Continuous
Eng. Econ
Handout 7
Compounding
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n The effective interest rate


lm
r
i = 1 + 1
m
r =nominal interest rate per year
i = effective interest rate in the time interval
l = length of the time interval (in years)
m = reciprocal of the length of the compounding
period (in years)
Dr. Assakkaf
Slide No. 28

14
ENCE 202
Discrete and Continuous
Eng. Econ
Handout 7
Compounding
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n If the interest is compounded only once


in the time interval, then l (m) =1, and
r
i=
m

r =nominal interest rate per year


i = effective interest rate in the time interval
l = length of the time interval (in years)
m = reciprocal of the length of the compounding
period (in years) Dr. Assakkaf
Slide No. 29

ENCE 202
Discrete and Continuous
Eng. Econ
Handout 7
Compounding
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n To find the applicable effective interest


rate for any time interval, the following
equation can be used:
c
r
i = 1 + 1 c 1
m

r =nominal interest rate per year


i = effective interest rate in the time interval
c = number of compounding periods in the time interval
m = reciprocal of the length of the compounding
period (in years) Dr. Assakkaf
Slide No. 30

15
ENCE 202
Discrete and Continuous
Eng. Econ
Handout 7
Compounding
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Continuous Compounding
The limiting case for the effective rate is when
compounding is performed an infinite times in a
year, that is continuously. Using l = 1, the
following limit produces the continuously
compounded interest rate ( ia):
m
r
ia = Lim1 + 1 = e r 1
m
m

Dr. Assakkaf
Slide No. 31

ENCE 202
Discrete and Continuous
Eng. Econ
Handout 7
Compounding
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Example 1
If the nominal rate of 12% is compounded
monthly with time interval of one year, then
c =12, and

12
012
i = 1 + 1 = 0.1268 or 12.68% per year
12

Dr. Assakkaf
Slide No. 32

16
ENCE 202
Discrete and Continuous
Eng. Econ
Handout 7
Compounding
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Example 2
If the nominal rate of 18% is compounded
weekly with time interval of one year, then
c =52, and

52
018
i = 1 + 1 = 0.1968 or 19.68% per year
52

Dr. Assakkaf
Slide No. 33

ENCE 202
Discrete and Continuous
Eng. Econ
Handout 7
Compounding
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Example 3
If the nominal rate of 14% is compounded
monthly with time interval of six months, then
c =6, and

6
014
i = 1 + 1 = 0.0721 or 7.21% per six months
12

Dr. Assakkaf
Slide No. 34

17
ENCE 202
Discrete and Continuous
Eng. Econ
Handout 7
Compounding
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Example 4
If the nominal rate of 9% is compounded
semiannually with time interval of two years,
then
c =4, and
4
0.09
i = 1 + 1 = 0.1925 or 19.25% per two years
2

Dr. Assakkaf
Slide No. 35

ENCE 202
Discrete and Continuous
Eng. Econ
Handout 7
Compounding
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Example 5
The effective interest rates corresponding to a
nominal annual interest rate of 18%
compounded annually, semiannually, quarterly,
monthly, weekly, daily, and continuously are
shown in the following Table:

Dr. Assakkaf
Slide No. 36

18
ENCE 202
Discrete and Continuous
Eng. Econ
Handout 7
Compounding
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Example 5 (contd)
Compounding Number of periods Effective interest rate Effective annual interest
frequency per year per period rate
Column 1 Column 2 Col. 3 = 18%/Col 2 . Col .2
018
i = 1 + 1
Col .2
Annually 1 18% 18%
Semiannually 2 9 18.81
Quarterly 4 4.5 19.2517
Monthly 12 1.5 19.5618
Weekly 52 0.3642 19.6843
Daily 365 0.0493 19.7412
Continuously 0.00000 19.7217 = exp(0.18) - 1

Dr. Assakkaf
Slide No. 37

ENCE 202
Discrete and Continuous
Eng. Econ
Handout 7
Compounding
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Comparing Interest Rates


Since the effective interest rate represents the
actual interest earned, this rate should be used to
compare the benefits of various nominal rates of
interest
For example, one might be confronted with the
problem of determining whether it is more
desirable to receive 16% compounded annually or
15% compounded monthly

Dr. Assakkaf
Slide No. 38

19
ENCE 202
Discrete and Continuous
Eng. Econ
Handout 7
Compounding
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Comparing Interest Rates


The effective rate of interest per year for 16%
compounded annually is, of course, 16%
However, for 15% compounded monthly, the
effective annual rate is
12
0.15
ia = 1 + 1 = 16.08%
12

Thus, 15% compounded monthly yields an actual


rate of interest that is higher than 16%
compounded annually Dr. Assakkaf
Slide No. 39

ENCE 202
Eng. Econ
Handout 7
Use of Interest Tables
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n To aid in calculations using the


relationships between P, F, A, n, and i,
you can also find values for F/A, A/F,
P/A, and A/P in tables for typical values
for i and n
n The following table gives these factors
for i = 23 and

Dr. Assakkaf
Slide No. 40

20
ENCE 202
Eng. Econ
Handout 7

A. J. Clark School of Engineering Department of Civil and Environmental Engineering

Dr. Assakkaf
Slide No. 41

ENCE 202
Eng. Econ
Handout 7
Use of Interest Tables
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Example
Let A = 300, the interest rate i = 20%, and
the number of periods n = 5 years.
Using the table, then
P P
P = , i, n = ,20,5 = 300(2.9906) = 897.2
A A
F F
F = , i, n = ,20,5 = 300(7.4416) = 2,232.5
A A

Dr. Assakkaf
Slide No. 42

21
INTRODUCTION TO
ENGINEERING ECONOMICS
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

by

Dr. Ibrahim A. Assakkaf


ENCE 202
Spring 2000
Department of Civil and Environmental Engineering
University of Maryland

ENCE 202
The Time Value of Money
Eng. Econ
Handout 8
(TVM)
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

Money has a time value


One dollar today is worth more than
$1 tomorrow
Failure to pay the bills results in
additional charge termed

Dr. Assakkaf
Slide No. 2

1
ENCE 202
Eng. Econ
Handout 8
The Interest (i)
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

Interest is usually expressed as a percentage of the amount owed.


It is due and payable at the close of each period of time involved in the
agreed transaction (usually every month).

Example:
If $ 1,000.00 is borrowed at 14% interest, then interest on the principal
of $ 1,000.00 after one year is 0. 14 x 1, 000, or $140.00.

If the borrower pays back the total amount owed after one year, she will
pay $1,140.00.

If she does not pay back any of the amount owed after one year, then
normally the interest owed, but not paid, is considered now to be
additional principal, and thus the interest is compounded.

After two years she will owe $1,140.00+0.14 X 1,140.00,or 1,299.60.


Dr. Assakkaf
Slide No. 3

ENCE 202
Eng. Econ
Handout 8
Equivalency
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

The banker normally does not care whether you pay him $1,140.00 after
one year or $1,299.60 after two years. To him, the three values ($1,000,
$1,140, and $1,299.60) are equivalent.
$ 1,000 today is equivalent to $1,140 one year from today,
$ 1,000 today is equivalent to $1,299.60 two years from today.

The three values are not equal but equivalent.


Note:
1.The concept of equivalence involves time and a specified rate
of interest. The three preceding values are only equivalent for an
interest rate of 14%, and then only at the specified times.
2. Equivalence means that one sum or series differs from another
only by the accumulated interest at rate i for n periods of time.

Dr. Assakkaf
Slide No. 4

2
ENCE 202
Financial Engineering
Eng. Econ
Handout 8
Analysis
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

Single payment
Uniform series of payments
Discounted present worth analysis
Rate of return analysis
Dr. Assakkaf
Slide No. 5

ENCE 202
Eng. Econ
Handout 8
Cash Flow
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Cash flow over time: Upward arrow


means positive flow, downward arrow
means negative flow. There are two
cash flows to each problem (borrower
and lender flows).
n Net cash flow: The arithmetic sum of
receipts (+) and disbursements (-) that
occur at the same point in time.
Dr. Assakkaf
Slide No. 6

3
ENCE 202
Eng. Econ
Handout 8
Cash Flow
A. J. Clark School of Engineering Department of Civil and Environmental Engineering
F

A A A A A A A A

0 1 2 3 4 5 6 n-1
n

Dr. Assakkaf
Slide No. 7

ENCE 202
Eng. Econ
Handout 8
Notations
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

P = a present single amount of money


F = a future single amount of money, after
n periods of time
A = a series of n equal payments
i = the rate of interest per interest period
(usually one year)
n = the number of periods of time (usually
years)
Dr. Assakkaf
Slide No. 8

4
ENCE 202
Eng. Econ
Handout 8
Single Payment
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Single Payment Compound-Amount


Factor (SPCAF)

F = P(1 + i )
n

OR

F
F= , i, n
P

Dr. Assakkaf
Slide No. 9

ENCE 202
Eng. Econ
Handout 8
Single Payment
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Single Payment Present-Worth Factor


(SPPWF)
F
P=
(1 + i )n
OR

P
P= , i, n
F

Dr. Assakkaf
Slide No. 10

5
ENCE 202
Eng. Econ
Handout 8
Single Payment Analysis
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

To calculate the future value F of a single payment P after n


periods at an interest rate i, we make the following calculation:

At the end of the first period: F1 = P + Pi


At the end of the second period: F2 = P + Pi + (P + Pi)i = P(1 + i)2
At the end of the nth period: Fn = P(1 + i)n

The future single amount of a present single amount is

F = P(1 + i)n

Dr. Assakkaf
Slide No. 11

ENCE 202
Eng. Econ
Handout 8
Single Payment Analysis
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

Note:
F is related to P by a factor which depends only on i and n.
This factor, termed the single payment compound amount
factor (SPCAF), makes F equivalent to P.
SPCAF may be expressed in a functional form:
F F
(1 + i ) n = , i, n or F = P , i, n
P P

The present single amount of a future single amount is

F P
P= or P = F , i, n
(1 + i ) n F
Dr. Assakkaf
Slide No. 12

6
ENCE 202
Eng. Econ
Handout 8
Single Payment Analysis
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

Note:
The factor 1/(1+i)n is called the present worth compound
amount factor (PWCAF)

1 P
n
= , i, n
(1 + i ) F

Dr. Assakkaf
Slide No. 13

ENCE 202
Eng. Econ
Handout 8
Example 1: Single Payment
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

A contractor wishes to set up a revolving line of credit at the bank to


handle her cash flow during the construction of a project.
She believes that she needs to borrow $12,000 with which to set up
the account, and that she can obtain the money at 1.45% per
month.

If she pays back the loan and accumulated interest after 8 months,
how much will she have to pay back?

F = 12,000(1 + 0.0145)8 = 12,000(1.122061)= 13,464.73 = $13,465

The amount of interest will be:

$13,465 - 12,000 = $1,465.


Dr. Assakkaf
Slide No. 14

7
ENCE 202
Eng. Econ
Handout 8
Example 2: Single Payment
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

A construction company wants to set aside enough money today in


an interest-bearing account in order to have $ 100,000 five years
from now for the purchase of a replacement piece of equipment.

If the company can receive 8% interest on its investment, how much


should be set aside now to collect the $100,000 five years from
now?

P = 100,000/(I + 0.08)5 =100,000/(1.46933) = $68,058.32 = $68,060

To solve this problem you can also use the interest tables.

P =100,000 (P/F, 8,5) = 100,000(0.6805832) $68,058.32 = $68,060


Dr. Assakkaf
Slide No. 15

ENCE 202
Uniform Series of Payments
Eng. Econ
Handout 8
Analysis
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Uniform (Equal payment) Series


Compound-Amount Factor (USCAF)
(1 + i ) n 1
F = A

i
OR

F
F= , i, n
A

Dr. Assakkaf
Slide No. 16

8
ENCE 202
Uniform Series of Payments
Eng. Econ
Handout 8
Analysis
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Uniform (Equal payment) Series


Sinking-Fund Factor (USSFF)
i
A = F

(1 + i )n
1
OR

A
A= , i, n
F

Dr. Assakkaf
Slide No. 17

ENCE 202
Eng. Econ
Handout 8
Interest Formulas
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Uniform (Equal payment) Series


Capital-Recovery Factor (USCRF)
i (1 + i ) n
A = P
(1 + i )n 1
OR

A
A= , i, n
P
NOTE: This is the case of loans (mortgages)
Dr. Assakkaf
Slide No. 18

9
ENCE 202
Eng. Econ
Handout 8
Interest Formulas
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Uniform (Equal payment) Series


Present-Worth Factor (USPWF)
(1 + i ) n 1
P = A
i (1 + i )
n

OR
P
P= , i, n
A

Dr. Assakkaf
Slide No. 19

ENCE 202
Uniform Series of Payments
Eng. Econ
Handout 8
Analysis
A. J. Clark School of Engineering Department of Civil and Environmental Engineering
Often payments or receipts occur at regular intervals, and such
uniform values can be handled by the use of additional functions.
Another symbol:
A = uniform end-of-period payments or receipts continuing for
a duration of n periods
If a uniform amount A is invested at the end of each period for n
periods at a rate of interest i per period, then the total equivalent
amount F at the end of the n periods will be:

F = A[(1 + i ) (1 + i )n 2 + .... + (1 + i ) + 1]
n1
+

By multiplying both sides of above equation by (1+i) and subtracting


from the original equation, the following expression is obtained:

Fi = A(1 + i ) 1
n

Dr. Assakkaf
Slide No. 20

10
ENCE 202
Uniform Series of Payments
Eng. Econ
Handout 8
Analysis
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

Which can be rearrange to give


(1 + i)
n
1
F = A
i
The relationship can also be expressed in a functional form as
F
F = A , i, n
A

[(1+i)n - 1]/i is called the uniform series compound amount factor (USCAF)
It can also be shown that

i
A = F
(1 + i ) 1
n

Dr. Assakkaf
Slide No. 21

ENCE 202
Uniform Series of Payments
Eng. Econ
Handout 8
Analysis
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

Which can be rearrange to give


(1 + i)
n
1
F = A
i
The relationship can also be expressed in a functional form as
F
F = A , i, n
A

[(1+i)n - 1]/i is called the uniform series compound amount factor (USCAF)
It can also be shown that

i
A = F
(1 + i ) 1
n

Dr. Assakkaf
Slide No. 22

11
ENCE 202
Uniform Series of Payments
Eng. Econ
Handout 8
Analysis
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

Which can be expressed in a functional form as

A
A = F , i, n
F
The relationship i / [(1+i)n - 1]is termed as the uniform series sinking fund factor
(USSFF)

F = P (1 + i )
n
Recall that

Hence

(1 + i)
1
n
P
P = A n
or P = A , i, n
i (1 + i ) A

Dr. Assakkaf
Slide No. 23

ENCE 202
Uniform Series of Payments
Eng. Econ
Handout 8
Analysis
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

The relationship (1 + i ) 1 is called the uniform series present worth factor


n


i (1 + i )
n
(USPWF)

Also
i (1 + i )
n
A
A = P or A = P , i, n
(1 + i ) 1
n
P

The relationship i(1 + i ) is called the uniform series capital recovery factor
n

n
(USCRF) (1 + i ) 1

Dr. Assakkaf
Slide No. 24

12
ENCE 202
Cash Flow Diagram for Single
Eng. Econ
Handout 8
Payment
A. J. Clark School of Engineering Department of Civil and Environmental Engineering
F

0 1 2 3 4 5 6 n-1
n

1
F = P (1 + i ) or P = F
n
n
P (1 + i )

Dr. Assakkaf
Slide No. 25

ENCE 202
Cash Flow Diagram for Single
Eng. Econ
Handout 8
Payment
A. J. Clark School of Engineering Department of Civil and Environmental Engineering
F

A A A A A A A A

0 1 2 3 4 5 6 n-1
n

(1 + i ) 1
n
i
F = A or A = F
(1 + i ) 1
n
i

Dr. Assakkaf
Slide No. 26

13
ENCE 202
Cash Flow Diagram for Single
Eng. Econ
Handout 8
Payment
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

A A A A A A A A

0 1 2 3 4 5 6 n-1
n

(1 + i ) 1 i (1 + i )
n n
P = A n
or A = P
i (1 + i ) (1 + i ) 1
n
P

Dr. Assakkaf
Slide No. 27

ENCE 202
Eng. Econ
Handout 8
Example 3
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

A piece of construction equipment costs $45,000 to


purchase. Fuel, oil, grease, and minor maintenance are
estimated to cost $12.34 for each hour that the equipment
is used. The tires cost $3,200 to replace (estimated to
occur every 2,800 hours of use), and major repairs of
$6,000 are expected after 4,200 hours of use.
The piece of equipment is expected to last for 8,400 hours,
after which it will have an estimated salvage value of 10%
of the purchase price.
How much should the owner of the equipment
charge, per hour of use, if he expects to use the piece of
equipment about 1,400 hours per year? Assume an
annual interest rate of 15%.
Dr. Assakkaf
Slide No. 28

14
ENCE 202
Eng. Econ
Handout 8
Example 3 (continued)
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

Cash Flow Diagram


4,500

0 1 2 3 4 5 6
12.34 (1,400)

3,200 3,200

6,000

45,000

n = 8,400/1,400 = 6 yrs,
nT = 2800/1400 = 2 yrs,
nR= 4200/1400 = 3yrs
Dr. Assakkaf
Slide No. 29

ENCE 202
Eng. Econ
Handout 8
Example 3 (continued)
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n = 8,400/1,400 = 6 yrs, nT = 2800/1400 = 2 yrs, nR = 4200/1400 = 3yrs


A1 = - 45,000(A/P,15,6) = - 45,000 (0.26424) = -11,890.80
A2= - 12.34 (1,400) = -17,276.00
A3=[ - 3,200 (P/F,15,2) 3,200 (P/F,15,4)] (A/P,15,6)
= [- 3,200 (0.75614) 3,200 (0.57175)] (0.26424) = -1,122.78
A4= - 6,000 (P/F,15,3)(A/P,15,6)
= - 6,000 (0.65752)(0.26424) = -1,042.46
A5= + 4,500(A/F,15,6) = 4,500 (0.11424) = +514.08
AT= the total annual cost = -30,817.96
The hourly cost = 30,817.96/1,400 = $22.01/hr
n
i 1+ i
A = P ( n ) or A = P , i, n
A i
A = F
(1 + i ) 1
(1 + i ) 1 P n

(1 + i )n 1 P
1
n

=
P
, i, n
P = A n
or P = A , i, n (1 + i ) F
i (1 + i ) A Dr. Assakkaf
Slide No. 30

15
ENCE 202
Eng. Econ
Handout 8
Example 3 (continued)
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

Dr. Assakkaf
Slide No. 31

16
INTRODUCTION TO
ENGINEERING ECONOMICS
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

by

Dr. Ibrahim A. Assakkaf


ENCE 202
Spring 2000
Department of Civil and Environmental Engineering
University of Maryland

ENCE 202
Economic Analysis of
Eng. Econ
Handout 9
Alternatives
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Net Cash Flow of Investment


Opportunities
Payments and disbursements need to be
determined. Then a net cash flow can be
developed

Dr. Assakkaf
Slide No. 2

1
ENCE 202
Economic Analysis of
Eng. Econ
Handout 9
Alternatives
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Present-Worth Amount
It is the difference between the equivalent
receipts and disbursements at the present.
Assume Ft is a cash flow at time t, the
present worth (PW) is
n n
PW (i ) = Ft ( P / F , i, t ) = Ft (1 + i) t
t =0 t =0

for any interest -1< i <.

Dr. Assakkaf
Slide No. 3

ENCE 202
Economic Analysis of
Eng. Econ
Handout 9
Alternatives
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Annual Equivalent Amount


The annual equivalent amount is the
annual equivalent receipts minus the
annual equivalent disbursements of a cash
flow. It is used for repeated cash flows per
year.

n
i(1 + i) n
AE (i ) = PW (i)( A / P, i, n) = Ft (1 + i ) t n


t= 0 (1 + i ) 1

Dr. Assakkaf
Slide No. 4

2
ENCE 202
Eng. Econ
Handout 9
Example 1
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

Given the following cash flow:


Year end Receipts Disbursements
0 0 -1000
1 400 0
2 900 -1000
3 400 -
4 900 -1000
. . .
n-2 900 -1000
n-1 400 0
n 900 0

Therefore, AE(10) = [-1000+400(P/F,10,1)+900(P/F,10,2)](A/P,10,2)

or AE(10) = [-1000+400(0.9091)+900(0.8265)](0.5762) = 61.9

Dr. Assakkaf
Slide No. 5

ENCE 202
Discounted Present Worth
Eng. Econ
Handout 9
Analysis
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

Often in engineering economic studies, as well as in general


financial analyses, a discounted present worth analysis is made of
each alternative under consideration.
It involves calculating the equivalent present worth or present value
of all the dollar amounts involved in the alternative to determine its
present worth.

Definition:
The present worth is discounted at a predetermined rate of interest
called the minimum attractive rate of return (MARR or i*).
The MARR is usually equal to the current rate of interest for
borrowed capital plus an additional rate for such factors as risk,
uncertainty, and contingencies.

MARR = i* = i + i(risk)
Dr. Assakkaf
Slide No. 6

3
ENCE 202
Eng. Econ
Handout 9
Example 2
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

The Ace-in-the-Hole Construction Company is considering three


methods of acquiring company pickups for use by field engineers.
The alternatives are:
A. Purchase the pickups for $7,200 each and sell after 4 years for
an estimated $1,200 each.
B. Lease the pickups for 4 years for $2,250 per year paid in
advance at the beginning of each year. The contractor pays all
operating and maintenance costs on the pickups and the
leasing company retains ownership.
C. Purchase the pickups on special time payments with $750 down
now and $2,700 per year at the end of each year for 3 years.
Assume the pickups will be sold after 4 years for $1,200 each.

If the contractor's MARR is 15%, which alternative should he choose?

Dr. Assakkaf
Note: All alternatives involve equal lives. Slide No. 7

ENCE 202
Eng. Econ
Handout 9
Example 2 (continued)
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

To solve, calculate the net present worth (NPW) of each alternative


at 15% and select the least costly alternative:
1,200
A 0 4 NPWA = -7,200 + 1,200(P/F),15,4) = -$6,514

7,200

0 4
B
NPWB = -2,250 - 2,250(P/A),15,3) = -$7,387

2,250 2,250 2,250 2,250 1,200

4
0
C NPWC = -750 - 2,700(P/A),15,4)+1,200(P/A),15,4) = -$7,772

750

2,700 2,700 2,700 2,700


The least costly alternative is A
Dr. Assakkaf
Slide No. 8

4
ENCE 202
Eng. Econ
Handout 9
Example 3
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

The engineering estimate for the cost of


installing a new Astro-Turf for the college
football field is $378,000 and is guaranteed
for 5 years. Another artificial turf, the
MACHO-TURF, is advertised for $494,000,
installed, and guaranteed to last 8 years.
Neglecting salvage value, which turf should
be selected:
(a) if the MARR is 12%?
(b) if the MARR is 20%?
Dr. Assakkaf
Slide No. 9

ENCE 202
Eng. Econ
Handout 9
Example 3 (continued)
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

(a)
MARR = 12%
NACAT = 378,000 (A/P,12,5) = $104,861 / yr
NACMT = 494,000 (A/P,12,8) = $99,444 / yr
Choose Macho-Turf (Lower cost)
(b)
MARR = 20%
NACAT = 378,000 (A/P,20,5) = $126,396 / yr
NACMT = 494,000 (A/P,20,8) = $128,741 / yr
Choose Astro-Turf (Lower cost)

Dr. Assakkaf
Slide No. 10

5
ENCE 202
What to do When Alternatives
Eng. Econ
Handout 9
Involve Different Lives
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

Approach 1.
Truncate (cut off) the longer-lived alternative(s) to equal the
shorter lived alternative and assume a salvage value for the
unused portion of the longer lived alternatives. Then make
the comparison on the basis of equal lives.

Approach 2.
Assume equal replacement conditions (costs and incomes)
for each alternative and compute the discounted present
worth on the basis of the least common multiple of lives for
all alternatives.

Dr. Assakkaf
Slide No. 11

ENCE 202
Eng. Econ
Handout 9
Example 4
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

A contractor is considering the purchase of


either a new track-type tractor for $73,570,
which has a 6-year life with an estimated net
annual income of $26,000 and a salvage
value of $8,000, or a used track-type tractor
for $24,680, with an estimated life of 3 years
and no salvage value and an estimated net
annual income of $12,000.
If the contractor's MARR is 20%, which
tractor, if any, should she choose?
Dr. Assakkaf
Slide No. 12

6
ENCE 202
Eng. Econ
Example 4 (continued)
Handout 9
Approach 1. (comparison on the basis of equal lives)

A. J. Clark School of Engineering Department of Civil and Environmental Engineering


8,000
26,000 26,000 26,000 26,000 26,000
New 26,000
tractor
0 6 Assumed Salvage
Value

73,750 30,000
12,000 12,000 12,000 26,000 26,000
Old New 26,000
tractor tractor
0 3 0 3

24,680 73,570

NPWnew = -73,570 + 26,000(P/A,20,3) + 30,000(P/F,20,3) = -73,570 + 26,000(2.10648) + 30,000(0.5787) = -$1,443

NPWold = -24,680 + 12,000(P/A,20,3) = -24,680 + 12,000(2.10648) = + $597

Conclusion: Old tractor is a better Alternative Dr. Assakkaf


Slide No. 13

ENCE 202
Eng. Econ
Example 4 (continued)
Handout 9
Approach 2. (comparison on the basis of equal replacement conditions)

A. J. Clark School of Engineering Department of Civil and Environmental Engineering


8,000
26,000 26,000 26,000 26,000 26,000
26,000
New
tractor 0
6

73,570

12,000 12,000 12,000 12,000 12,000 12,000


Old
tractor
0 6

24,680 24,680

NPWnew = -73,570 + 26,000(P/A,20,6) + 8,000(P/F,20,6) = -73570 + 26,000(3.32551) + 8,000(0.33490) = $15,570

NPWold = -24,680 + 12,000(P/A,20,6) - 24,680(P/F,20,3) = -24,680 + 12,000 (3.32551) - 24,680(0.57870) = +$944

Conclusion: New tractor is a better Alternative


Dr. Assakkaf
Slide No. 14

7
ENCE 202
Eng. Econ
Handout 9
Rate of Return (ROR) Analysis
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

Knowing the anticipated rate of return of an investment


permits decision maker to have more "perceived" confidence
in its decision!

Definition:
The rate of return of a proposed investment is that interest
rate which makes the discounted present worth of the
investment equal to zero.

To calculate the rate of return, simply set up the equation to


be equal to zero and solve for i.

Dr. Assakkaf
Slide No. 15

ENCE 202
Eng. Econ
Handout 9
Example 5
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

A contractor is considering the purchase of


either a new track-type tractor for $73,570,
which has a 6-year life with an estimated net
annual income of $26,000, or a used track-
type tractor for $24,680, with an estimated life
of 3 years and no salvage value and an
estimated net annual income of $12,000.
If the contractor's MARR is 20%, which
tractor, if any, should be chosen?
Dr. Assakkaf
Slide No. 16

8
ENCE 202
Eng. Econ
Example 5 (continued)
Handout 9
Approach 1. (comparison on the basis of equal lives)

A. J. Clark School of Engineering Department of Civil and Environmental Engineering

26,000 26,000 26,000 26,000 26,000


New 26,000
tractor
0 6
P
NPWnew = 73,570 + 26,000 , i,6 = 0
A
73,750
P 73,570 (1 + i ) 1 6
12,000 12,000 12,000 , i,6 = = 2.82962 =
i (1 + i )
6
Old A 26,000
tractor
inew = 26.9%
0 3

P
24,680 NPWold = 24,680 + 12,000 , i,3 = 0
A
P 24,680 (1 + i ) 1 3

, i,3 = = 2.05667 =
i(1 + i )
3
A 12,000
iold = 21.5%
Dr. Assakkaf
Slide No. 17

ENCE 202
Eng. Econ
Example 5 (continued)
Handout 9 Iterative Solution

A. J. Clark School of Engineering Department of Civil and Environmental Engineering

P
NPW new = 73,570 + 26,000 , i, 6 = 0
A
P 73,570 (1 + i ) 1 6
(1 + i )6 1
, i ,6 = = 2.82962 = inew =
i(1 + i ) 2.82962(1 + i )
6 6
A 26,000

P
NPW new = 24,680 + 12,000 , i,3 = 0
A
P 24,680 (1 + i ) 1 3
(1 + i )3 1
, i ,6 = = 2.05667 = iold =
i (1 + i ) 2.05667(1 + i )
3 3
A 12,000

Dr. Assakkaf
Slide No. 18

9
ENCE 202
Eng. Econ
Example 5 (continued)
Handout 9 Iterative Solution

A. J. Clark School of Engineering Department of Civil and Environmental Engineering


i NPW new i NPWold
0.200 12893 0.150 2719
(1 + i )6 1 0.235 5877 0.167 1985 (1 + i )3 1
inew = 0.254 2498 0.180 1415 iold =
2.05667(1 + i )
3
2.82962(1 + i )
6
0.262 1027 0.190 990
0.266 416 0.198 683
0.268 168 0.203 466
0.268 67 0.207 316
0.268 27 0.210 214
0.269 11 0.212 144
0.269 4 0.213 97
0.269 2 0.214 65
0.269 1 0.214 43
0.269 0 0.215 29
0.269 0 0.215 19
0.269 0 0.215 13
0.269 0 0.215 9
0.269 0 0.215 6
0.269 0 0.215 4
0.269 0 0.215 3
0.269 0 0.215 2
0.269 0 0.215 1
0.269 0 0.215 1
inew = 26.9% 0.269
0.269
0
0
0.215
0.215
1
0
inew = 21.5%
0.269 0 0.215 0 Dr. Assakkaf
Slide No. 19

ENCE 202
Eng. Econ
Handout 9
Example 5 (continued)
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n If MARR is 20%

n Then, the new tractor is selected


because i = 26.9 % is greater than
MARR = 20%

Dr. Assakkaf
Slide No. 20

10
ENCE 202
Eng. Econ
Handout 9
Rate of Return (ROR) Analysis
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

If we assume the salvage value for the new tractor to be


$30,000 after 3 years, the NPWnew will be:

NPWold = -24,680 + 12,000(P/A,i,3) = 0

iold = 21.5%

NPWnew = - 73,570 + 26,000(P/A,i,3) + 30,000(P/F,i,3) = 0

inew = 18.9%
Before the decision can be reached
YOU MUST KNOW YOUR MARR.
If MARR = 20% and 3 year analysis period, we choose old tractor.
If MARR = 30%, we choose neither tractor - do nothing alternative.
If the MARR was 15%, which alternative should we select then?
Dr. Assakkaf
Slide No. 21

ENCE 202
Eng. Econ
Handout 9
Rate of Return (ROR) Analysis
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

Both NPWold and NPWnew exceed the MARR = 15%.


But since the old tractor yields a higher MARR, should it not be
selected?
To answer this question, determine each alternative's net present
worth at 15%.
NPWold = -24,680 + 12,000(P/A,15,3) = $2,719
NPWnew = - 73,570 + 26,000(P/A,15,3) + 30,000(P/F,15,3) = $5,519

According to the above NPW analysis, the new tractor yields a


higher value for a MARR of 15%?

Shouldn't the alternative with the higher rate of return would yield
the higher NPW regardless of the assumed interest rate?
NO IT SHOULD NOT!
The initial investments in the tractor examples we used are not theDr. Assakkaf
same. Slide No. 22

11
ENCE 202
Incremental Rate of Return
Eng. Econ
Handout 9
(ROR) Analysis
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

When we examined the rate of return of each alternative, we have


ignored their respective differences in initial cash flows. Therefore,
we can obtain misleading results through such an analysis.
To deal with the problem of unequal initial investments, an
incremental rate of return (IROR) analysis is required.

"For alternatives that have a satisfactory rate of return (ROR), what
is the IROR of the difference in the cash flows of the alternatives?"

To make this analysis, first arrange the alternatives in ascending


order of initial cash flow. Then compare alternatives, two by two,
alternatively rejecting the alternative with the lower IROR.

Dr. Assakkaf
Slide No. 23

ENCE 202
Incremental Rate of Return
Eng. Econ
Handout 9
(ROR) Analysis
A. J. Clark School of Engineering Department of Civil and Environmental Engineering
8,000
26,000 26,000 26,000 26,000 26,000
26,000
New
tractor 0
6

73,570

12,000 12,000 12,000 12,000 12,000 12,000


Old
tractor
0 6

24,680 24,680

Dr. Assakkaf
Slide No. 24

12
ENCE 202
Incremental Rate of Return
Eng. Econ
Handout 9
(ROR) Analysis
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

NPWnew-old = - 48,890 + 14,000(P/A,i,6) + 24,680(P/F,i,3) + 8,000(P/F,i,6) = 0

i = 30.9%
24,680

8,000

14,000

0 6

48,890

Dr. Assakkaf
Slide No. 25

ENCE 202
Incremental Rate of Return
Eng. Econ
Handout 9
(ROR) Analysis
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n While the initial investment of $24,680 for the old tractor will yield a
ROR of 21.5%, the incremental increase in initial investment of
$48,890 (by purchasing the new tractor) will yield an IROR of
30.9%.
n Now that all the rates of return are known, a decision can be
reached which is dependent on the MARR.
For a MARR of 20% the ROR of the new tractor is too low, and
therefore the old tractor is chosen.
For a MARR of 15% both alternatives exceed it and we have to examine
the IROR.
In this case the IROR is higher than the MARR, so we should choose
the new tractor.

Dr. Assakkaf
Slide No. 26

13
INTRODUCTION TO
ENGINEERING ECONOMICS
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

by

Dr. Ibrahim A. Assakkaf


ENCE 202
Spring 2000
Department of Civil and Environmental Engineering
University of Maryland

ENCE 202
Economic Equivalence
Eng. Econ
Handout 10
Involving Inflation
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Measure of Inflation and Deflation


The consumer price index (CPI) is the ratio
between the current price of a commodity
or service to the price at some earlier
reference time.
For example, the base year is 1967 (index
=100), commodity price is $1.46/lb. The
price in 1993 is $5.74/lb. Therefore, the
1993 index is 5.74/1.46 = 393.2

Dr. Assakkaf
Slide No. 2

1
ENCE 202
Economic Equivalence
Eng. Econ
Handout 10
Involving Inflation
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n The Annual Inflation Rate


The annual inflation rate at t+1 can be
computed as

CPI t + 1 CPI t
annual inflation rate at t+1 =
CPI t

Dr. Assakkaf
Slide No. 3

ENCE 202
Economic Equivalence
Eng. Econ
Handout 10
Involving Inflation
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n The Annual Inflation Rate


Assume the average inflation rate = f
The average rate can be computed as

CPI t (1 + f ) n = CPI t + n

Or
CPI t + n
f =n 1
CPI t
Dr. Assakkaf
Slide No. 4

2
ENCE 202
Economic Equivalence
Eng. Econ
Handout 10
Involving Inflation
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Example

1 / 14
246.80 246.80
f = 14 1 = 1 = 6.882%
97.2 97.2

Dr. Assakkaf
Slide No. 5

ENCE 202
Economic Equivalence
Eng. Econ
Handout 10
Involving Inflation
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

n Purchasing Power of Money


Purchasing power at t in reference to t-n
It is equal to
CPI t n
CPI t
Define k = annual rate of loss in purchasing
power. Therefore, the average rate of loss
of purchasing power is

Dr. Assakkaf
Slide No. 6

3
ENCE 202
Economic Equivalence
Eng. Econ
Handout 10
Involving Inflation
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

CPI base year CPI base year


(1 k ) n =
CPI t CPI t + n

Resulting into CPI t = (1 k ) n CPI t + n

Therefore, 1
(1 + f ) n =
(1 k ) n
This equation relates the average f and k.

Dr. Assakkaf
Slide No. 7

ENCE 202
Depreciation and Depreciation
Eng. Econ
Handout 10
Accounting
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

Depreciation is the loss in value of a piece of equipment


over time, generally caused by wear and tear from use,
deterioration, obsolescence, or reduced need.

Depreciation accounting is the systematic allocation of the


costs of a capital investment over some specific number of
years.

Dr. Assakkaf
Slide No. 8

4
ENCE 202
Eng. Econ
Handout 10
Depreciation Accounting
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

Reasons for calculating the depreciation accounting value


(usually termed book value) of a piece of equipment:
1. To provide the construction owner and project manager with an
easily calculated estimate of the current market value of the
equipment.
2. To provide a systematic method for allocating the depreciation
portion of equipment ownership costs over a period of time and
to a specific productivity rate.
3. To allocate the depreciation portion of ownership costs in such a
manner that the greatest tax benefits will accrue.

Dr. Assakkaf
Slide No. 9

ENCE 202
Eng. Econ
Handout 10
Depreciation Accounting
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

Information needed for depreciation accounting:


1. The purchase price of the piece of equipment, P
2. The optimum period of time to keep the equipment or the
recovery period allowed for income tax purposes, N
3. The estimated resale value at the close of the optimum period of
time, F

Dr. Assakkaf
Slide No. 10

5
ENCE 202
Depreciation Calculation
Eng. Econ
Handout 10
Methods
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

1. Straight-line (SL) Method

2. Sum-of-the-years (SOY) Method

3. Declining-balance (DB) Method

Dr. Assakkaf
Slide No. 11

ENCE 202
Eng. Econ
Handout 10
Straight-line (SL) Method
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

The annual amount of depreciation Dm,,for any year m, is a constant


value, and thus the book value BVm decreases at a uniform rate
over the useful life of the equipment.

Depreciation rate Rm = 1/N

Annual depreciation amount Dm = Rm (P - F) = (P - F)/N

Book value at year m BVm = P - mDm

Note: The value (P - F) is often referred to as the depreciable value of


the investment.

Dr. Assakkaf
Slide No. 12

6
ENCE 202
Eng. Econ
Handout 10
Example 1
A. J. Clark School of Engineering Department of Civil and Environmental Engineering
A piece of equipment is available for purchase for $12,000, has an estimated useful
life of 5 years, and has an estimated salvage value of $2,000. Determine the
depreciation and the book value for each of the 5 years using the SL method.
Rm = 1/5 = 0.2
Dm= 0.2(12,000 - 2,000) = $2,000 per year
The table of values is: BV2 = 12,000 2( 2,000) = $8,000
m BVm-1 Dm BVm

0 $0 $0 $12,000
1 12,000 2,000 10,000
2 10,000 2,000 8,000
3 8,000 2,000 6,000
4 6,000 2,000 4,000
5 4,000 2,000 2,000

If the equipment is expected to be used about 1,400 hours per year then its
estimated hourly depreciation portion of the ownership cost is
Dr. Assakkaf
$2,000/1,400 = $1.428 = $1.43 per hour Slide No. 13

ENCE 202
Eng. Econ
Handout 10
Sum-of-the-years (SOY) Method
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

SOY is an accelerated depreciation method (fast write-off), which is


a term applied to accounting methods which permit rates of
depreciation faster than straight line.

The rate of depreciation is a factor Rm (depreciation rate) times the


depreciable value (P - F).
Dm = Rm (P-F)
SOY = N(N+1)/2
Rm = (N-m+1)/SOY

The annual depreciation Dm for mth year (at any age m) is


Dm = {(N-m+1)/SOY}(P-F)

The book value at the end of year m is


BVm = P-(P-F)[m(N-m/2+0.5)/SOY] Dr. Assakkaf
Slide No. 14

7
ENCE 202
Eng. Econ
Handout 10
Example 2
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

Using the same values as given in Example 1, calculate the allowable depreciation
and the book value for each of the 5 years using the SOY method.

SOY = 1+2+3+4+5 = 15 or =5(6)/2 = 15


Rm = (5-m+1)/15
Dm = R m (12,000-2,000) = (5-m+1)10,000/(15)

Year Rm Dm BVm

0 $ 0 $12,000
1 5/15 3,333 8,667
2 4/15 2,667 6,000
3 3/15 2,000 4,000
4 2/15 1,333 2,667
5 1/15 667 2,000

Dr. Assakkaf
Slide No. 15

ENCE 202
Eng. Econ
Handout 10
Declining-balance (DB) Method
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

Declining-balance (DB) methods also are accelerated depreciation


methods that provide for even larger portions of the cost of a piece
of equipment to be written off in the early years.
DB method often more nearly approximates the actual loss in
market value with time.
Declining methods range from 1.25 times the current book value
divided by the life to 2.00 times the current book value divided by
the life (the latter is termed double declining balance).

Note: Although the estimated salvage value F is not included in the

calculation, the book value cannot go below the salvage value.

Dr. Assakkaf
Slide No. 16

8
ENCE 202
Eng. Econ
Handout 10
Declining-balance (DB) Method
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

The following equations are necessary to use the declining-balance


methods.
The symbol R is used for the depreciation rate for the declining-balance
method of depreciation:

1. For 1.25 declining-balance (1.25DB) method, R = 1.25/N


For 1.50 declining-balance (1.5DB) method, R = 1.50/N
For 1.75 declining-balance (1.75DB) method, R = 1.75/N
For double-declining-balance (DDB) method, R = 2.00/N

2. The allowable depreciation Dm, for any year m and any depreciation rate R is

Dm = R P(1 - R)m-1 or D m = (BVm-1)R

3. The book value for any year m is

BVm = P(1-R)m or BVm = BV m-1 - BVm provided that BVm > F


Dr. Assakkaf
Slide No. 17

ENCE 202
Eng. Econ
Handout 10
Example 3
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

For the same piece of equipment described in Example 2, calculate the


allowable depreciation and the book value for each of the 5 years of its life.

R = 2.0/5 = 0.4
Dm = 0.4(BVm-1)
BVm = BVm-1 - Dm

Year Dm BVm

0 0 12,000
1 0.4x12,000 = 4,800 7,200
2 0.4x7,200 = 2,880 4,320
3 0.4x4,320 = 1,728 2,592
4 0.4x2,592 = 592 2,000
5 0 2,000
Dr. Assakkaf
Slide No. 18

9
ENCE 202
Depreciation Curves for the
Eng. Econ
Handout 10
Examples
A. J. Clark School of Engineering Department of Civil and Environmental Engineering

12,000
SL - Straight-line depreciation method
SOY - Sum-of-the-Years depreciation method
DDB - Double-Declining-Balance depreciation method
10,000
Book value, $

8,000

SL
6,000 SOY

DDB

4,000

F = $2,000
2,000

0 1 2 3 4 5
Time, years
Dr. Assakkaf
Slide No. 19

ENCE 202
Eng. Econ
Handout 10

A. J. Clark School of Engineering Department of Civil and Environmental Engineering

Good Luck with your Finals

Dr. Assakkaf
Slide No. 20

10

Potrebbero piacerti anche