1550078481-Ordinary_Differential_Equations__Roberts_

(jair2018) #1
526 Ordinary Differential Equations

are all six digit, single precision, floating-point representations for 1r. If the
E's in the previous sentence are replaced by D 's, then we have four double pre-
cision representations for 1r. Single precision constants are stored with seven
digits although only six digits may be accurate. Double precision constants
are stored with seventeen digits but only sixteen digits may be accurate. By
default numbers such as 3456789012 and 456. 7890123 will be stored as double
precision, floating-point constants.


REMARK: Constants such as 3 must be input in function definitions as
3 or 3.0 and may not be input as 3., since the function compiler expects at
least one digit following a decimal point.


In BASIC the algebraic operation of addition is represented by +, the op-

eration of subtraction is represented by - , multiplication is represented by


*, division is represented by /, and exponentiation is represented by A. In

algebraic expressions which contain no parentheses, the operation of expo-
nentiation is performed first. Multiple exponentiations are performed from
left to right. So XBAC written with no parentheses is evaluated as (AABtC


which, in mathematical notation, is (AB)C =ABC_ To write AB

0
in BASIC
you must write AA(BAC). In an expression with no parentheses, after all op-
erations of exponentiation have been performed, the computer performs all


multiplications and divisions from left to right. So A/ B * C is evaluated as

(A/ B) * C which, in mathematical notation, is Af. To write BAG in BASIC

you must write A/(B * C) or A/B/C. In an expression with no parentheses,

the operations of addition and subtraction are performed last and from left
to right. So A - B - C is evaluated as (A - B) - C.


In algebraic expressions which contain parentheses, all the operations ap-
pearing inside the innermost set of parentheses are performed first according
to the rules for evaluating algebraic expressions with no parentheses. Next,
the operations in the next innermost set of parentheses are performed and so
on. When writing algebraic expressions in BASIC or any similar computer
language, it is a good idea to include as many sets of parentheses as neces-
sary to indicate to the computer exactly how you want the expression to be
evaluated.


BASIC includes the "built-in" or intrinsic functions shown in Table A.l
of Appendix A. Additional standard mathematical functions can be written
in BASIC by making use of the built-in functions and algebraic operations.
Some mathematical functions and BASIC expressions for their computation
appear in Table A.2 of Appendix A.


A value for 7f, accurate to the number of significant digits required by the
computer you are using can be obtained with the expression 4.0*atn(l.O).

Free download pdf