Pao, Y.C - Engineering Analysis Interactive Methods and Programs With FORTRAN ver 2.pdf

(4477 KB) Pobierz
Engineering
Analysis
Interactive Methods and Programs
with FORTRAN, QuickBASIC, MATLAB,
and Mathematica
Y. C. Pao
CRC Press
Boca Raton London New York Washington, D.C.
© 2001 by CRC Press LLC
Acquiring Editor:
Project Editor:
Cover design:
Cindy Renee Carelli
Albert W. Starkweather, Jr.
Dawn Boyd
Library of Congress Cataloging-in-Publication Data
Catalog record is available from the Library of Congress
This book contains information obtained from authentic and highly regarded sources. Reprinted
material is quoted with permission, and sources are indicated. A wide variety of references are listed.
Reasonable efforts have been made to publish reliable data and information, but the author and the
publisher cannot assume responsibility for the validity of all materials or for the consequences of their use.
Neither this book nor any part may be reproduced or transmitted in any form or by any means,
electronic or mechanical, including photocopying, microfilming, and recording, or by any information
storage or retrieval system, without prior permission in writing from the publisher.
The consent of CRC Press LLC does not extend to copying for general distribution, for promotion,
for creating new works, or for resale. Specific permission must be obtained in writing from CRC Press
LLC for such copying.
Direct all inquiries to CRC Press LLC, 2000 Corporate Blvd., N.W., Boca Raton, Florida 33431.
Trademark Notice:
Product or corporate names may be trademarks or registered trademarks, and are
only used for identification and explanation, without intent to infringe.
Mathematica
®
is developed by Wolfram Research, Inc., Champaign, IL.
Windows
®
is developed by Microsoft Corp., Redmond, WA.
© 1999 by CRC Press LLC
No claim to original U.S. Government works
International Standard Book Number 0-8493-2016-X
Printed in the United States of America 1 2 3 4 5 6 7 8 9 0
Printed on acid-free paper
© 2001 by CRC Press LLC
Files Available from CRC Press
FORTRAN, QuickBASIC, MATLAB,
and Mathematic files, which contain the
source and executable programs associated with this book are available from CRC
Press’ website —
http://www.crcpress.com.
Before downloading, prepare two 3.5-inch, high-density disks — one for the
files and one for a backup. Also create a temporary directory named <interactive>
on your hard drive, which will expedite downloading. To download these files, type:
http://www.crcpress.com/us/ElectronicProducts/downandup.asp.
When prompted, enter
2016
under name and
crcpress
under password. Then store the files in the
<interactive> folder. If you encounter a problem, call 1-800-CRC-PRES (272-7737).
The dowloaded files may be copied to a 3.5-inch disk. The temporary <interactive>
folder then may be deleted. Don’t forget to make a backup copy of your 3.5-inch disk.
There are four subdirectories
<FORTRAN>, <QB>, <mFiles>,
and
<Math-
tica>
which contain the
FORTRAN
source and executable programs,
QuickBASIC
source and executable programs,
m
files of
MATLAB,
and input and output state-
ments of for the
Mathematica
operations depicted in this textbook, respectively:
1.
<FORTRAN>
has the following files:
Bairstow.FOR
EditFOR.EXE
FindRoot.FOR
Gauss.FOR
LeastSqG.FOR
NuIntgra.FOR
Relaxatn.FOR
CharacEquationFOR
EigenVec.FOR
FOR1.EXE
GauJor.FOR
LINK.EXE
OdeBvpFD.FOR
RungeKut.FOR
CubeSpln.FOR
EigenvIt.FOR
FOR2.EXE
LagrangI.FOR
MatxInvD.FOR
OdeBvpRK.FOR
Volume.FOR
DiffTabl.FOR
ExactFit.FOR
FORTRAN.LIB
LeastSq1.FOR
NewRaphG.FOR
ParabPDE.FOR
WavePDE.FOR
EDITFOR.EXE is provided for re-editing the *.FOR source programs such as
Bairstow.FOR, CubeSpln.FOR, etc. (refer to the
FORTRAN
programs index) to
include supplementary subprograms describing the problem which need to be solved
interactively. To re-edit, insert the 3.5-inch disk into Drive A and when the a:\ prompt
shows, type cd fortran to switch to the
<FORTRAN>
subdirectory. For example,
to solve a polynomial by the Bairstow’s method one needs to define the polynomial,
for which the roots are to be computed. To reedit Bairstow.FOR, the user enters
a:\editfor Bairstow.for to add new
FORTRAN
statements or change them. Notice
that both upper and lower case characters are acceptable. While creating a new
version of Bairstow.FOR, the old version will be saved in Bairstow.BAK.
To create an object file, FOR1 filename such as Bairstow.FOR and FOR2 need
to be implemented. A BAISTOW.OBJ will then be generated. For linking with the
FORTRAN
library functions,
FORTRAN.LIB,
one enters, for example, LINK
Bairstow to create an executable file Bairstow.EXE. To
run,
the user simply types
Bairstow after the prompt A:\ and then answers questions interactively.
© 2001 by CRC Press LLC
2.
<QuickBASIC>
has the following files:
Select.BAS
Bairstow.EXE
EigenStb.EXE
ExactFit.EXE
LeastSq1.EXE
OdeBvpFD.EXE
Relaxatn.EXE
Bairstow.QB
EigenStb.QB
ExactFit.QB
LagrangI.QB
MatxMtpy.QB
OdeBvpRK.QB
Volume.QB
Select.EXE
BRUN40.EXE
EigenVec.EXE
FindRoot.EXE
LeastSqG.EXE
OdeBvpRK.EXE
RungeKut.EXE
CharacEq.QB
EigenVec.QB
FindRoot.QB
LeastSq1.QB
NewRaphG.QB
ParabPDE.QB
WavePDE.QB
CharacEq.EXE
EigenVib.EXE
Gauss.EXE
MatxInvD.EXE
ParabPDE.EXE
Volume.EXE
CubeSpln.QB
EigenVib.QB
GauJor.QB
LeastSqG.QB
NuIntgra.QB
Relaxatn.QB
CubeSpln.EXE
EigenvIt.EXE
LagrangI.EXE
NuIntgra.EXE
QB.EXE
DiffTabl.QB
EigenvIt.QB
Gauss.QB
MatxAlgb.QB
OdeBvpFD.QB
RungeKut.QB
To commence
QuickBASIC
, when a:\ is prompted on screen, the user enters
QB. QB.EXE and BRUN40.EXE therefore are included in
<QB>
. The program
Select
enables user to select the available
QuickBASIC
program in this textbook.
After user responds with C:\Select, the screen shows a menu as shown in Figure 1
and user then follow the screen help-messages to run a desired program.
3.
<mFiles>
is a subdirectory associated with
MATLAB
and has the following
files:
BVPF.m
F.m
FuncZ.m
integrnd.m
ParabPDE.m
WavePDE.m
DerivatF.m
FindRoot.m
FuncZnew.m
LagrangI.m
Relaxatn.m
DiffTabl.m
FP.m
FunF.m
LeastSqG.m
Volume.m
EigenvIt.m
Functns.m
GauJor.m
NewRaphG.m
Warping.m
When the 3.5-inch disk containing all of these
m
files is in Drive A, any of these
files can be accessed by enclosing the filename inside a pair of parentheses as
illustrated in
Section 3.2
where F.m and FP.m are required for FindRoot.m and in
Section 5.2
where an integrand function
integrnd.m
is defined for numerical inte-
gration. If all files have been added into
MATLAB
library m files, then no reference
to the Drive A is necessary and the pair of parentheses can also be dropped.
4.
<Mathtica>
is a subdirectory associated with
Mathematica
and has the files of:
Bairstow.MTK
ExactFit.MTK
Gauss.MTK
LeastSqG.MTK
OdeBvpFD.MTK
RungeKut.MTK
CubeSpln.MTK
FindRoot.MTK
GauJor.MTK
MatxAlgb.MTK
OdeBvpRK.MTK
Volume.MTK
DiffTabl.MTK
FUNCTNS.MTK
LagrangI.MTK
NewRaphG.MTK
ParabPDE.MTK
WavePDE.MTK
EigenVec.MTK
EigenvIt.MTK
LeastSq1.MTK
NuIntgra.MTK
Rexalatn.MTK
© 2001 by CRC Press LLC
Any of the above programs can be executed by
Mathematica
via mouse oper-
ation. First, by clicking the
File
option and when the pull-down menu appears, select
Open
and then enter the filename such as a:\Mathtica\MatxAlgb.MTK (assuming
the 3.5-inch disk containing
<Mathtica>
is in Drive A) and press the
Enter
key.
When all lines of this file is displayed on screen, move cursor to any input line such
as
In[1]
: A = {{1,2},{3,4}}; MatrixForm[A] and hit the
Enter
key.
Mathematica
will respond by repeating those lines for
Out[1]
. Hence, user can reproduce all of
the output lines by sequentially running the input lines [1] through [9]. However, if
user first run In[1] and then In[3],
Mathematica
cannot perform the addition of [A]
because [B] is not defined. If after having run In[1], user selects In[5], or, In[6],
Mathematica
then has no problem of giving out results.
FIGURE 1.
The Select screen.
© 2001 by CRC Press LLC
Zgłoś jeśli naruszono regulamin