Beruflich Dokumente
Kultur Dokumente
Abstract
INTRODUCTION
Programming languages such as Fortran, Basic, Pascal and C have been used
extensively by scientists and engineers, but they are often difficult to
program and to debug. Modern commonly-available software has gone a
long way to overcoming such difficulties. Matlab, Maple, Mathematica, and
MathCAD for example, are rather more user-friendly, as many operations
have been modularized, such that the programmer can see rather more clearly
365
“1st International Symposium on Computing in Informatics and Mathematics (ISCIM 2011)”
in Collabaration between EPOKA University and “Aleksandër Moisiu” University of Durrës
on June 2-4 2011, Tirana-Durres, ALBANIA
Several powerful and infrequently used Excel features are available and can
be used to develop practical and powerful models for teaching civil
engineering concepts. These features include data lists, data menu options,
data filtering, referencing and searching lists, basic spreadsheet functions
such as “Vlookup”, and pivot table reports. Sorting the data helps bring
similar records together for visual inspection or other purposes such as
preparing reports and charts. Using the “Data, Sort” menu option, the list’s
data can be arranged in an order that is chosen by sorting the records.
Filtering the data is also a useful way to view a subset of the records that
compose a list. To filter a list is to extract records from it, based on criteria
set by the user. Referencing and searching the list is another important part
of the data management process.
In addition to the features and functions of Excel, its programming
capabilities, called visual basic for applications (VBA) are very powerful and
can be used to solve complex civil engineering problems.
However there is a lot more to Excel than meets the eye of many engineers.
366
“1st International Symposium on Computing in Informatics and Mathematics (ISCIM 2011)”
in Collabaration between EPOKA University and “Aleksandër Moisiu” University of Durrës
on June 2-4 2011, Tirana-Durres, ALBANIA
There are numerous functions for assisting in financial, date and time, math
and trig, statistical, database, text, logical, information, and general
engineering calculations. Its graphing facilities are impressive as is its data
handling facilities. What are often overlooked are the modeling tools
including optimization, sensitivity analysis, and scenario management.
Features like data lists and Pivot table/charts provide enormous flexibility
for summarizing and formatting data. Data can be imported and
incorporated in the worksheets anywhere from legacy files to modern data
bases. By adding input controls and data validation, worksheets can be
designed to accept valid data for special uses from the design of amusement
park fountains to sales engineering expense reports. Furthermore “add-ins”
provide numerous facilities for statistical analysis, optimization, and
database interfaces.
Because VBA is generally incorporated in software applications that exist
on the Windows platform, numerous software applications contain it. Once
you learn VBA for Excel you can use VBA to extend Access, Word,
PowerPoint, Visio, Outlook, and numerous other software packages like
AutoCad and Arena. VBA is actually a very simple language, but when
used in the context of an object-based application like Excel becomes a
powerful tool.
Goal Seek, is easy to use, but it is limited – with it one can solve a single
367
“1st International Symposium on Computing in Informatics and Mathematics (ISCIM 2011)”
in Collabaration between EPOKA University and “Aleksandër Moisiu” University of Durrës
on June 2-4 2011, Tirana-Durres, ALBANIA
368
“1st International Symposium on Computing in Informatics and Mathematics (ISCIM 2011)”
in Collabaration between EPOKA University and “Aleksandër Moisiu” University of Durrës
on June 2-4 2011, Tirana-Durres, ALBANIA
(Figure 1.1).
The maximum iterations and the maximum change properties can be
specified on the “Calculation” tab of the “Options” dialog (Figure 1.1).
369
“1st International Symposium on Computing in Informatics and Mathematics (ISCIM 2011)”
in Collabaration between EPOKA University and “Aleksandër Moisiu” University of Durrës
on June 2-4 2011, Tirana-Durres, ALBANIA
3. Process Tools -> Goal Seek to display the Goal Seek dialog, and
enter the information shown in Figure 1.2.
Click OK.
The Result cell is about -2.8E-5 (close to the target 0). The solution is
2.67 appearing in the Variable cell (B3).
Decision Variables
371
“1st International Symposium on Computing in Informatics and Mathematics (ISCIM 2011)”
in Collabaration between EPOKA University and “Aleksandër Moisiu” University of Durrës
on June 2-4 2011, Tirana-Durres, ALBANIA
The decision variables are the parameters that you will need to design the
tank (i.e. the dimensions). They are: Ra, Ha, and Hb.
Dependent Variables
These are variables that are used to define the constraints. They are also
used in a supporting role for calculating the objective function.
Coefficients
Coefficients are numbers that you can change to modify the design: Vdesign
, Zdesign
Constraints
Constraints are limitations on the decision variables. In our case they require
that the volume be at least equal to Vdesign and that the slope of the cone
sides be equal to Zdesign. Mathematically:
Vt >= Vdesign
Za = Zdesign
Implementation
The implementation is shown in Figures 1.4 — 1.5.
372
“1st International Symposium on Computing in Informatics and Mathematics (ISCIM 2011)”
in Collabaration between EPOKA University and “Aleksandër Moisiu” University of Durrës
on June 2-4 2011, Tirana-Durres, ALBANIA
Figure 1.5. Solution for the steel tank design shown in Formula Mode
373
“1st International Symposium on Computing in Informatics and Mathematics (ISCIM 2011)”
in Collabaration between EPOKA University and “Aleksandër Moisiu” University of Durrës
on June 2-4 2011, Tirana-Durres, ALBANIA
Dim Q As Single, g As Single
Dim b As Single, z As Single yn = y1 - f1 / fp
Dim y As Single, T As Single Tn = b + 2 * z * yn
Dim P As Single, A As Single An = (b + z * yn) * yn
Dim f As Single, fp As Single fn = Q ^ 2 * Tn - g * An ^ 3
nmax = 100: epsilon = 0.001 If Abs(fn) < epsilon Then
Q = Range("C13") MsgBox "solution: y = " + Str(yn)
g = Range("C14") Range("C19") = yn
b = Range("C15") Exit Do
z = Range("C16") End If
y1 = Range("C17") y2 = y1
y2 = y1 + 0.1 y1 = yn
k=1 k=k+1
Do While k < nmax Loop
T1 = b + 2 * z * y1 If k >= nmax Then
A1 = (b + z * y1) * y1 MsgBox "No convergence after " +
f1 = Q ^ 2 * T1 - g * A1 ^ 3 Str(nmax) + " iterations"
y2 = y1 + 0.1 End If
T2 = b + 2 * z * y2 nmax = 100
A2 = (b + z * y2) * y2 epsilon = 0.001
f2 = Q ^ 2 * T2 - g * A2 ^ 3 End Sub
fp = (f2 - f1) / (y2 - y1)
374
“1st International Symposium on Computing in Informatics and Mathematics (ISCIM 2011)”
in Collabaration between EPOKA University and “Aleksandër Moisiu” University of Durrës
on June 2-4 2011, Tirana-Durres, ALBANIA.
375
“1st International Symposium on Computing in Informatics and Mathematics (ISCIM 2011)”
in Collabaration between EPOKA University and “Aleksandër Moisiu” University of Durrës
on June 2-4 2011, Tirana-Durres, ALBANIA.
REFERENCES
[1] Baker, J. and Sugden, S., 2003. Spreadsheets in education– the first 25 years.
SIE journal, 1(1), 18-43.
[2] Zaneldin, E., and Ashur, S., 2008. Using Spreadsheets as a Tool in Teaching
Construction Management Concepts and Applications. The 2008 American Society
of Engineering Education (ASEE) Annual Conference. June 22-25, 2008,
Pittsburgh, PA, USA.
[3] Hegazy, T. and Ersahin, T., 2001. Simplified spreadsheet solutions. I:
Subcontractor information system. Journal of Construction Engineering and
Management. ASCE, 127(6), 461–468.
[4] Hegazy, T., and Ersahin, T., 2001. Simplified spreadsheet solutions. II: Overall
schedule optimization. Journal of Construction Engineering and Management.
ASCE, 127(6), 469–475
[5] Numerical Methods for Engineers, Fifth Edition, Steven C. Chapra, Raymond
P. Canale, McGraw HILL, 2006
[6] Introduction to VBA for Excel, Second Edition, Steven C. Chapra, Prentice
Hall, 2010
376