Pao Y. - CRC Press - Engineering Analysis.pdf

(4380 KB) Pobierz
77160759 UNPDF
Engineering
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
Analysis
77160759.001.png
Acquiring Editor:
Cindy Renee Carelli
Project Editor:
Albert W. Starkweather, Jr.
Cover design:
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, microlming, 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. Specic 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.
Product or corporate names may be trademarks or registered trademarks, and are
only used for identication 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
Trademark Notice:
Files Available from CRC Press
, and Mathematic les, 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
les and one for a backup. Also create a temporary directory named <interactive>
on your hard drive, which will expedite downloading. To download these les, type:
,
QuickBASIC
,
MATLAB
When prompted, enter
under password. Then store the les in the
<interactive> folder. If you encounter a problem, call 1-800-CRC-PRES (272-7737).
The dowloaded les 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
under name and
crcpress
<FORTRAN>
,
<QB>
,
<mFiles>
, and
<Math-
tica>
which contain the
FORTRAN
source and executable programs,
QuickBASIC
source and executable programs,
m
les of
MATLAB
, and input and output state-
ments of for the
Mathematica
operations depicted in this textbook, respectively:
1.
<FORTRAN>
has the following les:
Bairstow.FOR CharacEquationFOR CubeSpln.FOR DiffTabl.FOR
EditFOR.EXE EigenVec.FOR
EigenvIt.FOR ExactFit.FOR
FindRoot.FOR FOR1.EXE
FOR2.EXE
FORTRAN.LIB
Gauss.FOR GauJor.FOR
LagrangI.FOR LeastSq1.FOR
LeastSqG.FOR LINK.EXE
MatxInvD.FOR NewRaphG.FOR
NuIntgra.FOR OdeBvpFD.FOR
OdeBvpRK.FOR ParabPDE.FOR
Relaxatn.FOR RungeKut.FOR
Volume.FOR WavePDE.FOR
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 dene 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 le, FOR1 lename such as Bairstow.FOR and FOR2 need
to be implemented. A BAISTOW.OBJ will then be generated. For linking with the
FORTRAN
.LIB, one enters, for example, LINK
Bairstow to create an executable le Bairstow.EXE. To
library functions,
FORTRAN
, the user simply types
Bairstow after the prompt A:\ and then answers questions interactively.
run
© 2001 by CRC Press LLC
FORTRAN
2016
EDITFOR.EXE is provided for re-editing the *.FOR source programs such as
Bairstow.FOR, CubeSpln.FOR, etc. (refer to the
FORTRAN
77160759.002.png
2.
<QuickBASIC>
has the following les:
Select.BAS Select.EXE
Bairstow.EXE BRUN40.EXE
CharacEq.EXE
CubeSpln.EXE
EigenStb.EXE EigenVec.EXE
EigenVib.EXE
EigenvIt.EXE
ExactFit.EXE FindRoot.EXE
Gauss.EXE
LagrangI.EXE
LeastSq1.EXE LeastSqG.EXE
MatxInvD.EXE
NuIntgra.EXE
OdeBvpFD.EXE OdeBvpRK.EXE
ParabPDE.EXE
QB.EXE
Relaxatn.EXE RungeKut.EXE
Volume.EXE
Bairstow.QB CharacEq.QB
CubeSpln.QB
DiffTabl.QB
EigenStb.QB EigenVec.QB
EigenVib.QB
EigenvIt.QB
ExactFit.QB FindRoot.QB
GauJor.QB
Gauss.QB
LagrangI.QB LeastSq1.QB
LeastSqG.QB
MatxAlgb.QB
MatxMtpy.QB NewRaphG.QB
NuIntgra.QB
OdeBvpFD.QB
OdeBvpRK.QB ParabPDE.QB
Relaxatn.QB
RungeKut.QB
Volume.QB WavePDE.QB
, when a:\ is prompted on screen, the user enters
QB. QB.EXE and BRUN40.EXE therefore are included in
To commence
QuickBASIC
. The program
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.
enables user to select the available
QuickBASIC
3.
<mFiles>
is a subdirectory associated with
MATLAB
and has the following
les:
BVPF.m DerivatF.m DiffTabl.m EigenvIt.m
F.m FindRoot.m FP.m Functns.m
FuncZ.m FuncZnew.m FunF.m GauJor.m
integrnd.m LagrangI.m LeastSqG.m NewRaphG.m
ParabPDE.m Relaxatn.m Volume.m Warping.m
WavePDE.m
les is in Drive A, any of these
les can be accessed by enclosing the lename inside a pair of parentheses as
illustrated in
When the 3.5-inch disk containing all of these
m
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 dened for numerical inte-
library m les, then no reference
to the Drive A is necessary and the pair of parentheses can also be dropped.
MATLAB
4.
<Mathtica>
is a subdirectory associated with
Mathematica
and has the les of:
Bairstow.MTK CubeSpln.MTK DiffTabl.MTK EigenVec.MTK
ExactFit.MTK FindRoot.MTK FUNCTNS.MTK EigenvIt.MTK
Gauss.MTK GauJor.MTK LagrangI.MTK LeastSq1.MTK
LeastSqG.MTK MatxAlgb.MTK NewRaphG.MTK NuIntgra.MTK
OdeBvpFD.MTK OdeBvpRK.MTK ParabPDE.MTK Rexalatn.MTK
RungeKut.MTK Volume.MTK WavePDE.MTK
© 2001 by CRC Press LLC
<QB>
Select
gration. If all les have been added into
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
and then enter the lename such as a:\Mathtica\MatxAlgb.MTK (assuming
the 3.5-inch disk containing
key.
When all lines of this le is displayed on screen, move cursor to any input line such
as
<Mathtica>
is in Drive A) and press the
Enter
In[1]
: A = {{1,2},{3,4}}; MatrixForm[A] and hit the
Enter
key.
Mathematica
. Hence, user can reproduce all of
the output lines by sequentially running the input lines [1] through [9]. However, if
user rst run In[1] and then In[3],
Out[1]
cannot perform the addition of [A]
because [B] is not dened. If after having run In[1], user selects In[5], or, In[6],
Mathematica
Mathematica
then has no problem of giving out results.
FIGURE 1.
The Select screen.
© 2001 by CRC Press LLC
Open
will respond by repeating those lines for
77160759.003.png
Zgłoś jeśli naruszono regulamin