You are on page 1of 34

216 2001 - Gi l ber t o E.

Ur r oz
Al l r i ght r eser ved
Mat r i x appl i cat i ons

In t hi s sect i on we expl or e some appl i cat i ons of mat r i ces i n t he physi cal sci ences.

El ect r i c ci r cui t s

Consi der t he si mpl e el ect r i cal ci r cui t shown i n t he f i gur e bel ow.

Gi ven t he val ues of t he el ect r i c r esi st ance, R
1
= R
3
= R
5
= R
7
= 1. 5 k, R
2
= R
4
= R
6
= R
8
= 800 ,
and t he known st eady vol t ages V
1
= 12 V, V
2
= 24 V. We ar e asked t o det er mi ne t he el ect r i cal
cur r ent s I
1
, I
2
, and I
3
, associ at ed wi t h t he ci r cul at i on l oops shown i n t he f i gur e.

The ci r cul at i on l oops shown pr e-det er mi ne f or us a pr ef er r ed di r ect i on i n each l oop t o wr i t e
Ki r chof f l aw of vol t age i n a cl osed l oop. Basi cal l y, we st ar t at a node i n t he ci r cui t and move
ar ound a gi ven l oop subt r act i ng vol t ages RI i f t he cur r ent i s i n t he same di r ect i on as t he l oop
di r ect i on, or addi ng vol t ages i f t he cur r ent and t he l oop di r ect i ons ar e opposi t e. When
encount er i ng a vol t age sour ce, t he vol t age f r om t he sour ce i s added or subt r act ed accor di ng t o
t he or i ent at i on of t he vol t age sour ce wi t h r espect t o t he l oop ci r cul at i on di r ect i on. We st op
back at t he same node wer e we st ar t ed t o compl et e t he vol t age equat i on f or a gi ven l oop.

For t he case shown i n t he f i gur e we can wr i t e:

I
1
: -R
1
I
1
R
2
I
1
- R
3
(I
1
I
2
) V
1
= 0
I
2
: -R
4
I
2
R
5
I
2
R
6
(I
2
I
3
) R
3
(I
2
-I
1
)=0
I
3
: -V
2
R
8
I
3
R
7
I
3
R
6
I
3
= 0


Repl aci ng t he val ues of t he r esi st ances and vol t age sour ces:

I
1
: -1500I
1
800I
1
- 1500 (I
1
I
2
) 12 = 0
I
2
: -800I
2
1500I
2
800 (I
2
I
3
) 1500 (I
2
-I
1
)=0
I
3
: -24 800I
3
1500I
3
800(I
3
I
2
) = 0

217 2001 - Gi l ber t o E. Ur r oz
Al l r i ght r eser ved

Al gebr ai c mani pul at i on of t he equat i ons r educe t hem t o t he f ol l owi ng syst em of l i near
equat i ons:
-3800I
1
+1500I
2
= 12
1500I
1
- 4600I
2
+ 800I
3
= 0
800I
2
- 3100I
3
= 24

Thi s syst em can be wr i t t en as a mat r i ci al syst em:

.
24
0
12
, ,
3100 800 0
800 4600 1500
0 1500 3800
3
2
1
(
(
(

=
(
(
(

=
(
(
(

= b x A
I
I
I


A sol ut i on can be obt ai ned by usi ng l ef t di vi si on, an i nver se mat r i x, or f unct i on l i nsol ve. The
t hr ee met hods ar e i l l ust r at ed bel ow:

-->A=[-3800,1500,0;1500,-4600,800;0,800,-3100]
A =
! - 3800. 1500. 0. !
! 1500. - 4600. 800. !
! 0. 800. - 3100. !
-->b = [12;0;24]
b =
! 12. !
! 0. !
! 24. !

Usi ng l ef t di vi si on:

-->x = A\b
x =
! - .0042929 !
! - .0028753 !
! - .0084840 !

Usi ng t he i nver se of mat r i x A:

-->x = inv(A)*b
x =
! - .0042929 !
! - .0028753 !
! - .0084840 !


Usi ng l i nsol ve:

-->c = -b
c =

218 2001 - Gi l ber t o E. Ur r oz
Al l r i ght r eser ved
! - 12. !
! 0. !
! - 24. !
-->x = linsolve(A,c)
x =
! - .0042929 !
! - .0028753 !
! - .0084840 !

Regar dl ess of t he met hod used t o obt ai n t he sol ut i on, t he f i nal r esul t s ar e:

I
1
= -0. 0042929 A = -4. 2929 mA, I
2
= -0. 0028753 A = -2. 8753 mA, I
3
= -0. 0084840 A = 8. 484 mA.

__________________________________________________________________________________
St r uct ur al mechani cs

Consi der t he t r uss st r uct ur e shown i n t he f i gur e bel ow. Hor i zont al and ver t i cal bar s ar e of
l engt h 1. 0 m, and di agonal bar s 1. 4142 m. Al l acut e angl es i n t he t r uss ar e 45
o
.


By i sol at i ng each node, as shown i n t he f i gur e bel ow, we can wr i t e t he f ol l owi ng equat i ons f or
node equi l i br i um (i . e. , Fx = 0, Fy = 0):


219 2001 - Gi l ber t o E. Ur r oz
Al l r i ght r eser ved




F
2
+ F
1
cos 45
o

= 0,
25 + F
1
si n 45
o
= 0,
-F
2
+ F
6
= 0,
-5 + F
3
= 0,
F
4
F
1
cos 45
o
+ F
5
cos 45
o
= 0,
-20 F
3
F
1
cos 45
o
F
5
cos 45
o
=0,
-F
4
+ F
7
cos 45
o
= 0,
-15 F
8
F
7
cos 45
o
= 0,
-F
6
+ F
9
F
5
cos 45
o
= 0,
-10 + F
8
+ F
5
cos 45
o
= 0,
-F
9
F
7
cos 45
o
= 0,
25 + F
7
cos 45
o
= 0.


Wi t h si n 45
o
= cos 45
o
= 0. 866, t hen we have:


0. 866 F
1
+ F
2
= 0
0. 866 F
1
= -25
-F
2
+ F
6
= 0
F
3
= 5
-0. 866F
1
+F
4
+0. 866F
5

= 0
-0. 866F
1
-F
3
-0. 866F
5

=20
-F
4
+ 0. 866F
7
= 0
-0. 866F
7
F
8
= 15
-0. 866F
5
F
6
+ F
9
= 0
0. 866F
5
+F
8

=10
-0. 866F
7
F
9
= 0
0. 866 F
7
= -25

We have a t ot al of 12 equat i ons wi t h 9 unknowns. The syst em i s over - det er mi ned, so we
choose, ar bi t r ar i l y, t he f i r st 9 equat i ons:

0. 866 F
1
+ F
2
= 0
0. 866 F
1
= -25
-F
2
+ F
6
= 0
F
3
= 5
-0. 866F
1
+F
4
+0. 866F
5

= 0
-0. 866F
1
-F
3
-0. 866F
5

=20
-F
4
+ 0. 866F
7
= 0
-0. 866F
7
F
8
= 15
-0. 866F
5
F
6
+ F9 = 0


220 2001 - Gi l ber t o E. Ur r oz
Al l r i ght r eser ved

Wr i t i ng t he syst em as a mat r i x equat i on:




The coef f i ci ent mat r i x f or t hi s pr obl em i s a spar se mat r i x. To sol ve t hi s pr obl em usi ng SCILAB
we need t o l oad vect or s cont ai ni ng t he i ndi ces and t he val ues of t he non- zer o el ement s of t he
mat r i x A, i . e. ,

-->index =
[1,1;1,2;2,1;3,2;3,6;4,3;5,1;5,4;5,5;6,1;6,3;6,5;7,4;7,7;8,7;8,8;9,5;9,6;9,9];
-->values = [0.866,1,0.866,-1,1,1,-0.866,1,0.866,-0.866,-1,-0.866,-1,0.866,-
0.866,-1,-0.866,-1,1];
-->dim = [9,9];

To check t hat t he di mensi ons of t he mat r i x i ndex and vect or val ues ar e compat i bl e use t he
f unct i on si ze

-->size(index), size(values)
ans =
! 19. 2. !
ans =
! 1. 19. !

Next , we cr eat e t he mat r i x of coef f i ci ent s A as a spar se mat r i x:

-->A = sparse(index,values,dim);


The f ul l mat r i x can be seen by usi ng:

-->full(A)
ans =
! .866 1. 0. 0. 0. 0. 0. 0. 0. !
(
(
(
(
(
(
(
(
(
(
(
(

=
(
(
(
(
(
(
(
(
(
(
(
(

(
(
(
(
(
(
(
(
(
(
(
(

0
15
0
20
0
5
0
25
0
1 0 0 1 866 . 0 0 0 0 0
0 1 866 . 0 0 0 0 0 0 0
0 0 866 . 0 0 0 1 0 0 0
0 0 0 0 866 . 0 0 1 0 866 . 0
0 0 0 0 866 . 0 1 0 0 866 . 0
0 0 0 0 0 0 1 0 0
0 0 0 1 0 0 0 1 0
0 0 0 0 0 0 0 0 866 . 0
0 0 0 0 0 0 0 1 866 . 0
9
8
7
6
5
4
3
2
1
F
F
F
F
F
F
F
F
F

221 2001 - Gi l ber t o E. Ur r oz
Al l r i ght r eser ved
! .866 0. 0. 0. 0. 0. 0. 0. 0. !
! 0. - 1. 0. 0. 0. 1. 0. 0. 0. !
! 0. 0. 1. 0. 0. 0. 0. 0. 0. !
! - .866 0. 0. 1. .866 0. 0. 0. 0. !
! - .866 0. - 1. 0. - .866 0. 0. 0. 0. !
! 0. 0. 0. - 1. 0. 0. .866 0. 0. !
! 0. 0. 0. 0. 0. 0. - .866 - 1. 0. !
! 0. 0. 0. 0. - .866 - 1. 0. 0. 1. !

Next , we def i ne t he r i ght -hand si de vect or :

-->b = full(sparse(indexb,valuesb,dimb));
-->b
b =
! 0. !
! - 25. !
! 0. !
! 5. !
! 0. !
! 20. !
! 0. !
! 15. !
! 0. !

The sol ut i on t o t he syst em i s:

-->x = lusolve(A,b)
x =
! - 28.86836 !
! 25. !
! 5. !
! - 25. !
! 0. !
! 25. !
! - 28.86836 !
! 10. !
! 25. !

i . e. ,


F
1
=-28. 87 kN, F
2
= 25 kN, F
3
= 5 kN,
F
4
= -25 kN, F
5
= 0 kN, F
6
= 25 kN,
F
7
= -28. 87 kN, F
8
= 10 kN, F
9
= 25 kN.

Di mensi onl ess number s i n f l ui d mechani cs

Di mensi onal anal ysi s i s a t echni que used i n f l ui d mechani cs, and ot her sci ences, t o r educe t he
number of var i abl es i nvol ved i n an exper i ment by cr eat i ng di mensi onl ess number s t hat
combi ne t he or i gi nal set of var i abl es. In or der t o obt ai n t hese di mensi onl ess number s, we
make use of t he pr i nci pl e of di mensi onal homogenei t y, whi ch basi cal l y st at es t hat an equat i on
der i ved f r om conser vat i on l aws and mat er i al pr oper t i es shoul d have t he same di mensi ons on

222 2001 - Gi l ber t o E. Ur r oz
Al l r i ght r eser ved
bot h si des of t he equat i on. For exampl e, t he equat i on f or t he di st ance t r avel ed by a pr oj ect i l e
dr opped f r om r est at a cer t ai n el evat i on above t he gr ound i s gi ven by d = gt
2
, wher e g =
9. 806 m/ s
2
, i s t he accel er at i on of gr avi t y, and t i s t he t i me i n seconds. The di st ance d i s gi ven
i n met er s. Inst ead of deal i ng wi t h uni t s, we r ef er t o t hr ee (somet i mes mor e) f undament al
di mensi ons: l engt h (L), t i me (T), and mass (M). We use br acket s t o r ef er t o t he di mensi ons of
a quant i t y, t hus, [ d] = L, g = [ LT
- 2
] , and t = [ T] . Repl aci ng di mensi ons i n t he f or mul a f or d we
have:

[ d] = [ 1/ 2] [ g] [ t ]
2
= 1LT
- 2
T
2

= L,

as expect ed. Thus, we say t hat t he equat i on d = gt
2
i s di mensi onal l y homogeneous.

Suppose t hat we have an exper i ment t hat i nvol ves t he f ol l owi ng var i abl es (showed wi t h t hei r
di mensi ons at t ached):

D = a di amet er (L)
V = a f l ow vel oci t y ( LT
- 1
)
= ki nemat i c vi scosi t y of t he f l ui d (L
2
T
- 1
)
= densi t y of t he f l ui d (ML
- 3
)
E = bul k densi t y of t he f l ui d (ML
- 1
T
- 2
)
= sur f ace t ensi on of t he f l ui d (MT
- 2
)
p = a char act er i st i c pr essur e dr op i n t he f l ow (ML
- 1
T
- 2
)
g = accel er at i on of gr avi t y (LT
- 2
)

Ther e ar e m = 8 var i abl es whi ch need n = 3 di mensi ons t o be expr essed (i . e. , L, T, and M).
Bucki ngham s t heor em i ndi cat es t hat you can f or m r = m n = 8 3 = 5 di mensi onl ess
par amet er s. The t echni que consi st s i n sel ect i ng one geomet r i c var i abl e, i n t hi s case we have
no choi ce but t o sel ect D, t he onl y var i abl e t hat r epr esent s geomet r y al one; a ki nemat i c
var i abl e, V (you can al so choose ), i . e. , a var i abl e i nvol vi ng l engt h and t i me; and, f i nal l y, a
dynami c var i abl e, say , i . e. , a var i abl e i nvol vi ng l engt h, t i me, and mass. These t hr ee
var i abl es, D, V and , become r epeat i ng var i abl es, i . e. , var i abl es t hat wi l l par t i ci pat e i n each
of t he di mensi onl ess par amet er s t o be f or med. Each di mensi onl ess par amet er , or number , i s
f or med by mul t i pl yi ng t he r epeat i ng var i abl es r ai sed t o a cer t ai n unknown power and
mul t i pl yi ng one of t he r emai ni ng var i abl es. For exampl e, we can f or m f or t hi s case t he
f ol l owi ng par amet er s:

1
=
x
D
y
V
z
,

2
=
x
D
y
V
z
E,

3
=
x
D
y
V
z
,

4
=
x
D
y
V
z
p,

5
=
x
D
y
V
z
g.
Si nce t he number s ar e di mensi onl ess, we can wr i t e [
i
] = L
0
T
0
M
0
, f or i = 1, 2, 3, 4, 5.
Repl aci ng t he di mensi ons of t he var i abl es i nvol ved i n each di mensi onl ess par amet er s we can
wr i t e, f or exampl e, f or
1
:

L
0
T
0
M
0
= (ML
- 3
)
x
(L)
y
( LT
- 1
)
z
( L
2
T
- 1
) = (L)
3x+y+z+2
(T)
z 1
(M)
x
,

Fr om whi ch we get t he f ol l owi ng equat i ons:


223 2001 - Gi l ber t o E. Ur r oz
Al l r i ght r eser ved
3x+y+z+2 = 0
z 1= 0
x = 0

Or ,



If we r epl ace t he di mensi ons of t he non-r epeat i ng var i abl es i n t he r emai ni ng par amet er s, we
can expand t he mat r i x equat i on shown above t o r ead:



So, t he i ndependent vect or b has become a mat r i x B, and we can wr i t e t he mat r i x equat i on AX
= B. The col umns of B ar e t he negat i ves of t he exponent s of t he di mensi ons, L, T, and M, i n
t hat or der , of each of t he non-r epeat i ng var i abl es as shown i n t he par amet er s t hat we set
up.


To sol ve f or t he var i abl es x, y, z f or each par amet er usi ng SCILAB, we pr opose usi ng f unct i on
gaussel i md:

-->A = [-3,1,1;0,0,-1;1,0,0]
A =
! - 3. 1. 1. !
! 0. 0. - 1. !
! 1. 0. 0. !
-->B = [-2,1,0,1,-1;1,2,2,2,2;0,-1,-1,-1,0]
B =
! - 2. 1. 0. 1. - 1. !
! 1. 2. 2. 2. 2. !
! 0. - 1. - 1. - 1. 0. !
-->getf('gausselimd')
-->[x,detA]=gausselimd(A,B)
detA =
1.
x =
(
(
(

=
(
(
(

(
(
(

0
1
2
0 0 1
1 0 0
1 1 3
z
y
x
(
(
(



=
(
(
(

(
(
(

0 1 1 1 0
2 2 2 2 1
1 1 0 1 2
0 0 1
1 0 0
1 1 3
z
y
x

224 2001 - Gi l ber t o E. Ur r oz
Al l r i ght r eser ved
! 0. - 1. - 1. - 1. 0. !
! - 1. 0. - 1. 0. 1. !
! - 1. - 2. - 2. - 2. - 2. !

The r esul t i s t he mat r i x

each col umn r epr esent i ng t he val ues of x, y, z, f or t he r epeat i ng var i abl es i n each of t he
di mensi onl ess par amet er s, t hus we have:


1
=
0
D
- 1
V
- 1
= / DV,

2
=
- 1
D
0
V
- 2
E = E/ V
2
,

3
=
- 1
D
- 1
V
- 2
= / DV
2

4
=
- 1
D
0
V
- 2
p = p/ V
2
,

5
=
0
D
1
V
- 2
g = gD/ V
2
.

Not e: i f you don t want t o use f unct i on gaussel i md you can use, f or exampl e, l ef t -di vi si on:
-->A\B
ans =
! 0. - 1. - 1. - 1. 0. !
! - 1. 0. - 1. 0. 1. !
! - 1. - 2. - 2. - 2. - 2. !

Or , a Gauss-Jor dan el i mi nat i on wi t h f unct i on r r ef :
-->A_aug = [A B]
A_aug =
! - 3. 1. 1. - 2. 1. 0. 1. - 1. !
! 0. 0. - 1. 1. 2. 2. 2. 2. !
! 1. 0. 0. 0. - 1. - 1. - 1. 0. !
-->rref(A_aug)
ans =
! 1. 0. 0. 0. - 1. - 1. - 1. 0. !
! 0. 1. 0. - 1. 0. - 1. 0. 1. !
! 0. 0. 1. - 1. - 2. - 2. - 2. - 2. !


,
2 2 2 2 1
1 0 1 0 1
0 1 1 1 0
|
|
|
.
|

\
|



= X

225 2001 - Gi l ber t o E. Ur r oz
Al l r i ght r eser ved
St r ess at a poi nt i n a sol i d i n equi l i br i um

Consi der a sol i d body i n equi l i br i um under t he act i on of a syst em of f or ces and moment s, as
i l l ust r at ed i n t he f i gur e bel ow. If we wer e t o make an i magi nar y cut t hr ough t he sol i d body, so
t hat we can separ at e i t i nt o t wo par t s at sect i on S.

The ef f ect of t he par t t hat we r emove t o t he r i ght of t he cut sur f ace S i s r epl aced by t he f or ce
F, whi ch i n t ur n can be decomposed i nt o a nor mal component , F
N
, and a shear or t angent i al
component F
S
.

Suppose now t hat we i sol at e a smal l par t i cl e of f t hi s sol i d body, and we do i t by cut t i ng t he
body wi t h f our pl anes so t hat we can dr aw t he par t i cl e as shown i n t he l ef t - hand si de of t he
f i gur e bel ow.



Thr ee of t he pl anes ar e chose t o be per pendi cul ar t o each ot her so t hat t hey hel p us i dent i f y a
Car t esi an coor di nat e syst em (x
1
, x
2
, x
3
) as shown above. The sur f ace S, l i mi t i ng t he par t i cl e
f r om above, has a nor mal uni t vect or n = [ cos
1
, cos
2
, cos
3
] , wher e cos
1
, cos
2
, and cos

3
ar e t he di r ect i on cosi nes of n. The ot her t hr ee sur f aces l i mi t i ng t he par t i cl e ar e S
1
, S
2
, and
S
3
, wher e t he sub- i ndex i ndi cat es t he axi s t hat i s nor mal t o t he sur f ace. The ef f ect of t he sol i d

226 2001 - Gi l ber t o E. Ur r oz
Al l r i ght r eser ved
body on t hi s par t i cl e i s r epr esent ed by t he f or ces F, F
1
, F
2
, and F
3
, act i ng, r espect i vel y, upon
sur f aces S, S
1
, S
2
, and S
3
. Let t he ar eas cor r espondi ng t o each sur f ace S, S
1
, S
2
, and S
3
be gi ven
by A, A
1
, A
2
, and A
3
. It i s possi bl e t o show, f r om t he geomet r y of t he f i gur e, t hat

A
1
= Acos
1
, A
2
= Acos
2
, and A
3
= Acos
3
.

The f or ce F on sur f ace S can be decomposed i nt o a nor mal component ,

F
N
= F
N
n = F
N
[ cos
1
, cos
2
, cos
3
] = F
N
( cos
1
e
1
+ cos
2
e
2
+ cos
3
e
3
) = F
N
cos
j
e
j
, (*)

(*) usi ng Ei nst ei n s r epeat ed i ndex convent i on.


and a shear component ,

F
S
= F F
N
,

as shown i n t he f i gur e above. The vect or s ar e t he uni t vect or s cor r espondi ng t o t he t hr ee
coor di nat e di r ect i ons.

The f or ces on sur f aces S
1
, S
2
, and S
3
can be wr i t t en i n t er ms of t he st r ess component s,
i j
,
shown i n t he f i gur e bel ow, as


F
i
= [ -
i 1
, -
i 2
, -
i 3
] A
i
= (-
i 1
e
1
-
i 2
e
2
-
i 3
e
3
)A
i
= (-
i 1
e
1
-
i 2
e
2
-
i 3
e
3
)Acos
i
(i = 1, 2, 3).


Usi ng Ei nst ei n s r epeat ed i ndex convent i on we can wr i t e


F
i
= [ -
i 1
, -
i 2
, -
i 3
] A
i
= -
i j
e
j
A
i
= -
i j
e
j
Acos
i
(i = 1, 2, 3).


The sub-i ndi ces i dent i f yi ng each st r ess component s ar e chosen so t hat t he f i r st sub-i ndex
r epr esent s t he sub-i ndex of t he axi s nor mal t o t he sur f ace of i nt er est , and t he second
r epr esent s t he di r ect i on al ong whi ch t he st r ess act s.

St r esses wi t h t he same sub-i ndex,
i i
(i = 1, 2, 3) act nor mal t o t he appr opr i at e sur f ace and ar e
known as nor mal st r esses. The ot her t wo component s on each of t he sur f aces S
1
, S
2
, and S
3
,
ar e known as shear st r esses, i . e. ,
i j
, i j . The di r ect i on of act i on as shown i n t he f i gur e bel ow
i s t he convent i onal way t o r epr esent t he st r esses, namel y, t he st r esses ar e posi t i ve when act i ng
i n t he negat i ve coor di nat e di r ect i ons, so t hat t he r esul t i ng f or ces have a negat i ve si gn, as
shown i n t he equat i on above.


227 2001 - Gi l ber t o E. Ur r oz
Al l r i ght r eser ved




The st r ess component s i l l ust r at ed i n t he f i gur e above can be wr i t t en as a mat r i x known as t he
st r ess t ensor ,


The set up of t he Car t esi an coor di nat e syst em and t he st r esses i n t he par t i cl e under
consi der at i on can be used t o def i ne t he st r ess condi t i on at a poi nt i n t he l i mi t when t he
di mensi ons of t he par t i cl e t end t o zer o. Under such condi t i ons you can pr ove t hat t he st r ess
t ensor i s symmet r i c, i . e. ,
i j
=
j i
. Ther ef or e, t o def i ne compl et el y t he st at e of st r ess at a
poi nt we need onl y t o know t he t hr ee nor mal st r esses and t hr ee of t he shear st r esses.

For t he equi l i br i um of f or ce on t he par t i cl e we can wr i t e

F + F
i
= F + (-
i j
e
j
Acos
i
) = 0, or F =
i j
e
j
Acos
i


[ usi ng Ei nst ei n s convent i on, wi t h bot h i and j r epeat ed]

If we l et
F = A,

wher e s i s t he st r ess vect or on sur f ace S, and r epl ace t hi s val ue i n t he pr evi ous equat i on we get


=
i j
cos
i
e
j
= cos
i
e
j

i j
= nT

.
33 32 31
23 22 21
13 12 11
(
(
(

=



T

228 2001 - Gi l ber t o E. Ur r oz
Al l r i ght r eser ved
To f i nd t he magni t ude of t he nor mal component of t he st r ess vect or , i . e. , t he pr oj ect i on of t he
st r ess al ong t he uni t nor mal vect or n, we use

n
= n / | n| = n =(
i j
cos
i
e
j
) (cos
k
e
k
) =
i j
cos
i
cos
k
( e
j
e
k
).

We can pr ove t hat f or t he uni t vect or s i n t he Car t esi an coor di nat e syst em,

e
j
e
k
=
j k
,

wher e
j k
i s Di r ac s del t a f unct i on. Thus, t he nor mal component of t he st r ess on sur f ace S i s

n
=
i j
cos
i
cos
k

j k


Si nce t he pr oduct i ndi cat ed i n t hi s expr essi on i s zer o i f j k, t hen t he onl y t er ms sur vi vi ng ar e
t hose f or whi ch j = k, i . e. ,

n
=
i j
cos
i
cos
j
= cos
j

i j
cos
i
.

You can pr ove t hat t hi s l at t er r esul t can be wr i t t en i n vect or and mat r i x not at i on as t he
quadr at i c f or m

n
= nTn
T

,

wher e

n = cos
j
e
j
.

Thus, t he nor mal st r ess magni t ude can be wr i t t en as a quadr at i c f or m f or any nor mal uni t
vect or n = n
j
e
j
, wr i t t en as a r ow vect or s, wi t h n
j
= cos
j
, j = 1, 2, 3. Al so, t he nor mal st r ess
as a vect or wi l l be wr i t t en as


n
=
n
n = (nTn
T
) n


The nor mal f or ce i s gi ven by

F
N
=
n
A = (
n
A)n.

The shear f or ce can be wr i t t en i n t er ms of shear st r ess on sur f ace S, F
S
= F F
N
=
S
A, so t hat


S
=
n
.

Exampl e:

Let t he st r ess at a poi nt be gi ven by

Pa
(
(
(

=
40 15 20
15 30 10
20 10 25
T

229 2001 - Gi l ber t o E. Ur r oz
Al l r i ght r eser ved
Det er mi ne t he t ot al st r ess , t he nor mal st r ess
n
, and shear st r ess
S
, i f t he sur f ace S has a
nor mal uni t vect or n = [ 0. 5 0. 25 0. 8292] . What ar e t he t ot al f or ce F, t he nor mal f or ce F
n
, and
t he shear f or ce F
S
, i f t he sur f ace S has an ar ea of 0. 00001 m
2


Sol ut i on:

To cal cul at e t he t ot al st r ess we use



Thi s r esul t can be obt ai ned by usi ng SCILAB as f ol l ows:

-->T = [25,-10,20;-10,30,15;20,15,40], n = [0.5,0.25,0.829]
T =
! 25. - 10. 20. !
! - 10. 30. 15. !
! 20. 15. 40. !
n =
! .5 .25 .829 !
-->sigma = T*n'
sigma =
! 26.58 !
! 14.935 !
! 46.91 !

To cal cul at e t he nor mal st r ess, use:



Usi ng SCILAB:

-->sigma_n = n*T*n'
sigma_n =
55.91214


The r esul t i s
n
= 55. 93 Pa.

The shear st r ess i s gi ven by
(
(
(

(
(
(

= =
8292 . 0
25 . 0
5 . 0
40 15 20
15 30 10
20 10 25
e T n
r r

(
(
(

(
(
(

= =
8292 . 0
25 . 0
5 . 0
40 15 20
15 30 10
20 10 25
e T n
r r


230 2001 - Gi l ber t o E. Ur r oz
Al l r i ght r eser ved


S
=
n
,

or , usi ng SCILAB:

-->sigma_s = sigma - sigma_n*n'
sigma_s =
! - 1.37607 !
! .956965 !
! .5588359 !

The f or ces can be cal cul at ed by mul t i pl yi ng t he st r esses t i mes t he ar ea of t he sur f ace S, i . e. , F
= A, F
n
=
n
A, and F
t
=
t
A. Usi ng Mapl e, t he f or ces ar e cal cul at ed as:

-->A = 0.00001
A =
.00001
-->Fn = sigma_n*n'*A
Fn =
! .0002796 !
! .0001398 !
! .0004635 !
-->Ft = sigma_s*A
Ft =
! - .0000138 !
! .0000096 !
! .0000056 !
-->F = sigma*A
F =
! .0002658 !
! .0001494 !
! .0004691 !

In paper , t hese f or ces ar e wr i t t en as

F
n
= (2. 79i +1. 39j +4. 63k)10
- 4
N,
F
s
= (-1. 38i +0. 96j +0. 54k)10
- 5
N,
F

= (2. 66i +1. 49j +4. 69k)10
- 4
N.


Pr i nci pal st r esses at a poi nt

Gi ven t he st r ess t ensor T r epr esent i ng t he st at e of st r ess at a poi nt P i n a Car t esi an coor di nat e
syst em (x
1
, x
2
, x
3
), suppose t hat you want t o f i nd t he nor mal vect or , or vect or s, n f or whi ch t he
st r ess i s onl y i n t he nor mal di r ect i on. In ot her wor ds, we ar e t r yi ng t o f i nd n and
n
such t hat


231 2001 - Gi l ber t o E. Ur r oz
Al l r i ght r eser ved
Tn =
n
n.

Thi s equat i on i s t he ei genval ue equat i on f or t he mat r i x T wi t h ei genval ues
n
and ei genvect or s
n.


Recal l t hat t hi s equat i on can be wr i t t en al so as

(T
n
I) n = 0,

whi ch has non-t r i vi al sol ut i on i f

det (T
n
I) = 0.

For t he pr evi ous exampl e, we can wr i t e


To obt ai n t he ei genval ues and ei genvect or s of T we use f unct i on ei genvect or s i n SCILAB:

-->getf('eigenvectors')
-->[x,sigm] = eigenvectors(T)
sigm =
! 1.1203785 37.800525 56.079096 !
x =
! - .6673642 - .6009826 .4398237 !
! - .5119885 .7991229 .3150721 !
! .5408260 .0149168 .8410022 !

In paper we woul d wr i t e:

n
1
= [ -0. 667 -0. 512 0. 541] , (
n
)
1
= 1. 12,
n
2
= [ -0. 601 0. 800 0. 015] , (
n
)
2
= 37. 80,
n
3
=[ 0. 440 0. 315 0. 841] , (
n
)
3
= 56. 08.


The t hr ee nor mal st r esses f ound ar e known as t he pr i nci pal st r esses at t he poi nt . The
ei genval ues r epr esent t he nor mal vect or s t o t he sur f aces wher e t hose pr i nci pal st r esses act .
These di r ect i ons ar e known as t he pr i nci pal axes.





=



= 0
40 15 20
15 30 10
20 10 25
) det(
n
n
n
n

I T

232 2001 - Gi l ber t o E. Ur r oz
Al l r i ght r eser ved
Mul t i pl e l i near f i t t i ng

Consi der a dat a set of t he f or m

x
1
x
2
x
3
x
n
y
x
11
x
21
x
31
x
n1
y
1

x
12
x
22
x
32
x
n2
y
2

x
13
x
32
x
33
x
n3
y
3

. . . . .
. . . . . .
x
1, m- 1
x
2, m- 1
x
3, m- 1
x
n, m- 1
y
m- 1

x
1, m
x
2, m
x
3, m
x
n, m
y
m


Suppose t hat we sear ch f or a dat a f i t t i ng of t he f or m

y = b
0
+ b
1
x
1
+ b
2
x
2
+ b
3
x
3
+ + b
n
x
n
.

You can obt ai n t he l east -squar e appr oxi mat i on t o t he val ues of t he coef f i ci ent s

b = [ b
0
b
1
b
2
b
3
b
n
] ,

by put t i ng t oget her t he mat r i x X
_ _
1 x
11
x
21
x
31
x
n1

1 x
12
x
22
x
32
x
n2

1 x
13
x
32
x
33
x
n3

. . . . .
. . . . . .
1 x
1, m
x
2, m
x
3, m
x
n, m

_ _


Then, t he vect or of coef f i ci ent s i s obt ai ned f r om

b = (X
T
X)
- 1
X
T
y,

wher e y i s t he vect or

y = [ y
1
y
2
y
m
]
T
.



For exampl e, use t he f ol l owi ng dat a t o obt ai n t he mul t i pl e l i near f i t t i ng

y = b
0
+ b
1
x
1
+ b
2
x
2
+ b
3
x
3,






233 2001 - Gi l ber t o E. Ur r oz
Al l r i ght r eser ved
x
1
x
2
x
3
y
1. 20 3. 10 2. 00 5. 70
2. 50 3. 10 2. 50 8. 20
3. 50 4. 50 2. 50 5. 00
4. 00 4. 50 3. 00 8. 20
6. 00 5. 00 3. 50 9. 50

Wi t h SCILAB you can pr oceed as f ol l ows:

Fi r st , ent er t he vect or s x
1
, x
2
, x
3
, and y, as r ow vect or s:

->x1 = [1.2,2.5,3.5,4.0,6.0]
x1 =
! 1.2 2.5 3.5 4. 6. !
-->x2 = [3.1,3.1,4.5,4.5,5.0]
x2 =
! 3.1 3.1 4.5 4.5 5. !
-->x3 = [2.0,2.5,2.5,3.0,3.5]
x3 =
! 2. 2.5 2.5 3. 3.5 !
-->y = [5.7,8.2,5.0,8.2,9.5]
y =
! 5.7 8.2 5. 8.2 9.5 !

Next , we f or m mat r i x X and r epl ace y by i t s t r anspose:

-->X = [ones(5,1) x1' x2' x3']
X =
! 1. 1.2 3.1 2. !
! 1. 2.5 3.1 2.5 !
! 1. 3.5 4.5 2.5 !
! 1. 4. 4.5 3. !
! 1. 6. 5. 3.5 !

The vect or of coef f i ci ent s f or t he mul t i pl e l i near equat i on i s cal cul at ed as:

-->b =inv(X'*X)*X'*y
b =
! - 2.1649851 !
! - .7144632 !
! - 1.7850398 !
! 7.0941849 !

Thus, t he mult iple-linear r egr ession equat ion is:

y^ = -2.1649851-0.7144632x
1
-1.7850398x
2
+7.0941849x
3
.

234 2001 - Gi l ber t o E. Ur r oz
Al l r i ght r eser ved


Thi s f unct i on can be used t o eval uat e y f or val ues of x gi ven as [ x
1
, x
2
, x
3
] . For exampl e, f or
[ x
1
, x
2
, x
3
] = [ 3, 4, 2] , const r uct a vect or xx = [ 1, 3, 4, 2] , and mul t i pl y xx t i mes b, t o obt ai n y(xx):

-->xx = [1,3,4,2]
xx =
! 1. 3. 4. 2. !
-->xx*b
ans =
2.739836

The f i t t ed val ues of y cor r espondi ng t o t he val ues of x
1
, x
2
, and x
3
f r om t he t abl e ar e obt ai ned
f r om y = Xb:

-->X*b
ans =
! 5.6324056 !
! 8.2506958 !
! 5.0371769 !
! 8.2270378 !
! 9.4526839 !

Compar e t hese f i t t ed val ues wi t h t he or i gi nal dat a as shown i n t he t abl e bel ow:

x
1
x
2
x
3
y y-f i t t ed
1. 20 3. 10 2. 00 5. 70 5. 63
2. 50 3. 10 2. 50 8. 20 8. 25
3. 50 4. 50 2. 50 5. 00 5. 04
4. 00 4. 50 3. 00 8. 20 8. 23
6. 00 5. 00 3. 50 9. 50 9. 45


Pol ynomi al f i t t i ng

Consi der t he x-y dat a set


x y
x
1
y
1

x
2
y
2

x
3
y
3

. .
. .
x
n- 1
y
n- 1

x
n
y
n



235 2001 - Gi l ber t o E. Ur r oz
Al l r i ght r eser ved


Suppose t hat we want t o f i t a pol ynomi al or or der p t o t hi s dat a set . In ot her wor ds, we seek a
f i t t i ng of t he f or m

y = b
0
+ b
1
x + b
2
x
2
+ b
3
x
3
+ + b
p
x
p
.


You can obt ai n t he l east -squar e appr oxi mat i on t o t he val ues of t he coef f i ci ent s


b = [ b
0
b
1
b
2
b
3
b
p
] ,


by put t i ng t oget her t he mat r i x X
_ _
1 x
1
x
1
2
x
1
3
x
1
p- 2
x
1
p- 1

1 x
2
x
2
2
x
2
3
x
2
p- 2
x
2
p- 1

1 x
3
x
3
2
x
3
3
x
3
p- 2
x
3
p- 1

. . . . . .
. . . . . . .
1 x
n
x
n
2
x
n
3
x
n
p- 2
x
n
p- 1

_ _

Then, t he vect or of coef f i ci ent s i s obt ai ned f r om b = (X
T
X)
- 1
X
T
y, wher e y i s t he vect or y = [ y
1
y
2
y
n
]
T
.


Ear l i er on, i n t hi s chapt er , we def i ned t he Vander monde mat r i x cor r espondi ng t o a vect or x =
[ x
1
x
2
x
n
] as
_ _
1 x
1
x
1
2
x
1
3
x
1
n- 1

1 x
2
x
2
2
x
2
3
x
2
n- 1

1 x
3
x
3
2
x
3
3
x
3
n- 1

. . . . .
. . . . . .
1 x
n
x
n
2
x
n
3
x
n
n- 1

_ _

Not i ce t hat t hi s mat r i x i s si mi l ar t o t he mat r i x X of i nt er est t o t he pol ynomi al f i t t i ng, but
havi ng onl y n, r at her t han (p+1) col umns.

We can t ake advant age of t he VANDERMONDE f unct i on t o cr eat e t he mat r i x X i f we obser ve t he
f ol l owi ng r ul es:

If p = n-1, X = V
n
.
If p < n-1, t hen we need t o r emove col umns p+2, , n-1, n f r om mat r i x V
n
t o f or m mat r i x X.
If p > n-1, t hen we need t o add col umns n+1, , p-1, p+1, t o mat r i x V
n
t o f or m mat r i x X.

Af t er X i s r eady, and havi ng t he vect or y avai l abl e, t he cal cul at i on of t he coef f i ci ent vect or b
i s t he same as i n mul t i pl e l i near f i t t i ng (t he pr evi ous mat r i x appl i cat i on).

236 2001 - Gi l ber t o E. Ur r oz
Al l r i ght r eser ved

Because we can f i t a pol ynomi al of any degr ee t o our dat a, we need t o be abl e t o eval uat e t he
f i t t i ng by checki ng on a coupl e of par amet er s, namel y, t he sum of squar ed er r or s (SSE) and t he
cor r el at i on coef f i ci ent , r . These par amet er s ar e def i ned as f ol l ows:

Gi ven t he vect or s x and y of dat a t o be f i t t o t he pol ynomi al equat i on, we f or m t he mat r i x X
and use i t t o cal cul at e a vect or of pol ynomi al coef f i ci ent s b. We can cal cul at e a vect or of
f i t t ed dat a, y , by usi ng
y = Xb.
An er r or vect or i s cal cul at ed by
e = y y .

The sum of squar e er r or s i s equal t o t he squar e of t he magni t ude of t he er r or vect or , i . e. ,

SSE = | e|
2
= e e = e
i
2
= (y
i
-y
i
)
2
.

To cal cul at e t he cor r el at i on coef f i ci ent we need t o cal cul at e f i r st what i s known as t he sum of
squar ed t ot al s, SST, def i ned as
SST = (y
i
-y)
2
,

wher e y i s t he mean val ue of t he or i gi nal y val ues, i . e. ,

y = (y
i
)/ n.

In t er ms of SSE and SST, t he cor r el at i on coef f i ci ent i s def i ned by

. 1
SST
SSE
r =

Thi s val ue i s const r ai ned t o t he r ange 1 < r < 1. The cl oser r i s t o +1 or 1, t he bet t er t he dat a
f i t t i ng.

The f ol l owi ng f unct i on, pol yf i t , t akes as i nput t he vect or s x and y and t he pol ynomi al or der p
and r et ur ns t he coef f i ci ent s of t he pol ynomi al f i t t i ng (vect or b), t he sum of squar e er r or s (SSE),
and t he cor r el at i on coef f i ci ent (r ):

function [SSE,r,b] = polyfit(xx,yy,p)
//Calculates the polynomial fitting
//y^ = b(1) + b(2)*x + b(3)*x^2 + ... + b(p)*x^p
//given data sets xx, yy, and the polynomial
//degree p.
//Vectors xx and yy are row vectors.
[n m] = size(xx');
getf('vandermonde');
V = vandermonde(xx); //Get Vandermonde matrix for xx
//Get matrix X for solution
if p == n-1 then
X = V;

237 2001 - Gi l ber t o E. Ur r oz
Al l r i ght r eser ved
elseif p<n-1 then
X = V(1:n,1:p+1);
else
X = V;
for k = n+1:p+1
X = [X xx'^k]
end
end;
//Calculating coefficients b, SSE, and r
b=inv(X'*X)*X'*yy';
yfit = X*b;
err = yy'-yfit;
SSE = err'*err;
ybar = sum(yy)/n;
ybarv = ybar*ones(n,1);
SST = sum((yy'-ybarv)^2);
r = sqrt(1-SSE/SST);
//end function

As an exampl e, use t he f ol l owi ng dat a t o obt ai n a pol ynomi al f i t t i ng wi t h p = 2, 3, 4, 5, 6.

x y
2. 30 179. 72
3. 20 562. 30
4. 50 1969. 11
1. 65 65. 87
9. 32 31220. 89
1. 18 32. 81
6. 24 6731. 48
3. 45 737. 41
9. 89 39248. 46
1. 22 33. 45
Fi r st , we ent er :

--> x =[2.30,3.20,4.50,1.65,9.32,1.18,6.24,3.45,9.89,1.22];
-->
y=[179.72,562.30,1969.11,65.87,31220.89,32.81,6731.48,737.41,39248.46,33.45];

To f i t t he dat a t o pol ynomi al s of or der p = 2, 3, 4, 5, 6, 7, and 8 we use t he f ol l owi ng cal l s t o
f unct i on pol yf i t .

-->getf('polyfit')
-->[SSE,r,b] = polyfit(x,y,2)
b =
! 4527.7303 !
! - 3958.5178 !
! 742.23219 !
r =
.9971908
SSE =

238 2001 - Gi l ber t o E. Ur r oz
Al l r i ght r eser ved
10731140.
-->[SSE,r,b] = polyfit(x,y,3)
b =
! - 998.0541 !
! 1303.2053 !
! - 505.27432 !
! 79.229744 !
r =
.9999768
SSE =
88619.368
-->[SSE,r,b] = polyfit(x,y,4)
b =
! 20.917344 !
! - 2.6108313 !
! - 1.5247295 !
! 6.0491773 !
! 3.5068553 !
r =
1.
SSE =
7.4827578
-->[SSE,r,b] = polyfit(x,y,5)
b =
! 19.083718 !
! .1745033 !
! - 2.9383508 !
! 6.3611564 !
! 3.475986 !
! .0011220 !
r =
1.
SSE =
7.4140764
-->[SSE,r,b] = polyfit(x,y,6)
b =
! - 16.807588 !
! 67.398517 !
! - 48.814654 !
! 21.163051 !
! 1.0603971 !
! .1930681 !
! - .0058903 !
r =

239 2001 - Gi l ber t o E. Ur r oz
Al l r i ght r eser ved
1.
SSE =
3.8884213
-->[SSE,r,b] = polyfit(x,y,7)
warning
matrix is close to singular or badly scaled.
results may be inaccurate. rcond = 1.1558E-19
b =
! 117.79067 !
! - 237.32895 !
! 218.31856 !
! - 96.918027 !
! 29.689084 !
! - 3.6422545 !
! .25902 !
! - .0073389 !
r =
1.
SSE =
1.2829472
-->[SSE,r,b] = polyfit(x,y,8)
warning
matrix is close to singular or badly scaled.
results may be inaccurate. rcond = 1.7245E-23
b =
! 68.081558 !
! - 100.44092 !
! 65.29768 !
! - 6.3024667 !
! - 1.3844292 !
! 2.6919754 !
! - .4920537 !
! .0401628 !
! - .0012344 !
r =
.9999909
SSE =
34695.662


Sel ect i ng t he best f i t t i ng

The f ol l owi ng t abl e summar i zes t he val ues of r and SSE f ound f or t he di f f er ent pol ynomi al
or der s:


240 2001 - Gi l ber t o E. Ur r oz
Al l r i ght r eser ved
p r SSE
2 0. 9971908 10731140
3 0. 9999768 88619. 37
4 1 7. 482758
5 1 7. 414076
6 1 3. 888421
7 1
1. 282947
8
0. 9999909 34695. 66

Whi l e t he cor r el at i on coef f i ci ent i s ver y cl ose t o 1. 0 f or al l val ues of p, t he val ues of SSE var y
wi del y. The smal l est val ue of SSE cor r esponds t o p = 7. However , a war ni ng i s r epor t ed f or
val ues of p = 7 and 8, i ndi cat i ng t hat t he r esul t s may be i naccur at e. Thus, we el i mi nat e f r om
t he anal ysi s val ues f or p = 7 and 8.

Di scar di ng t hose val ues, t he best f i t t i ng i n t er ms of t he mi ni mum val ue of SSE i s p = 6,
however , t her e i s ver y l i t t l e di f f er ence i n t he val ues of SSE f or val ues of p = 4, 5, or 6 (at l east
when compar ed t o t hose val ues f or p = 2, 3, or 8). Thus, any of t he pol ynomi al degr ees p = 4,
5, or 6, wi l l pr oduce a good f i t t i ng of t he or i gi nal dat a.

To vi sual i ze t he or i gi nal dat a and t he f i t t ed dat a, we can use t he f ol l owi ng f unct i on pl ot pol y,
whi ch cal l s on f unct i on pol yf i t . Funct i on pl ot pol y r equi r es t he user t o pr ovi de t he (r ow)
vect or s x and y, as wel l as t he pol ynomi al degr ee p. Dur i ng execut i on, pl ot pol y r equest s f r om
t he user t he number of t he gr aphi cs wi ndow wher e t he pl ot wi l l be pr oduced. The f unct i on
r et ur ns t he pl ot of t he or i gi nal dat a poi nt s and t he pol ynomi al f i t t i ng. A l i st i ng of t he f unct i on
f ol l ows:
function plotpoly(xx,yy,p)
//Plots original data and polynomial fitting
//for degree p
[m n] = size(xx);
xmin = min(xx); xmax = max(xx);
xs = [xmin:(xmax-xmin)/100:xmax];
[mm nn] = size(xs);
getf('polyfit');
[SSE,r,b] = polyfit(xx,yy,p);
XX = ones(1,nn);
for j = 1:p
XX = [XX;xs^j];
end;
yfit = b'*XX;
ymin = min(yfit); ymax = max(yfit);
nwindow = input('Enter the graphic window number:');
xset('window',nwindow);
xset('mark',-9,3);
//plot2d(xs,yfit);
//plot2d(xx,yy,-9);

241 2001 - Gi l ber t o E. Ur r oz
Al l r i ght r eser ved
plot2d(xx',yy',-9,'010','x',[xmin ymin xmax ymax])
plot2d(xs',yfit',1,'011','x',[xmin ymin xmax ymax])
//end function

Cal l i ng t he f unct i on f or p = 5, f or exampl e, pr oduces t he f ol l owi ng:
-->getf('plotpoly')
-->plotpoly(x,y,5)
Enter the graphic window number:
--> 2



Exer ci ses

[ 1] . Usi ng SCILAB r and f unct i on t o gener at e a mat r i x A
2x2
(-->A = rand(2,2))and a mat r i x B
2x2
(-->B = rand(2,2)). Then, cal cul at e t he f ol l owi ng:

(a)A
T
(b)A
- 1
(c)B
T
(d)B
- 1
(e)A+B (f )A-B
(g) 2A (h) -5B (i ) 2A-5B (j ) A
T
- B
T
(k) 3A
- 1
+5B
T
(l ) A B
(m)BA (n)A
- 1
A (o)A
- 1
A
T
(p) B
- 1
A (q)A
- 1
B
T
(r ) ABB
T

(s) B
T
B (t ) B
T
B+ A
- 1
A
T
(u) A
- 1
A
T
B
T
(v) nor m(A, 2) (w)det (A) (x)t r ace(A)
(y) r ank(B) (z) cond(A)

[ 2] . Usi ng SCILAB r and f unct i on gener at e a mat r i x A
3x3
and a mat r i x B
3x3
. Then, cal cul at e t he
f ol l owi ng:

(a)A
T
(b)A
- 1
(c)B
T
(d)B
- 1
(e)A+B (f )A-B
(g) 2A (h) -5B (i ) 2A-5B (j ) A
T
- B
T
(k) 3A
- 1
+5B
T
(l ) A B
(m)BA (n)A
- 1
A (o)A
- 1
A
T
(p) B
- 1
A (q)A
- 1
B
T
(r ) ABB
T

(s) B
T
B (t ) B
T
B+ A
- 1
A
T
(u) A
- 1
A
T
B
T
(v) nor m(A, 2) (w)det (A) (x)t r ace(A)
(y) r ank(B) (z) cond(A)

242 2001 - Gi l ber t o E. Ur r oz
Al l r i ght r eser ved

[ 3] . Usi ng SCILAB r and f unct i on gener at e a mat r i x A
3x2
and a mat r i x B
3x2
. Then, i f possi bl e,
cal cul at e t he f ol l owi ng:

(a)A
T
(b)A
- 1
(c)B
T
(d)B
- 1
(e)A+B (f )A-B
(g) 2A (h) -5B (i ) 2A-5B (j ) A
T
- B
T
(k) 3A
- 1
+5B
T
(l ) A B
(m)BA (n)A
- 1
A (o)A
- 1
A
T
(p) B
- 1
A (q)A
- 1
B
T
(r ) ABB
T

(s) B
T
B (t ) B
T
B+ A
- 1
A
T
(u) A
- 1
A
T
B
T
(v) nor m(A, 2) (w)nor m(A, ) (x)r ank(A)

[ 4] . Usi ng SCILAB r and f unct i on gener at e a mat r i x A
3x2
and a mat r i x B
2x3
. Then, i f possi bl e,
cal cul at e t he f ol l owi ng:

(a)A
T
(b)A
- 1
(c)B
T
(d)B
- 1
(e)A+B (f )A-B
(g) 2A (h) -5B (i ) 2A-5B (j ) A
T
- B
T
(k) 3A
- 1
+5B
T
(l ) A B
(m)BA (n)A
- 1
A (o)A
- 1
A
T
(p) B
- 1
A (q)A
- 1
B
T
(r ) ABB
T

(s) B
T
B (t ) B
T
B+ A
- 1
A
T
(u) A
- 1
A
T
B
T
(v) nor m(A, 2) (w)nor m(A, ) (x)r ank(A)

[ 5] . Usi ng SCILAB r and f unct i on gener at e mat r i ces A
2x2
, and B
3x3
. Then, obt ai n symmet r i c
mat r i ces A and B , and ant i -symmet r i c mat r i ces A and B such t hat A = A +A , and B = B +B .
Ver i f y t he r esul t s.

[ 6] . Gener at e t he Vander monde mat r i x, V, cor r espondi ng t o t he f ol l owi ng vect or s:
(a) [ 2, 3, -1] (b) [ 5, 5, -2, 4] (c) [ 1, 1, 2, 3, 9] (d) [ 1, 2, 3, 4, 5, 6]

[ 7] . For t he mat r i ces gener at ed i n [ 6] det er mi ne:
(a) det er mi nant (b) r ank (c) condi t i on number (e)i nver se

[ 8] . Gener at e t he Hi l ber t mat r i x, H, of di mensi ons (a) 22, (b)33, (c) 44, and (d)55.

[ 9] . For t he mat r i ces gener at ed i n [ 6] det er mi ne:
(a) det er mi nant (b) r ank (c) condi t i on number (e)i nver se

[ 10] . Consi der t he syst em of l i near equat i ons gi ven by:


(a) Sol ve t he syst em of l i near equat i ons usi ng Cr amer s r ul e
(b) sol ve t he syst em of l i near equat i ons usi ng mat r i ces and t he f unct i on l i nsol ve
(c) sol ve t he syst em of l i near equat i ons usi ng x = A
- 1
b
(d) sol ve t he syst em of l i near equat i ons usi ng Gaussi an el i mi nat i on and back subst i t ut i on
(e) sol ve t he syst em of l i near equat i ons usi ng Gauss-Jor dan el i mi nat i on
(f ) sol ve t he syst em of l i near equat i ons usi ng l ef t di vi si on, i . e. , x = A\ b



=

(
(
(
(
(
(
(
(
+ X 2 Y Z
+ 2 X 2 Y Z 3 W
+ + + 2 X 5 Y Z W
+ + X 2 Z 2 W

(
(
(
(
(
(
(
(
3
-1
9
1

243 2001 - Gi l ber t o E. Ur r oz
Al l r i ght r eser ved
[ 11] . Consi der t he syst em of l i near equat i ons:

2x+4y=2
x+y =2
2x+3y = 2

(a) Sket ch t he l i nes r epr esent ed by t he equat i ons i n t he x-y pl ane wi t h -5<x<5, -5<y<5. Is
t her e a uni que sol ut i on f or t he syst em?
( b) Obt ai n a sol ut i on t o t he syst em by usi ng SCILAB f unct i on l east sq. Sket ch t he sol ut i on
poi nt t oget her wi t h t he l i nes.
(c) Det er mi ne t he er r or i nvol ved i n t hi s sol ut i on .

[ 12] . Consi der t he syst em of l i near equat i ons:

5x - 2y + 3z = 10
x - 3y + 4z = 20

(a) Obt ai n a sol ut i on t o t he syst em usi ng t he f unct i on l i nsol ve
(b) Obt ai n a sol ut i on t o t he syst em usi ng t he f unct i on l east sq
(c) What i s t he r ank of t he mat r i x of coef f i ci ent s f or t hi s l i near syst em

[ 13] . Consi der t he f ol l owi ng syst ems of l i near equat i ons:

X +2Y+3Z = 28, 2X +4Y+6Z = 18, 2X +4Y+6Z = -4,
3X -2Y+ Z = 4, 3X -2Y+ Z = -10, 3X -2Y+ Z = 4,
4X +2Y -Z = 10, 4X +2Y -Z = 38, 4X +2Y -Z = 24.

(a) Sol ve t he mul t i pl e l i near syst em by usi ng mat r i ces and t he f unct i on l i nsol ve
(b) Sol ve t he mul t i pl e l i near syst em by usi ng an augment ed mat r i x and Gauss-Jor dan
el i mi nat i on
(c) Sol ve t he mul t i pl e l i near syst em by usi ng t he i nver se mat r i x of coef f i ci ent s
(d) Obt ai n t he i nver se of t he mat r i x of coef f i ci ent s by usi ng t he appr opr i at e augment ed
mat r i x and Gauss-Jor dan el i mi nat i on. Ver i f y t hi s sol ut i on by usi ng t he f unct i on i nv


[ 14] . Gi ven t he mat r i x


cor r espondi ng t o t he ei genval ue pr obl em: Ax = x,

(a) Obt ai n t he char act er i st i c mat r i x f or t he ei genval ue pr obl em
(b) Obt ai n t he char act er i st i c pol ynomi al cor r espondi ng t o mat r i x A
(c) Pl ot t he char act er i st i c pol ynomi al i n t he r ange -6 < < 10
(d) Sol ve t he char act er i st i c pol ynomi al t o obt ai n t he ei genval ues, , of mat r i x A
:= A

(
(
(
(
(
(
(
(
-1 0 5 4
0 3 -2 2
5 -2 4 1
4 2 1 3

244 2001 - Gi l ber t o E. Ur r oz
Al l r i ght r eser ved
(e) Obt ai n t he ei genval ue, , of mat r i x A usi ng t he f unct i on spec
( f ) Obt ai n t he ei genvect or s, x, of mat r i x A usi ng t he user -def i ned f unct i on ei genvect or s


[ 15] . Gi ven t he mat r i ces








cor r espondi ng t o t he gener al i zed ei genval ue pr obl em Ax = Bx,

(a) Obt ai n t he char act er i st i c mat r i x f or t he ei genval ue pr obl em
(b) Obt ai n t he char act er i st i c pol ynomi al cor r espondi ng t o mat r i x A
(g) Pl ot t he char act er i st i c pol ynomi al i n t he r ange -6 < < 10
(h) Sol ve t he char act er i st i c pol ynomi al t o obt ai n t he ei genval ues, , of mat r i x A
(i ) Obt ai n t he gener al i zed ei genval ues, , of mat r i x A usi ng t he f unct i on gei genvect or s
( j ) Obt ai n t he ei genvect or s, x, of mat r i x A usi ng t he f unct i on gei genvect or s


[ 16] . Det er mi ne t he mat r i ces L, U, and P cor r espondi ng t o t he LU decomposi t i on of
(a) mat r i x A i n pr obl em [ 14]
(b) mat r i x A i n pr obl em [ 15]
(c) mat r i x B i n pr obl em [ 15] .


[ 17] . Det er mi ne t he mat r i ces Q and R cor r espondi ng t o t he QR decomposi t i on of
(a) mat r i x A i n pr obl em [ 14]
(b) mat r i x A i n pr obl em [ 15]
(c) mat r i x B i n pr obl em [ 15] .


[ 18] . Det er mi ne t he mat r i ces U and V of l ef t and r i ght vect or s and t he vect or of si ngul ar
val ues s cor r espondi ng t o
(a) mat r i x A i n pr obl em [ 14]
(b) mat r i x A i n pr obl em [ 15]
(c) mat r i x B i n pr obl em [ 15] .



[ 19] . Expand t he quadr at i c f or m f ( x)= x
T
Ax f or x = [ X, Y, Z]
T
, wher e mat r i x A r epr esent s
(a) mat r i x A i n pr obl em [ 14]
(b) mat r i x A i n pr obl em [ 15]
(c) mat r i x B i n pr obl em [ 15] .

:= A

(
(
(
(
(
-1 3 5
3 4 2
5 2 3
:= B

(
(
(
(
(
2 -3 2
-3 4 2
2 2 10

245 2001 - Gi l ber t o E. Ur r oz
Al l r i ght r eser ved
[ 20] . For t he el ect r i c ci r cui t shown bel ow

Det er mi ne t he el ect r i cal cur r ent s I
1
, I
2
, I
3
, and I
4
, associ at ed wi t h t he ci r cul at i on l oops shown i n
t he f i gur e, i f
(a) R
1
= R
3
= R
5
= R
7
= R
9
= 1. 5 k, R
2
= R
4
= R
6
= R
8
= 800 , V
1
= 12 V, V
2
= 24 V, V
3
= 6 V
(b) R
1
= R
3
= R
5
= R
7
= R
9
= R
2
= R
4
= R
6
= R
8
= 1. 2 k, V
1
= 12 V, V
2
= V
3
= 6 V
(c) R
1
= R
3
= R
5
= R
7
= R
9
= 2. 2 k, R
2
= R
4
= R
6
= R
8
= 1. 2 k, V
1
= V
2
= V
3
= 18 V
(d) R
1
= R
3
= R
5
= R
7
= R
9
= 0. 5 k, R
2
= R
4
= R
6
= R
8
= 0. 8 k, V
1
= 6 V, V
2
= 12 V, V
3
= 6 V


[ 21] . The t r uss shown i n t he f i gur e bel ow i s such t hat al l hor i zont al and ver t i cal bar s ar e of
l engt h 1. 0 m, di agonal bar s of l engt h 1. 4142 m, and al l acut e angl es i n t he t r uss ar e 45
o
.


Det er mi ne t he axi al f or ces i n t he t r uss el ement s i f

(a) P
1
= 100 kN, P
2
= 200 kN, P
3
= 200 kN, P
4
= 100 kN.
(b) P
1
= P
2
= P
3
= P
4
= 200 kN.
(c) P
1
= 50 kN, P
2
= 150 kN, P
3
= 50 kN, P
4
= 150 kN.
(d) P
1
= 50 kN, P
2
= 150 kN, P
3
= 200 kN, P
4
= 250 kN.

To det er mi ne t he r eact i ons use t he equat i ons of moment s t aken about t he poi nt s of appl i cat i on
of R
1
and R
2
, r espect i vel y:


246 2001 - Gi l ber t o E. Ur r oz
Al l r i ght r eser ved
- 3R
2

+ 1(P
1
+ P
3
) + 2 (P
2
+ P
4
) = 0
3R
1
- 1 (P
2
+ P
4
) - 2 (P
1
+ P
3
) = 0


[ 22] . Obt ai n di mensi onl ess number s t o descr i be a f l ui d mechani cs exper i ment t hat i nvol ves t he
f ol l owi ng var i abl es:

H = a char act er i st i c wat er dept h(L)
Q = a f l ow r at e (LT
- 3
)
= dynami c vi scosi t y of a f l ui d (ML
- 1
T
- 1
)
= speci f i c wei ght of a f l ui d (ML
- 2
T
- 2
)
P
0
= a char act er i st i c pr essur e i n t he f l ow (ML
- 1
T
- 2
)
g = accel er at i on of gr avi t y (LT
- 2
)

Let , H, Q and , be t he r epeat i ng var i abl es i n t he di mensi onl ess number s.


[ 23] . The st at e of st r ess at a poi nt wi t hi n a sol i d i n equi l i br i um i s gi ven by t he st r ess t ensor


wher e t he component s of T r epr esent st r esses i n kPa. For a pl ane passi ng t hr ough t he poi nt of
i nt er est wi t h a nor mal vect or gi ven by n = [ 5, -5, 2] , det er mi ne:

(a) t he t ot al st r ess on t he pl ane
(b) t he nor mal st r ess on t he pl ane
(c) t he shear st r ess on t he pl ane
(d) t he t ot al , nor mal , and shear f or ces on t he pl ane i f t he ar ea of t he pl ane i s 0. 0005 m
2
.


[ 24] . For t he st r ess t ensor gi ven i n pr obl em [ 23] det er mi ne:

(a) t he pr i nci pal st r esses
( b) t he vect or s cor r espondi ng t o t he pr i nci pal axes


[ 25] . The t abl e bel ow shows sedi ment l oad dat a (y, i n kg/ mi n) obt ai ned i n a l abor at or y f l ume
under cont r ol l ed condi t i ons. The sedi ment l oad, y, i s known t o be a f unct i on of t he wat er
di schar ge, x
1
(l t / sec), of t he mean sedi ment di amet er , x
2
(cm), and of t he f l ume sl ope, x
3
(10
- 3

m/ m). Usi ng mat r i ces det er mi ne a mul t i pl e l i near f i t t i ng of t he f or m


y = b
0
+ b
1
x
1
+ b
2
x
2
+ b
3
x
3



f or t he dat a pr ovi ded i n t he t abl e.

:= T

(
(
(
(
(
12 -22 40
-22 -10 5
40 5 15

247 2001 - Gi l ber t o E. Ur r oz
Al l r i ght r eser ved
x
1
x
2
x
3
y
1.20 0.50 3.5 27.35
1.40 0.75 4.5 29.86
1.60 1.00 5.5 35.15
1.80 1.50 3.5 33.45
2.00 2.00 4.5 38.98
2.20 2.50 5.5 43.35
2.40 0.50 3.5 30.72
2.60 0.75 4.5 34.13
2.80 1.00 5.5 38.45
3.00 1.50 3.5 37.12
3.20 2.00 4.5 42.83
3.40 2.50 5.5 47.12


[ 26] . The t abl e bel ow shows t he wat er di schar ge, y(10
3
cubi c f eet per second) , measur ed at a
gage st at i on i n a l ar ge r i ver as a f unct i on of t i me, x(days), dur i ng a 40-day per i od i n t he ear l y
spr i ng season. A pl ot of y vs. x i s known as a hydr ogr aph.


x y
1.5 101.42
5.0 176.73
8.5 311.22
12.0 389.61
15.5 546.24
19.0 638.14
22.5 716.99
26.0 743.60
29.5 737.96
33.0 623.16
36.5 492.53
40.0 15.84

(a) Det er mi ne a pol ynomi al f i t t i ng f or t hi s hydr ogr aph wi t h p = 2, 3, 4, 5, and 6, wher e t he
pol ynomi al f i t t i ng i s of t he f or m

y = b
0
+ b
1
x + b
2
x
2
+ + b
p
x
p


(b) Sel ect t he best pol ynomi al f i t t i ng f or t he hydr ogr aph based on t he val ues of t he
cor r el at i on coef f i ci ent and of t he sum of squar ed er r or s, SSE.
(c) Pl ot t he or i gi nal hydr ogr aph dat a and t he f i t t ed pol ynomi al i n t he same set of axes.
(d) The ar ea under t he cur ve f or 0 < x < 40 days, r epr esent s t he t ot al vol ume of wat er
passi ng t hr ough t he mout h of t he r i ver i n t hat per i od. Usi ng t he f i t t ed pol ynomi al and
t he f unct i on i nt (i nt egr al ) est i mat e t he vol ume of wat er passi ng t hr ough t he gage
st at i on i n t he 40-day per i od of i nt er est .
.h
i1
:t.{ -\" 2. \ -+ 1'l.
b\2.. -1
11
6
1g
.b'L4 b'l.'L hy
10'2. 2 k t-2
I h
1
'2- b';3
.
l - 't'Z. kJ 33
) X1 -t :('2, -= bi2
r1 -{ ] J r1( '2. 1
(- =7 L1 - 1 LXt L b1.\ J Co
l 'X. l -?( 'l.. = bZ
1
J1 Jc tj 1.. :::- b13
?:> C -11] l 1 [t ]
1 -'(fl- -= bgi
.5 :t 1 t 'Z. ==
} = [t::]
l 1 - C'Z. ;::::. b.12
M X'j.
-:::::

You might also like