Module'1:'Review'of'Mathematical'Foundations': A Module in EM8: Numerical Solutions To CE Problems

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 29

Module'1:'Review'of'Mathematical'Foundations'

A Module in EM8: Numerical Solutions to CE Problems


!
Copyright © 2020 by the Pamantasan ng Lungsod ng Valenzuela

All rights reserved. No part of this module may be reproduced, repurposed, distributed, or
transmitted in any form or by any means including photocopying, reprinting, or other electronic or
mechanical methods without the prior written permission of PLV and the individual developers of
instructional materials (IMs) except in the case of brief quotations embodied in critical and creative
reviews and certain other noncommercial uses permitted by the Copyright Law. For permission
request, address your written correspondence whether printed or electronic to the Chair of the
University Committee on Instructional Materials Development and Evaluation at the address
below:

Pamantasan ng Lungsod ng Valenzuela


Tongco St., Maysan, Valenzuela City

!
UNIT 1:
Review of Mathematical Foundation and Fundamentals of Computer –
Aided Mathematical Calculations
I.#INTRODUCTION#

C#
alculus#is#a#branch#of#mathematics#which#uses#derivative#to#analyze#the#way#in#which#the#
values#of#a#function#vary.#Developed#on#17th#century,#Calculus#has#now#applications#almost#
in# all# areas# of# human# endeavor:# engineering,# physics,# business,# economics,# astronomy,#
chemistry,# biology,# psychology,# sociology,# etc.# Sir# Isaac# Newton# (1642# –# 1727)# and#
Gottfried#Wilhelm#Leibniz#(1646#–#1716),#working#independently#from#each#other,#developed#the#
Calculus#in#connections#with#their#work.#Newton#used#Calculus#in#finding#the#velocity#of#a#moving#
body,#the#work#done#by#force#and#the#centroid#of#mass#of#a#body.#Leibniz#on#the#other#hand#
focused#on#geometric#calculation#like#finding#the#tangent#and#normal#to#a#curve,#area#bounded#
by# two# or# more# curves,# and# volume# of# a# solid.# Leibniz# is# the# one# who# initiated# the# modern#
notation#of#dx#and#∫.#
Calculus#is#divided#into#5#major#branches#namely:#Differential#Calculus;#Integral#Calculus;#
Differential#Equations;#Calculus#of#Variations;#and#Calculus#of#Errors.#As#for#this#section,#we#are#
only# concerned# with# the# Differential# Calculus.# Differential# Calculus# is# a# branch# of# Calculus#
involving#application#such#as#the#determination#of#maximum#and#minimum#points#and#rate#of#
change#[1].#
Integral# calculus# is# a# branch# of# calculus# concerned# with# the# theory# and# applications# of#
integrals.#While#differential#calculus#focuses#on#rates#of#change,#such#as#slopes#of#tangent#lines#
and#velocities,#integral#calculus#deals#with#total#size#or#value,#such#as#lengths,#areas,#and#volumes.#
The#two#branches#are#connected#by#the#fundamental#theorem#of#calculus,#which#shows#how#a#
definite# integral# is# calculated# by# using# its# antiderivative# (a# function# whose# rate# of# change,# or#
derivative,# equals# the# function# being# integrated).# For# example,# integrating# a# velocity# function#
yields#a#distance#function,#which#enables#the#distance#traveled#by#an#object#over#an#interval#of#
time#to#be#calculated.#As#a#result,#much#of#integral#calculus#deals#with#the#derivation#of#formulas#
for# finding# antiderivatives.# The# great# utility# of# the# subject# emanates# from# its# use# in#
solving#differential#equations#[2].#

Fig. 1.1 Sir Isaac Newton (Left) and Gottfried Wilhelm Leibniz (Right) [3][4]
Unit 1: Review of Mathematical Foundations and Fundamentals of Computer-Aided Mathematical Calculations

In# mathematics,# the# Taylor# series# of# a# function# is# an# infinite# sum# of# terms# that# are#
expressed#in#terms#of#the#function's#derivatives#at#a#single#point.#For#most#common#functions,#
the#function#and#the#sum#of#its#Taylor#series#are#equal#near#this#point.#Taylor's#series#are#named#
after#Brook#Taylor#who#introduced#them#in#1715.#If#zero#is#the#point#where#the#derivatives#are#
considered,# a# Taylor# series# is# also# called# a# Maclaurin# series,# after# Colin# Maclaurin,# who# made#
extensive#use#of#this#special#case#of#Taylor#series#in#the#18th#century#[5].#
Another#part#of#this#unit#are#matrices,#a#matrix#(plural#matrices)#is#a#rectangular#array#of#
numbers,#symbols,#or#expressions,#arranged#in#rows#and#columns#[6][7].#Applications#of#matrices#
are#found#in#most#scientific#fields.#In#every#branch#of#physics,#including#classical#mechanics,#optics,#
electromagnetism,#quantum#mechanics,#and#quantum#electrodynamics,#they#are#used#to#study#
physical#phenomena,#such#as#the#motion#of#rigid#bodies.#In#computer#graphics,#they#are#used#to#
manipulate#3D#models#and#project#them#onto#a#2adimensional#screen.#In#probability#theory#and#
statistics,# stochastic# matrices# are# used# to# describe# sets# of# probabilities;# for# instance,# they# are#
used# within# the# PageRank# algorithm# that# ranks# the# pages# in# a# Google# search.# Matrix# calculus#
generalizes#classical#analytical#notions#such#as#derivatives#and#exponentials#to#higher#dimensions.#
Matrices#are#used#in#economics#to#describe#systems#of#economic#relationships#[8].#
#
II.#DIAGNOSTIC#ASSESSMENT#
Before#proceeding,#it#is#essential#to#review#principles#by#answering#this#diagnostic#assessment.##
#
a.! Enumerate#the#basic#differentiation#formulas.#
b.! Enumerate#the#fundamental#integration#formulas.#
c.! What#are#the#basic#operations#in#Matrices?#
d.! What#are#the#fundamental#operations#in#Vectors?#
e.! What#are#the#basic#commands#in#MATLAB?#
#
III.#INTENDED#LEARNING#OUTCOMES#
At#the#end#of#this#unit,#the#student#should#be#able#to:#
•! Define#the#principles#of#differentiation#and#integration,#fundamentals#of#Taylor#Series#Expansion#
and#Principles#of#Matrix#and#Vectors.#
•! Define# the# principles# of# basic# commands,# looping,# iterations,# if# conditions# and# exit# criterion# in#
MATLAB.#

IV.#THEORY#AND#CONCEPTS#
Differentiation*Formulas*[9]*
In# the# following# formulas# u,# v# and# w# are# differentiable# functions# of# x# and# a# and# n# are#
constants.#
i.! Algebraic#Functions#
!
1.! # = 0#
!"
#

! ! '
2.! #& = # #
!" !"
#
! ! ' ! *
3.! &+) = + #
!" !" !"
#

2#
#
Unit 1: Review of Mathematical Foundations and Fundamentals of Computer-Aided Mathematical Calculations

! ! * ! '
4.! &) = & +) #
!" !" !"
#
! ! '
5.! & + = ,& +-. #
!" !"
#
! ! ' !"
6.! & = ; & ≠ 0#
!" / '
3 4 3 6
' * -'
35 35
7.! 2 = ; ) ≠ 0#
* *7
#
3 6
8 8:
35
8.! 2 =− #
* *7
#
ii.! Logarithmic#and#Exponential#Functions#
3 4
! 35
9.! log > & = #
!" ' ?@ >
#
3 4
! 35
10.! log.A & = log.A B: #
!" '
#
3 4
! 35
11.! ln & = ; & ≠ 0#
!" '
#
! ! '
12.! D ' = D ' :E,:D: #
!" !"
#
! ! '
13.! B' = B' #
!" !"
#
! ! ' ! *
14.! & * = )& *-. + & * ln &: #
!" !" !"
#
iii.! Trigonometric#Functions#
! ! '
15.! sin & = cos &: #
!" !"
#

! ! '
16.! cos & = −sin &: #
!" !"
#
! ! '
17.! tan & = KB# / &: #
!" !"
#
! ! '
18.! cot & = −#K# / &: #
!" !"
#
! ! '
19.! sec & = sec & tan & : #
!" !"
#
! ! '
20.! csc & = −csc & cot & #
!" !"
#
iv.! Inverse#Trigonometric#Functions#
! ! ' !"
21.! arcsin & = #
!" .-'7
#
! ! ' !"
22.! arccos & = − #
!" .-'7
#

! ! ' !"
23.! arctan & = #
!" .N'7
#
! ! ' !"
24.! arccot & = − #
!" .N'7
#

3#
#
Unit 1: Review of Mathematical Foundations and Fundamentals of Computer-Aided Mathematical Calculations

! ! ' !"
25.! arcsec & = #
!" ' '7 -.
#
! ! ' !"
26.! arccsc & = − #
!" ' '7 -.
#
v.! Hyperbolic#Functions#
! ! '
27.! sinh & = cosh &: #
!" !"
#

! ! '
28.! cosh & = sinh &: #
!" !"
#
! ! '
29.! tanh & = KB#ℎ/ &: #
!" !"
#
! ! '
30.! coth & = −#K#ℎ/ &: #
!" !"
#
! ! '
31.! sech & = − sech & tanh & : #
!" !"
#
! ! '
32.! csch & = − csch &: coth & : #
!" !"
#
# where:#
B " − B -" B " + B -"
sinh Q = ::::::::::::::cosh Q = #
#
2 2
sinh Q 1
tanh Q = ::::::::::::::coth Q = #
#
cosh Q tanh Q
1 1
sech Q = ::::::::::::::csch Q = #
cosh Q sinh Q
#
vi.! Hyperbolic#Functions#
! ! ' !"
33.! arcsinh & = #
!" '7 N.
#

! ! ' !"
34.! arccosh & = #
!" '7 -.
#
! ! ' !"
35.! arctanh & = #
!" .-'7
#
! ! ' !"
36.! arccoth & = − #
!" '7 -.
#
! -! ' !"
37.! arcsech & = #
!" ' .-'7
#
! -! ' !"
38.! arcccsh & = #
!" ' .N'7
#
#

# where:#
arcsinh Q = E, Q + Q / + 1 #
#

arccosh Q = E, Q + Q / − 1 #
#

1 1+Q
arctanh Q = E, #
#
2 1−Q

4#
#
Unit 1: Review of Mathematical Foundations and Fundamentals of Computer-Aided Mathematical Calculations

1 Q+1
arccoth Q = E, #
#
2 Q−1
1 + 1 − Q/
arcsech Q = E, #
Q
#

1 + 1 − Q/
arccsch Q = E, ; Q > 0#
Q
#
Sample'Problem'1:'
Find#the#derivative#of##
( x + 5)
#
(x 2
− 1)
#with#respect#to#x.#

# Solution:)
"NX
) UBV:W = )
" 7 -.
!Y " 7 -. . - "NX /"
) = )
!" " 7 -. 7
2W Q / − 1 − 2Q / − 10Q −Q / − 10Q − 1
= = )
2Q Q/ − 1 / Q/ − 1 /
#
Sample'Problem'2:'
Find#the#derivative#of##
( x + 1)3
x #with#respect#to#x.#

# Solution:)
⎛ u ⎞ vdu − udv
d⎜ ⎟ =
⎝ v⎠ v2
) ) )
⎡ ( x + 1)3 ⎤
d⎢ ⎥ x ⎡⎣ 3( x + 1) (1) ⎤⎦ − ( x + 1) (1)
2 3
⎣ x ⎦=
) ) dx x2 )
⎡ ( x + 1)3 ⎤
d⎢ ⎥
3( x + 1) ( x + 1)
2 3
⎣ x ⎦= −
) ) dx x x2 )
#
Sample'Problem'3:'
Given#the#equation:#

( )
2
y = eln x
#Find#y’.#

5#
#
Unit 1: Review of Mathematical Foundations and Fundamentals of Computer-Aided Mathematical Calculations

Solution:)
y = ( eln x )
2

) ) )
) ) e lnu
=u)
y = ( x) = x2
2

) ) )
) ) y' = 2x #
#
Sample'Problem'4:'
Find#the#derivatives#with#respect#to#x#of#the#function'

2 − 3x 2 #
#

Solution:)

) ) f ( x ) = 2 − 3x 2 )
d ( 2 − 3x 2 )
d ⎡⎣ f ( x ) ⎤⎦ dx
=
) ) dx 2 2 − 3x 2 )
d ⎡⎣ f ( x ) ⎤⎦ −6x
=
) )
dx 2 2 − 3x 2 )
d ⎡⎣ f ( x ) ⎤⎦ −3x
=
) )
dx 2 − 3x 2 )
#
Sample'Problem'5:'
Given#the#function#Z Q = Q [ − 5Q + 2,#find#the#value#of#the#first#derivative#at#Q = 2#Z′ 2 .#

# Solution:)
f ( x ) = x 3 − 5x + 2
) ) )
f ' ( x ) = 3x − 5
2
) ) )
f ' ( 2 ) = 3( 2 ) − 5
2
) ) )
) ) f ' ( 2 ) = 7 )
#
Sample'Problem'6:'

# Find#the#partial#derivatives#with#respect#to#x#of#the#function:#QW / − 5W + 6#
#
#
#
#
#

6#
#
Unit 1: Review of Mathematical Foundations and Fundamentals of Computer-Aided Mathematical Calculations

# Solution:)
f ( xy ) = xy 2 − 5y + 6
) ) )
) To)get)the)partial)derivative)with)respect)to)x,)we)differentiate)the)function)reating)the)
other)variable)y)as)constant.)
∂ f ( xy )
= y2 − 5
) ) ∂x )
*
Integration*Formulas*[9]*
i.! Algebraic,#Exponential#and#Logarithmic#Functions#

∫ a du = a ∫ du = au + C #
#

au
∫ a du = + C,a > 1,a ≠ 1
u

ln a #
#

1 n+1
∫u du = u + C, for,n ≠ −1
n

n +1 #
#

∫e du = eu + C
u

#
#
du
∫u du = ∫
−1
= ln u + C
#
u #

∫ lnu du = u ln u − u + C #
ii.! Trigonometric#Functions#

# # ∫ sinu du = − cosu + C #
!

! ! ∫ cosu du = sinu + C !
#

∫ tanu du = ln secu + C #
#

∫ cot u du = ln sinu + C #
#

∫ secu du = ln secu + tanu + C #


#

∫ cscu du = − ln cscu + cot u + C #


#

∫ secu tanu du = secu + C #


#

∫ cscu cot u du = − cscu + C #

7#
#
Unit 1: Review of Mathematical Foundations and Fundamentals of Computer-Aided Mathematical Calculations

∫ sec u du = tanu + C
2

#
#

∫ csc u du = − cot u + C
2

#
#

iii.! Inverse#Trigonometric#Functions#
du u
∫ a 2 − u 2 = arcsin a + C
!
!
du 1 u
∫a +u
2 2
= arctan + C
a a !
!

du 1 u
∫ u u 2 − a 2 = a arcsec a + C
!
!

!
∫ arcsinu du = u arcsinu + 1− u 2 + C
!

#
∫ arctanu du = u arctanu − ln 1+ u 2
!
iv.! Hyperbolic#Functions#

∫ sinhu du = coshu + C !
!

∫ coshu du = sinhu + C !
!

∫ tanhu du = ln coshu + C !
#

∫ cothu du = ln sinhu + C #
#

∫ sec h u du = tanhu + C #
2

∫ csc h u du = − cothu + C #
2

∫ sec hu tanhu du = − sec hu + C #


#

∫ csc hu cothu du = − csc hu + C #


du −1 u
∫ u 2 + a2
= sinh
a
+C
#
#
du −1 u
∫ u 2 − a2
= cosh
a
+ C ,u > a > 0
#
#
du 1 u
∫a 2
−u 2
= tanh −1 + C ,u 2 < a 2
a a #
#
#

8#
#
Unit 1: Review of Mathematical Foundations and Fundamentals of Computer-Aided Mathematical Calculations

v.! Other#Functions#
du
∫ u ±a2 2
= ln u + u 2 ± a 2 + C
#
#
du 1 a+u
∫a 2
−u 2
= ln
2a a − u
+ C,u 2 < a 2
#
#
du 1 u−a
∫u 2
−a 2
= ln
2a u + a
+ C,u 2 > a 2
#
#
u 2 a2
∫ u 2 ± a 2 du =
2
u ± a 2 + ln u + u 2 ± a 2 C
2 #
#

vi.! Integration#by#Parts#

∫ u dv = uv − ∫ v du #
#

vii.! Trigonometric#Substitution#
# Some#integrations#may#be#simplified#with#the#following#substitutions:#
1.! If#an#integrand#contain# D − Q / ,#substitute#Q / = DK_,/ `#
2.! If#an#integrand#contain# D + Q / ,#substitute#Q / = DVD,/ `#
3.! If#an#integrand#contain# Q / − D,#substitute#Q / = DKB# / `#
# More# generally,# an# integrand# that# contains# one# of# the# forms# D − aQ / ,# D + aQ / ,# or#
aQ / − D# but# no# other# irrational# factor# may# be# transformed# into# another# involving#
trigonometric#functions#of#a#new#variable#as#follows:#
For$ Use$ To$Obtain$
D
D − aQ / # Q / = K_,/ `# D# 1 − K_,/ `#=#bK` D##
a
D
D + aQ / # Q / = VD,/ `# D# 1 + VD,/ `#=KB#` D##
a
D
aQ / − D# Q / = KB# / `# D# KB# / ` − 1#=VD,` D##
a
#
viii.! Wallis#Formula#
π /2 ⎡⎣( m − 1) ( m − 3)…( 2or1) ⎤⎦ ⎡⎣( n − 1) ( n − 3)…( 2or1) ⎤⎦
∫0 sin m
θ cos n
θ dθ = (α )
( m + n )( m + n − 2 )…( 2or1) #
#
where:#
c = d 2#when#both#m#and#n#are#even#
c = 1#if#otherwise#
m#&#n#=#positive#integer,#not#equal#to#1#
#
#
#
#

9#
#
Unit 1: Review of Mathematical Foundations and Fundamentals of Computer-Aided Mathematical Calculations

Sample'Problem'7:'

# Evaluate#the#integral#of#
4dx
# #
∫ 3x + 2 #
#
Solution:)
4dx ⎛ 1⎞ 3dx
∫ 3x + 2 = 4 ⎜⎝ 3 ⎟⎠ ∫ 3x + 2
) )
4dx 4
)
∫ 3x + 2 = 3 ln ( 3x + 2 ) + C )
#
Sample'Problem'8:'

# Evaluate#the#integral#of#

∫ e 2x dx
x +1 2

#
#
# Solution:)
∫e
x 2 +1
2x dx
) ) )
∫e du = e + C
u u

) ) )
) ) u = x +1) du = 2xdx )
2

∫ e 2x dx =e + C )
x 2 +1 x 2 +1

) )
#
Sample'Problem'9:'

# What#is#the#integral#of#
(
( cos 2x ) esin 2 x dx ) #
#
# Solution:)
∫ ( cos 2x ) e dx )
sin 2 x

) )
∫ e du = e + C )
u u

) )
) ) u = sin 2x ) du = 2 cos 2xdx )
1 sin 2 x
∫ ( cos 2x ) e dx = 2 ∫ e ( 2 cos 2xdx ) )
sin 2 x

) )
esin 2 x
∫ ( cos 2x ) e sin 2 x
dx = +C
) ) 2 )
#
#
#

10#
#
Unit 1: Review of Mathematical Foundations and Fundamentals of Computer-Aided Mathematical Calculations

Sample'Problem'10:'

# Evaluate#
∫ tanθ lnsecθ dθ #
#
# Solution:)

) ) ∫ tanθ lnsecθ dθ )
1 n+1
∫u du =
n
u
) ) n +1 )
secθ tan θ dθ
du = = tan θ dθ
) ) u = lnsecθ ) secθ )

) ) ∫ tanθ lnsecθ dθ = ∫ ( lnsecθ ) tanθ dθ )


1
∫ tanθ lnsecθ dθ = 2 ( lnsecθ ) + C )
2

) )
#
Sample'Problem'11:'

# Using#lower#limit#=#0#and#upper#limit#=#d 2,#what#is#the#integral#of#15K_,e Q:2Q?#


#
# Solution:)
) ) By)Wallis’)Formula:)
π
⎡ 6 ( 4 )( 2 ) ⎤
∫02 15sin x dx = 15 ⎢⎣ 7 ( 5 )( 3)(1) ⎥⎦
7

) ) )
π

) ) ∫0
2
15sin 7 x dx = 6.857
)
#
Sample'Problem'12:'

# Evaluate##

∫ ∫ (x + y 2 ) dx dy
2 2y
2

# # 1 0 #
#
# Solution:#
2y
⎡ x3 2 ⎤
( )
2 2y 2
∫1 ∫0 x + y dx dy = ∫1 ⎢⎣ 3 + y x ⎥⎦ dy
2 2

# # 0 #
2 ⎡ ( 2y )
2y
3

( )
∫1 ∫0 x + y dx dy = ∫1 ⎢ 3 + y ( 2y )⎥ dy
2 2y
2 2 2

# # ⎣ ⎦0 #
⎛ 14 ⎞
∫1 ∫0 ( x + y ) dx dy = ⎜⎝ 3 ⎟⎠ ∫1 y dy
2 2y 2
2 2 3

# # #
#

11#
#
Unit 1: Review of Mathematical Foundations and Fundamentals of Computer-Aided Mathematical Calculations

2
⎛ 14 ⎞ ⎡ y ⎤
4

∫∫ ( )
2 2y
x + y dx dy = ⎜ ⎟ ⎢ ⎥
2 2
1 0 ⎝ 3 ⎠ ⎣ 4 ⎦1
# # #
⎛ 14 ⎞ ⎡ 2 − 1 ⎤
4 4

∫∫ ( )
2 2y
x 2 + y 2 dx dy = ⎜ ⎟ ⎢
1 0 ⎝ 3 ⎠ ⎣ 4 ⎥⎦
# # #
∫∫ ( )
2 2y 35
x 2 + y 2 dx dy =
# #
1 0 2 #
#
Matrix*and*Vectors*[10]*
i.! Matrices,#Vectors:#Addition#and#Scalar#Multiplication#
A#matrix#is#a#rectangular#array#of#numbers#or#functions#which#we#will#enclose#in#
brackets.#For#example,#
⎡ a11 a12 a13 ⎤
⎡0.3 1 −5 ⎤ ⎢
⎢ 0 −0.2 16 ⎥ , ))))) ⎢ a21 a22 a23 ⎥⎥ ,
⎣ ⎦ ⎢⎣ a31 a32 a33 ⎥⎦

⎡e − x ⎡4⎤
2x2 ⎤
⎢ 6x ⎥ , ))))) ⎡⎣ a1 a2 a3 ⎤⎦ , ))))) ⎢ 1 ⎥
⎣e 4x ⎦ ⎢ ⎥
(1)! ⎣2⎦ #
The#numbers#(or#functions)#are#called#entries#or,#less#commonly,#elements#of#the#matrix.##
The#first#matrix#in#(1)#has#two#rows,#which#are#the#horizontal#lines#of#entries.#Furthermore,#
it#has#three#columns,#which#are#the#vertical#lines#of#entries.#The#second#and#third#matrices#
are# square# matrices,# which# means# that# each# has# as# many# rows# as# columns—3# and# 2,#
respectively.#The#entries#of#the#second#matrix#have#two#indices,#signifying#their#location#
within#the#matrix.#The#first#index#is#the#number#of#the#row#and#the#second#is#the#number#
of#the#column,#so#that#together#the#entry’s#position#is#uniquely#identified.#For#example,#
a23#(read#a#two#three)#is#in#Row#2#and#Column#3,#etc.#The#notation#is#standard#and#applies#
to#all#matrices,#including#those#that#are#not#square.#Matrices#having#just#a#single#row#or#
column#are#called#vectors.#Thus,#the#fourth#matrix#in#(1)#has#just#one#row#and#is#called#a#
row# vector.# The# last# matrix# in# (1)# has# just# one# column# and# is# called# a# column# vector.#
Because#the#goal#of#the#indexing#of#entries#was#to#uniquely#identify#the#position#of#an#
element#within#a#matrix,#one#index#suffices#for#vectors,#whether#they#are#row#or#column#
vectors.#Thus,#the#third#entry#of#the#row#vector#in#(1)#is#denoted#by#a3.#
#
! General#Concepts#and#Notations#
We#shall#denote#matrices#by#capital#boldface#letters#A,#B,#C,#…#,#or#by#writing#the#general#
entry#in#brackets;#thus#A#=#[ajk],#and#so#on.#By#an#m#×#n#matrix#(read#m#by#n#matrix)#we#
mean#a#matrix#with#m#rows#and#n#columns—rows#always#come#first!##m#×#n#is#called#the#
size#of#the#matrix.#Thus#an#m#×#n#matrix#is#of#the#form#

12#
#
Unit 1: Review of Mathematical Foundations and Fundamentals of Computer-Aided Mathematical Calculations

⎡ a11 a12 L a1n ⎤


⎢a a22 L a2 n ⎥⎥
A = ⎡⎣ a jk ⎤⎦ = ⎢ 21 .
⎢ ⋅ ⋅ L ⋅ ⎥
⎢ ⎥
(2)! ########## ⎣ am 1 am 2 L amn ⎦ #

#
! Vectors#
A#vector#is#a#matrix#with#only#one#row#or#column.#Its#entries#are#called#the#components#of#
the#vector.#We#shall#denote#vectors#by#lowercase#boldface#letters#a,#b,#…#or#by#its#general#
component# in# brackets,# a# =# [aj],# and# so# on.# Our# special# vectors# in# (1)# suggest# that# a#
(general)#row#vector#is#of#the#form#
a = ⎣⎡ a1 a2 L an ⎦⎤ .$$$$$For$instance,$$$$$a = ⎣⎡ −2 5 0.8 0 1⎦⎤ . #
A#column#vector#is#of#the#form#
⎡ b1 ⎤
⎢b ⎥ ⎡4⎤
b = ⎢ 2 ⎥ .%%%%%For%instance,%%%%%%b = ⎢⎢ 0 ⎥⎥ .
⎢ M⎥
⎢ ⎥ ⎢⎣ −7 ⎥⎦
⎣bm ⎦ #
! Equality#of#Matrices#
Two#matrices#A#=#[ajk]#and#B#=#[bjk]#are#equal,#written#A#=#B,#if#and#only#if#(1)#they#have#the#
same#size#and#(2)#the#corresponding#entries#are#equal,#that#is,#a11#=#b11,#a12#=#b12,#and#so#
on.#Matrices#that#are#not#equal#are#called#different.#Thus,#matrices#of#different#sizes#are#
always#different.#
#
! Addition#of#Matrices#
The#sum#of#two#matrices#A#=#[ajk]#and#B#=#[bjk]#of#the#same#size#is#written#A#+#B#and#has#
the#entries#ajk#+#bjk#obtained#by#adding#the#corresponding#entries#of#A#and#B.#Matrices#of#
different#sizes#cannot#be#added.#
#
! Scalar#Multiplication#(Multiplication#by#a#Number)#
The#product#of#any#m#×#n#matrix#A#=#[ajk]#and#any#scalar#c#(number#c)#is#written#cA#and#is#
the#m#×#n#matrix#cA#=#[cajk]#obtained#by#multiplying#each#entry#of#A#by#c.#
#
! Rules#for#Matrix#Addition#and#Scalar#Multiplication#
From#the#familiar#laws#for#the#addition#of#numbers#we#obtain#similar#laws#for#the#addition#
of#matrices#of#the#same#size#m#×#n,#namely,#
(a)$$$$$$$$$$A + B = B + A
(b)$(A + B) + C = A + (B + C)$$$$$(written$A + B + C)
(c)$$$$$$$$$$$A + 0 = A
(3)! ######## (d)$$$$A + ( − A ) = 0. #

13#
#
Unit 1: Review of Mathematical Foundations and Fundamentals of Computer-Aided Mathematical Calculations

Here#0#denotes#the#zero#matrix#(of#size#m#×#n),#that#is,#the#m#×#n#matrix#with#all#entries#
zero.#Hence#matrix#addition#is#commutative#and#associative#[by#(3a)#and#(3b)].#Similarly,#
for#scalar#multiplication#we#obtain#the#rules#
(a)$c( A + B) = cA + cB
(b)$(c + k )A = cA + kA
(c)$$$$$c( kA) = ( ck )A $$$$$$$$$$$$(written$ckA)
(4)! ######### (d)$$$$$$$$$1A = A. #
#
! Multiplication#of#a#Matrix#by#a#Matrix#
The#product#C#=#AB#(in#this#order)#of#an#m#×#n#matrix#A#=#[ajk]#times#an#r#×#p#matrix#B#=#[bjk]#
is#defined#if#and#only#if#r#=#n#and#is#then#the#m#×#p#matrix#C#=#[cjk]#with#entries#
n
j = 1, ,m
c jk = ∑ a jl blk = #a j 1b1k + a j 2 b2 k + + a jnbnk
5##### l =1 ######## k = 1, , p.##
The#condition#r#=#n#means#that#the#second#factor,#B,#must#have#as#many#rows#as#the#first#
factor#has#columns,#namely#n.#A#diagram#of#sizes#that#shows#when#matrix#multiplication#
is#possible#is#as#follows:#

#
#
The# entry# cjk# in# (5)# is# obtained# by# multiplying# each# entry# in# the# jth# row# of# A# by# the#
corresponding# entry# in# the# kth# column# of# B# and# then# adding# these# n# products.# For#
instance,#c21#=#a21b11#+#a22b21#+#…#+#a2nbn1,#and#so#on.#One#calls#this#briefly#a#multiplication#
of#rows#into#columns.#For#n#=#3,#this#is#illustrated#by#
n= 3 p=2
p=2
⎧ a a12 a13 ⎤
⎪ ⎡ 11 ⎡ c11 c12 ⎤ ⎫⎪
⎪ ⎢
a a a ⎥ ⎡ b11 b12 ⎤ ⎢c c ⎥⎪

m = 4⎨ ⎢
⎪ 21 22 23 ⎥ b⎢ b ⎥ = ⎢ 21 22 ⎥ ⎪⎪⎬ m = 4
⎪ ⎢a a32 a33 ⎥ ⎢ 21 22 ⎥ ⎢c c32 ⎥ ⎪

⎪ ⎢a
31
⎢ b
⎥ ⎣ 31 b 32 ⎦
⎥ ⎢
31
⎥ ⎪⎪
⎩ ⎣ 41 a 42
a 43 ⎦
c
⎣ 41 c 42 ⎦ ⎭
⎪ """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" ⎪ #
#

where#we#shaded#the#entries#that#contribute#to#the#calculation#of#entry#c21#just#discussed.#
#
Sample'Problem'13:'
⎡ 3 5 −1⎤ ⎡ 2 −2 3 1 ⎤ ⎡ 22 −2 43 42 ⎤
AB = ⎢⎢ 4 0 2 ⎥⎥ ⎢⎢ 5 0 7 8 ⎥⎥ = ⎢⎢ 26 −16 14 6 ⎥⎥
⎢⎣ −6 −3 2 ⎥⎦ ⎢⎣ 9 −4 1 1 ⎥⎦ ⎢⎣ −9 4 −37 −28 ⎥⎦ #
#
Here#c11#=#3#p#2#+#5#p#5#+#(−1)#p#9#=#22,#and#so#on.#The#entry#in#the#box#is#c23#=#4#p#3#+#0#p#7#+#
2#p#1#=#14.#The#product#BA'is#not#defined.#This#is#illustrated#by#Example#1,#where#one#of#
the#two#products#is#not#even#defined.#But#it#also#holds#for#square#matrices.#For#instance,##

14#
#
Unit 1: Review of Mathematical Foundations and Fundamentals of Computer-Aided Mathematical Calculations

⎡ 1 1 ⎤ ⎡ −1 1 ⎤ ⎡0 0 ⎤
⎢100 100 ⎥ ⎢ 1 −1⎥ = ⎢0 0 ⎥
⎣ ⎦⎣ ⎦ ⎣ ⎦
⎡ −1 1 ⎤ ⎡ 1 1 ⎤ ⎡ 99 99 ⎤
but''''' ⎢ ⎥ ⎢100 100 ⎥ = ⎢ −99 −99 ⎥ .
⎣ 1 −1⎦⎣ ⎦ ⎣ ⎦#
It#is#interesting#that#this#also#shows#that#AB#=#0#does#not*necessarily#imply#BA'=#0'or#A'=#
0'or#B'=#0.##
Our#examples#show#that#in#matrix#products#the#order#of#factors#must#always#be#observed#
very#carefully.#Otherwise#matrix#multiplication#satisfies#rules#similar#to#those#for#numbers,#
namely.#
(a)$$$$$( kA)B = k( AB) = A( kB)$$$$$written$kAB$or $AkB
(b)$$$$A(BC) = ( AB)C $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$written$ABC
(c)$(A + B)C = AC + BC
(6)####################(d)$C(A + B) = CA + CB #
provided#A,#B,#and#C#are#such#that#the#expressions#on#the#left#are#defined;#here,#k#is#any#
scalar.#(2b)#is#called#the#associative#law.#(2c)#and#(2d)#are#called#the#distributive#laws.#
(7)####################AB'=#A[b1##b2##…##bp]#=#[Ab1##Ab2##…##Abp].#
Columns#of#B'are#then#assigned#to#different#processors#(individually#or#several#to#each#
processor),#which#simultaneously#compute#the#columns#of#the#product#matrix#Ab1,#Ab2,#
etc.#
#
! Transposition#of#Matrices#and#Vectors#
We#obtain#the#transpose'of'a'matrix#by#writing#its#rows#as#columns#(or#equivalently#its#
columns# as# rows).# This# also# applies# to# the# transpose# of# vectors.# Thus,# a# row# vector#
becomes#a#column#vector#and#vice#versa.#In#addition,#for#square#matrices,#we#can#also#
“reflect”# the# elements# along# the# main# diagonal,# that# is,# interchange# entries# that# are#
symmetrically# positioned# with# respect# to# the# main# diagonal# to# obtain# the# transpose.#
Hence#a12#becomes#a21,#a31# becomes#a13,#and#so#forth.#Also#note#that,#if#A'is#the#given#
matrix,#then#we#denote#its#transpose#by#AT.#
The#transpose#of#an#m)×)n*matrix#A'=#[ajk]#is#the#n)×)m*matrix#AT#(read#A)transpose)#that#
has#the#first#row)of#A'as#its#first#column,#the#second#row)of#A'as#its#second#column,#and#so#
on.#Thus#the#transpose#of#A'in#(2)#is#AT'=#[akj],#written#out#
⎡ a11 a12 L am 1 ⎤
⎢a a22 L am 2 ⎥⎥
A = ⎡⎣ akj ⎤⎦ = ⎢ 21
T
.
⎢ ⋅ ⋅ L ⋅ ⎥
⎢ ⎥
(8)######## ⎣ a1n a2 n L amn ⎦ #
#
As#a#special#case,#transposition#converts#row#vectors#to#column#vectors#and#conversely.#
Rules#for#transposition#are:#

15#
#
Unit 1: Review of Mathematical Foundations and Fundamentals of Computer-Aided Mathematical Calculations

(a)$$$$$( A T )T = A
(b)$(A + B)T = A T + BT
(c)$$$$$ cA)T = cA T
(9)#########(d)$$$$( AB) = B A . #
T T T

#
Use*of*MATLAB*[11]*
i.! MATLAB)Environment)
# MATLAB#is#a#computer#program#that#provides#the#user#with#a#convenient#environment#
for#performing#many#types#of#calculations.#In#particular,#it#provides#a#very#nice#tool#to#implement#
numerical#methods.#The#most#common#way#to#operate#MATLAB#is#by#entering#commands#one#at#
a#time#in#the#command#window.##
MATLAB#uses#three#primary#windows:#
!! Command#window.#Used#to#enter#commands#and#data.#
!! Graphics#window.#Used#to#display#plots#and#graphs.#
!! Edit#window.#Used#to#create#and#edit#Mafiles.#

After#starting#MATLAB,#the#command#window#will#open#with#the#command#prompt#being#
displayed.#
>>#
The#The#calculator#mode#of#MATLAB#operates#in#a#sequential#fashion#as#you#type#in#coma#mands#
line#by#line.#For#each#command,#you#get#a#result.#Thus,#you#can#think#of#it#as#operata#ing#like#a#
very#fancy#calculator.#For#example,#if#you#type#in#
# >>#55#–#16#
MATLAB#will#display#the#results#(MATLAB#skips#a#line#between#the#label#(ans#=)#and#the#number#
(39).#Here,#we#omit#such#blank#lines#for#conciseness.#You#can#control#whether#blank#lines#are#
included#with#the#format#compact#and#format#loose#commands).#
# ans#=#
# #######39##
Notice#that#MATLAB#has#automatically#assigned#the#answer#to#a#variable,#ans.#Thus,#you#could#
now#use#ans#in#a#subsequent#calculation:#
# >>#ans#+#11#
with#the#result#
# ans#=##
# #######50#
MATLAB# assigns# the# result# to# ans# whenever# you# do# not# explicitly# assign# the# calculation# to# a#
variable#of#your#own#choosing.#
#
ii.! (MATLAB))Assignment)
Assignment#refers#to#assigning#values#to#variable#names.#This#results#in#the#storage#of#the#
values#in#the#memory#location#corresponding#to#the#variable#name.#
! Scalars#

16#
#
Unit 1: Review of Mathematical Foundations and Fundamentals of Computer-Aided Mathematical Calculations

The# assignment# of# values# to# scalar# variables# is# similar# to# other# computer#
languages.#Try#typing#
>>#a#=#4#
# Note#how#the#assignment#echo#prints#to#confirm#what#you#have#done:#
# # a#=##
# # #########4#
#Echo#printing#is#a#characteristic#of#MATLAB.#It#can#be#suppressed#by#terminating#
the#command#line#with#the#semicolon#(;)#character.#Try#typing#
>>#A#=#6;#
You#can#type#several#commands#on#the#same#line#by#separating#them#with#commas#
or#semicolons.#If#you#separate#them#with#commas,#they#will#be#displayed,#and#if#you#use#
the#semicolon,#they#will#not.#For#example,#
>>#a#=#4,#A#=#6;#x#=#1;#
a#=##
# #######4#
# # MATLAB#treats#names#in#a#caseasensitive#manner—that#is,#the#variable#a#is#not#the#
same#as#A.#To#illustrate#this,#enter#
#>>#a#
and#then#enter#
>>#A#
See#how#their#values#are#distinct.#They#are#distinct#names.#
# We# can# assign# complex# values# to# variables,# since# MATLAB# handles# complex#
arithmetic#automatically.#The#unit#imaginary#number#√:−1#is#preaassigned#to#the#variable#
i.#Consequently,#a#complex#value#can#be#assigned#simply#as#in#
# >>#x#=#2+i*4#
# x#=##
# #####2.0000#+#4.0000i#
It# should# be# noted# that# MATLAB# allows# the# symbol# j# to# be# used# to# represent# the# unit#
imaginary#number#for#input.#However,#it#always#uses#an#i#for#display.#For#example,#
# >>#x#=#2+j*4#
# x#=##
# #####2.0000#+#4.0000i#
There#are#several#predefined#variables,#for#example,#pi.#
# >>#pi#
# ans#=#
# #######3.1416#
# Notice# how# MATLAB# displays# four# decimal# places.# If# you# desire# additional#
precision,#enter#the#following:#
# >>#format#long#
Now#when#pi#is#entered#the#result#is#displayed#to#15#significant#figures:#
# >>#pi#
# ans#=##
# ########3.14159265358979#

17#
#
Unit 1: Review of Mathematical Foundations and Fundamentals of Computer-Aided Mathematical Calculations

To#return#to#the#four#decimal#version,#type#
# >>#format#short#
# The#following#is#a#summary#of#the#format#commands#you#will#employ#routinely#in#
engineering#and#scientific#calculations.#They#all#have#the#syntax:#format#type.#
#

Table)1.)Summary)of)Format)Commands)
Type' Result' Example'
short# Scaled#fixedapoint#format#with#5#digits# 3.1416#
Scaled#fixedapoint#format#with#15#digits#for#
long# 3.14159265358979#
double#and#7#digits#for#single#
short#e# Floatingapoint#format#with#5#digits# 3.1416e+000#
Floatingapoint#format#with#15#digits#for#double#
long#e# 3.141592653589793e+000#
and#7#digits#for#single#
Best#of#fixeda#or#floating#point#format#with#5#
short#g# 3.1416#
digits#
Best#of#fixeda#or#floatingapoint#format#with#15#
long#g# 3.14159265358979#
digits#for#double#and#7#digits#for#single#
Engineering#format#with#at#least#5#digits#and#a#
short#eng# 3.1416e+000#
power#that#is#multiple#of#3#
Engineering#format#with#exactly#16#significant#
long#eng# 3.14159265358979e+000#
digits#and#a#power#that#is#multiple#of#3#
#
bank# Fixed#dollars#and#cents# 3.14#
! Arrays,#Vectors#and#Matrices#
An#array#is#a#collection#of#values#that#are#represented#by#a#single#variable#name.#
Oneadimensional# arrays# are# called# vectors# and# twoadimensional# arrays# are# called#
matrices.#
Brackets# are# used# to# enter# arrays# in# the# command# mode.# For# example,# a# row#
vector#can#be#assigned#as#follows:#
>>#a#=#[1#2#3#4#5]#
a#=##
########1####2####3####4####5#
#Note#that#this#assignment#overrides#the#previous#assignment#of#a#=#4.#In#practice,#
row#vectors#are#rarely#used#to#solve#mathematical#problems.#When#we#speak#of#vectors,#
we#usually#refer#to#column#vectors,#which#are#more#commonly#used.#A#column#vector#can#
be#entered#in#several#ways.#Try#them.#
>>#b#=#[2;4;6;8;10]#
# or#
# # >>#b#=#12#
# # 4#
# # 6#
# # 8# #
# # 10]#

18#
#
Unit 1: Review of Mathematical Foundations and Fundamentals of Computer-Aided Mathematical Calculations

# or,#by#transposing#a#row#vector#with#the#'#operator,#
# # >>#b#=#[2##4##6##8##10]#'#
# The#result#in#all#three#cases#will#be#
# # b#=##
# # ########2#
# # ########4#
# # ########6#
# # ########8#
# # ######10#
# A#matrix#of#values#can#be#assigned#as#follows:#
# # >>#A#=#[1##2##3;##4##5##6;##7##8##9]#

# # #
#In#addition,#the#Enter#key#(carriage#return)#can#be#used#to#separate#the#rows.#For#example,#
in#the#following#case,#the#Enter#key#would#be#struck#after#the#3,#the#6,#and#the#]#to#assign#
the#matrix:#

# # #
Finally,#we#could#construct#the#same#matrix#by#concatenating#(i.e.,#joining)#the#vectors#
representing#each#column:#
# # >>#A#=#[[1#4#7]'#[2#5#8]'#[3#6#9]']#
#At#any#point#in#a#session,#a#list#of#all#current#variables#can#be#obtained#by#entering#the#
who#command:#

# #
or,#with#more#detail,#enter#the#whos#command:#

#
#Note#that#subscript#notation#can#be#used#to#access#an#individual#element#of#an#array.#For#
example,#the#fourth#element#of#the#column#vector#b#can#be#displayed#as#

19#
#
Unit 1: Review of Mathematical Foundations and Fundamentals of Computer-Aided Mathematical Calculations

# For#an#array,#A(m,n)#selects#the#element#in#mth#row#and#the#nth#column.#For#example,#

# # #
#There#are#several#builtain#functions#that#can#be#used#to#create#matrices.#For#exama#ple,#
the# ones# and# zeros# functions# create# vectors# or# matrices# filled# with# ones# and# zeros,#
respectively.#Both#have#two#arguments,#the#first#for#the#number#of#rows#and#the#second#
for#the#number#of#columns.#For#example,#to#create#a#2#×#3#matrix#of#zeros:#

#
Similarly,#the#ones#function#can#be#used#to#create#a#row#vector#of#ones:#

# # #
#
! The#Colon#Operator#
The#colon#operator#is#a#powerful#tool#for#creating#and#manipulating#arrays.#If#a#
colon#is#used#to#separate#two#numbers,#MATLAB#generates#the#numbers#between#them#
using#an#increment#of#one:#

#
# If#colons#are#used#to#separate#three#numbers,#MATLAB#generates#the#numbers#between#
the#first#and#third#numbers#using#an#increment#equal#to#the#second#number:#

# # #
# Note#that#negative#increments#can#also#be#used#

# # #
# Aside#from#creating#series#of#numbers,#the#colon#can#also#be#used#as#a#wildcard#to#select#
the#individual#rows#and#columns#of#a#matrix.#When#a#colon#is#used#in#place#of#a#specific#
subscript,#the#colon#represents#the#entire#row#or#column.#For#example,#the#second#row#
of#the#matrix#A#can#be#selected#as#in#

20#
#
Unit 1: Review of Mathematical Foundations and Fundamentals of Computer-Aided Mathematical Calculations

# # #
# We#can#also#use#the#colon#notation#to#selectively#extract#a#series#of#elements#from#within#
an#array.#For#example,#based#on#the#previous#definition#of#the#vector#t:#

# # #
# Thus,#the#second#through#the#fourth#elements#are#returned.#
#
! The#linspace#and#logspace#functions#
The#linspace#and#logspace#functions#provide#other#handy#tools#to#generate#vectors#
of#spaced#points.#The#linspace#function#generates#a#row#vector#of#equally#spaced#points.#
It#has#the#form#

#
which#generates#n#points#between#x1#and#x2.#For#example#

# #
If# the# n# is# omitted,# the# function# automatically# generates# 100# points.# The# logspace#
function#generates#a#row#vector#that#is#logarithmically#equally#spaced.#It#has#the#form#
# #
which# generates# n# logarithmically# equally# spaced# points# between# decades# 10x1# and#
10x2.#For#example,#

# #
If#n#is#omitted,#it#automatically#generates#50#points.#
#
! Character#Strings#
Aside# from# numbers,# alphanumeric# information# or# character# strings# can# be#
represented#by#enclosing#the#strings#within#single#quotation#marks.#For#example,#

#
# Each#character#in#a#string#is#one#element#in#an#array.#Thus,#we#can#concatenate#(i.e.,#
paste#together)#strings#as#in#

21#
#
Unit 1: Review of Mathematical Foundations and Fundamentals of Computer-Aided Mathematical Calculations

# # #
# Note# that# very# long# lines# can# be# continued# by# placing# an# ellipsis# (three# consecutive#
periods)# at# the# end# of# the# line# to# be# continued.# For# example,# a# row# vector# could# be#
entered#as#

#
# However,#you#cannot#use#an#ellipsis#within#single#quotes#to#continue#a#string.#To#enter#a#
string#that#extends#beyond#a#single#line,#piece#together#shorter#strings#as#in#

# # #
#
#
Table)2.)Some)Useful)String)Functions)
Function' Description'
n=lengths(s)# Number#of#characters,#n,#in#a#string,#s.#
Compares#two#strings,#s1#and#s2;#if#equal#returns#true#(b#=#1).#
b=strcmp(s1,s2)#
If#not#equal,#returns#fals#(b#=#0)#
n=str2num(s)# Converts#a#string,#s,#to#a#number,#n.#
s=num2str(n)# Converts#a#number,#n,#to#a#string,#s.#
s2=strrep(s1,c1,c2)# Replaces#characters#in#a#string#with#different#characters.#
Returns#the#starting#indices#of#any#occurrences#of#the#string#s2#
i=strfind(s1,s2)#
in#the#string#s1.#
S=upper(s)# Converts#a#string#to#upper#case.#
s=lower(S)# Converts#a#string#to#lower#case.#
#
A#number#of#builtain#MATLAB#functions#are#available#to#operate#on#strings.#Table#2.2#lists#
a#few#of#the#more#commonly#used#ones.#For#example,# #

22#
#
Unit 1: Review of Mathematical Foundations and Fundamentals of Computer-Aided Mathematical Calculations

#
Note,#if#you#want#to#display#strings#in#multiple#lines,#use#the#sprint#function#and#insert#
the#twoacharacter#sequence#\n#between#the#strings.#For#example,#
#
# yields#

# # #
#
iii.! Mathematical)Operations)
Operations#with#scalar#quantities#are#handled#in#a#straightforward#manner,#similar#
to#other#computer#languages.#The#common#operators,#in#order#of#priority,#are#
#
Table)3.)Mathematical)Operations)

#
#
# These#operators#will#work#in#calculator#fashion.#Try#

23#
#
Unit 1: Review of Mathematical Foundations and Fundamentals of Computer-Aided Mathematical Calculations

# # #
# Also,#scalar#real#variables#can#be#included:#

# # #
# Results#of#calculations#can#be#assigned#to#a#variable,#as#in#the#nextatoalast#example,#or#
simply#displayed,#as#in#the#last#example.#As#with#other#computer#calculation,#the#priority#
order# can# be# overridden# with# parentheses.# For# example,# because# exponentiation# has#
higher#priority#than#negation,#the#following#result#would#be#obtained:#

# # #
# Thus,# 4# is# first# squared# and# then# negated.# Parentheses# can# be# used# to# override# the#
priorities#as#in#

# # #
# #Within#each#precedence#level,#operators#have#equal#precedence#and#are#evaluated#from#
left#to#right.#As#an#example,#

# # #
# In#the#first#case#42#=#16#is#evaluated#first,#which#is#then#cubed#to#give#4096.#In#the#second#
case#23#=#8#is#evaluated#first#and#then#48#=#65,536.#The#third#case#is#the#same#as#the#first,#
but#uses#parentheses#to#be#clearer.#
# One#potentially#confusing#operation#is#negation;#that#is,#when#a#minus#sign#is#employed#
with#a#single#argument#to#indicate#a#sign#change.#For#example,#
# # >>#2*a4#
# The#−4#is#treated#as#a#number,#so#you#get#−8.#As#this#might#be#unclear,#you#can#use#parena#
theses#to#clarify#the#operation#
# # >>#2*(a4)#
# Here#is#a#final#example#where#the#minus#is#used#for#negation#
# # >>#2^a4#
# Again#−4#is#treated#as#a#number,#so#2^−4#=#2−4#=#1/24#=#1/16#=#0.0625.#Parentheses#can#
make#the#operation#clearer#
# # >>#2^(a4)#
# Calculations#can#also#involve#complex#quantities.#Here#are#some#examples#that#use#the#
values#of#x#(2#+#4i)#and#y#(16)#defined#previously:#

24#
#
Unit 1: Review of Mathematical Foundations and Fundamentals of Computer-Aided Mathematical Calculations

# # #
# The# real# power# of# MATLAB# is# illustrated# in# its# ability# to# carry# out# vectoramatrix#
calculations.#Although#we#will#describe#such#calculations#in#detail#in#Chap.#8,#it#is#worth#
introducing#some#examples#here.#The#inner#product#of#two#vectors#(dot#product)#can#be#
calculated#using#the#*#operator,#

# # #
# and#likewise,#the#outer#product#

# # #
#
# #To#further#illustrate#vectoramatrix#multiplication,#first#redefine#a#and#b:#
# # >>#a#=#[1##2##3]#
# and#
# # >>#b#=#[4##5##6]#
# Now,#try#

# # #
# or#

25#
#
Unit 1: Review of Mathematical Foundations and Fundamentals of Computer-Aided Mathematical Calculations

# # #
# Matrices#cannot#be#multiplied#if#the#inner#dimensions#are#unequal.#Here#is#what#happens#
when#the#dimensions#are#not#those#required#by#the#operations.#Try#
# # >>#A#*#a#
# MATLAB#automatically#displays#the#error#message:#

# # #
# Matrixamatrix#multiplication#is#carried#out#in#likewise#fashion:#

# # #
# Mixed#operations#with#scalars#are#also#possible:#

# # #
# We#must#always#remember#that#MATLAB#will#apply#the#simple#arithmetic#operators#in#
vectoramatrix#fashion#if#possible.#At#times,#you#will#want#to#carry#out#calculations#item#by#
item#in#a#matrix#or#vector.#MATLAB#provides#for#that#too.#For#example,#

# # #
# results#in#matrix#multiplication#of#A#with#itself.#What#if#you#want#to#square#each#element#
of#A?#That#can#be#done#with#

# # #
# The#.#preceding#the#^#operator#signifies#that#the#operation#is#to#be#carried#out#element#by#
element.#The#MATLAB#manual#calls#these#array#operations.#They#are#also#often#referred#
to#as#elementabyaelement#operations.#MATLAB#contains#a#helpful#shortcut#for#performing#

26#
#
Unit 1: Review of Mathematical Foundations and Fundamentals of Computer-Aided Mathematical Calculations

calculations#that#you’ve#already#done.#Press#the#upaarrow#key.#You#should#get#back#the#
last#line#you#typed#in.#
# # >>#A.^2#
# Pressing# Enter# will# perform# the# calculation# again.# But# you# can# also# edit# this# line.# For#
example,#change#it#to#the#line#below#and#then#press#Enter.#

# # #
# Using#the#upaarrow#key,#you#can#go#back#to#any#command#that#you#entered.#Press#the#upa#
arrow#until#you#get#back#the#line#
# # >>#b#*#a#
# Alternatively,#you#can#type#b#and#press#the#upaarrow#once#and#it#will#automatically#bring#
up#the#last#command#beginning#with#the#letter#b.#The#upaarrow#shortcut#is#a#quick#way#to#
fix#errors#without#having#to#retype#the#entire#line.#
#
V.#ASSESSMENT#
The#assessment#for#this#module#is#available#in#the#canvas#classroom#created#for#this#course.#
#
V.#MODULE#FEEDBACK#
An#evaluation#of#this#module#unit#is#required#to#be#submitted#for#continuation#of#this#module.#
You#may#visit#the#evaluation#published#in#the#canvas#classroom#created#for#this#course.#
#
VI.#REFERENCES#
!
# [1]#https://mathalino.com/reviewer/differentialacalculus/fundamentals#
# [2]#https://www.britannica.com/science/integralacalculus#
# [3]#https://www.biography.com/scientist/isaacanewton#
# [4]#https://www.britannica.com/biography/GottfriedaWilhelmaLeibniz#
[5]# Greenberg,# Michael# (1998),# Advanced# Engineering# Mathematics# (2nd# ed.),# Prentice#
Hall,#ISBN#0a13a321431a1#
[6]#Beauregard,#Raymond#A.;#Fraleigh,#John#B.#(1973),#A)First)Course)In)Linear)Algebra:)
with)Optional)Introduction)to)Groups,)Rings,)and)Fields,#Boston:#Houghton#Mifflin#Co.,#
ISBN#0a395a14017aX#
[7]#Anton,#Howard#(1987),#Elementary)Linear)Algebra#(5th#ed.),#New#York:#Wiley,#ISBN#0a
471a84819a0#
[8]# K.# Bryan# and# T.# Leise.# The) $25,000,000,000) eigenvector:) The) linear) algebra) behind)
Google.#SIAM#Review,#48(3):569–581,#2006.#
[9]#Gillesania,#D.T.#(2004).#Engineering)Mathematics)Volume)2.#ISBN#971a8614a30a3.#
[10]#Kreyszig,#E.#(2011).#Advanced)Engineering)Mathematics)(10th)Ed.).)John)Wiley)&)Sons.)
[11]#Chapra,#Steven#C.#(2018).#Applied)Numerical)Methods)with)MATLAB)for)Engineers)and)
Scientists)(4th)Edition).#McGraw#Hill#Education.#

27#
#

You might also like