Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
CHAPTER 8
8.1
>> Aug = [A eye(size(A))]
0.4860
0.8913
0.7621
0.4565
0.0185
0.8214
8.2
0.4860
0.8913
0.7621
(a) [A]: 3 2
[E]: 3 3
0.4565
0.0185
0.8214
[B]: 3 3
[F]: 2 3
1.0000
0
0
0
1.0000
0
{C}: 3 1
G: 1 3
0
0
1.0000
[D]: 2 4
8 13
3 9
0 10
2 1
1 3
0 2
(5) [C ]T 2 6 1
53 23 75
(7) [ B][ E ] 39 7 48
18 10 36
(9) [G][C] = 56
66 12 51
(11) E [ E ] 12 26 33
51 33 81
T
7
4
(10) I [ B ] 1
2
2
1
7
5
3 7
2 6
0 4
(12) C T [C ] 41
PROPRIETARY MATERIAL. The McGraw-Hill Companies, Inc. All rights reserved. No part of this Manual
may be displayed, reproduced or distributed in any form or by any means, without the prior written permission of the
publisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their
individual course preparation. If you are a student using this Manual, you are using it without permission.
2
4 3 7 x3 50
-4
3
-7
>> AI = inv(A)
AI =
-0.1683
-0.1298
-0.1346
0.0962
0.0385
0.1154
-0.2500
0
0
(b) [B][A] and [C][A] are impossible because the inner dimensions do not match:
(22) * (32)
(c) According to (a), [B][C] [C][B]
PROPRIETARY MATERIAL. The McGraw-Hill Companies, Inc. All rights reserved. No part of this Manual
may be displayed, reproduced or distributed in any form or by any means, without the prior written permission of the
publisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their
individual course preparation. If you are a student using this Manual, you are using it without permission.
8.5
>> A=[3+2*i 4;-i 1]
>> b=[2+i;3]
>> z=A\b
z =
-0.5333 + 1.4000i
1.6000 - 0.5333i
8.6
function X=mmult(Y,Z)
% mmult: matrix multiplication
%
X=mmult(Y,Z)
%
multiplies two matrices
% input:
%
Y = first matrix
%
Z = second matrix
% output:
%
X = product
if nargin<2,error('at least 2 input arguments required'),end
[m,n]=size(Y);[n2,p]=size(Z);
if n~=n2,error('Inner matrix dimensions must agree.'),end
for i=1:m
for j=1:p
s=0.;
for k=1:n
s=s+Y(i,k)*Z(k,j);
end
X(i,j)=s;
end
end
8.7
function AT=matran(A)
% matran: matrix transpose
%
AT=mtran(A)
%
generates the transpose of a matrix
% input:
%
A = original matrix
% output:
%
AT = transpose
[m,n]=size(A);
for i = 1:m
for j = 1:n
AT(j,i) = A(i,j);
end
end
-5
3
>> matran(B)
4.0000
0
0.6000
8.0000
>> matran(C)
ans =
1
-6
-2
1
8.8
function B = permut(A,r1,r2)
% permut: Switch rows of matrix A with a permutation matrix
% B = permut(A,r1,r2)
% input:
% A = original matrix
% r1, r2 = rows to be switched
% output:
% B = matrix with rows switched
[m,n] = size(A);
if m ~= n, error('matrix not square'), end
if r1 == r2 | r1>m | r2>m
error('row numbers are equal or exceed matrix dimensions')
end
P = zeros(n);
P(r1,r2)=1;P(r2,r1)=1;
for i = 1:m
if i~=r1 & i~=r2
P(i,i)=1;
end
PROPRIETARY MATERIAL. The McGraw-Hill Companies, Inc. All rights reserved. No part of this Manual
may be displayed, reproduced or distributed in any form or by any means, without the prior written permission of the
publisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their
individual course preparation. If you are a student using this Manual, you are using it without permission.
end
B=P*A;
Test script:
clc
A=[1 2 3 4;5 6 7 8;9 10 11 12;13 14 15 16]
B = permut(A,3,1)
B = permut(A,3,5)
A =
1
5
9
13
2
6
10
14
3
7
11
15
4
8
12
16
9
5
1
13
10
6
2
14
11
7
3
15
12
8
4
16
B =
Q31c3
Q01c01
0
Q25 c2
Q34 c3 Q44 c4
Q03 c03
Q54 c5 0
(Q54 Q55 )c5 0
The parameters can be substituted and the result written in matrix form as
0 3
9
4 4 0
0 2 9
0 1 6
5 1 0
0
0
0
9
0
0 c1 120
0 c2 0
0 c3 350
2 c4 0
6 c5 0
The following MATLAB script can then be used to solve for the concentrations
clc
Q = [9 0 -3 0 0;
-4 4 0 0 0;
0 -2 9 0 0;
0 -1 -6 9 -2;
-5 -1 0 0 6];
Qc = [120;0;350;0;0];
c = Q\Qc
c =
PROPRIETARY MATERIAL. The McGraw-Hill Companies, Inc. All rights reserved. No part of this Manual
may be displayed, reproduced or distributed in any form or by any means, without the prior written permission of the
publisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their
individual course preparation. If you are a student using this Manual, you are using it without permission.
28.4000
28.4000
45.2000
39.6000
28.4000
0.5
0 0.866025 0 0 0 F2 2000
0.866025 1
0
1 0 0 F3 0
0
0
0 1 0 H 2 0
0.5
0
1
0.5
0 0 0 V2 0
0
0 0.866025 0 0 1 V3 0
MATLAB can then be used to solve for the forces and reactions,
clc; format short g
A = [0.866025 0 -0.5 0 0 0;
0.5 0 0.866025 0 0 0;
-0.866025 -1 0 -1 0 0;
-0.5 0 0 0 -1 0;
0 1 0.5 0 0 0;
0 0 -0.866025 0 0 -1];
b = [0 -2000 0 0 0 0]';
F = A\b
F =
-1000
866.03
-1732.1
0
500
1500
Therefore,
F1 = 1000
F2 = 866.025
F3 = 1732.1
H2 = 0 V2 = 500
V3 = 1500
8.11
clc; format short g
k1=10;k2=40;k3=40;k4=10;
m1=1;m2=1;m3=1;
km=[(1/m1)*(k2+k1),-(k2/m1),0
-(k2/m2),(1/m2)*(k2+k3),-(k3/m2)
0,-(k3/m3),(1/m3)*(k3+k4)]
x=[0.05;0.04;0.03];
kmx=-km*x
km =
50
-40
0
kmx =
-40
80
-40
0
-40
50
-0.9
-2.2204e-016
0.1
PROPRIETARY MATERIAL. The McGraw-Hill Companies, Inc. All rights reserved. No part of this Manual
may be displayed, reproduced or distributed in any form or by any means, without the prior written permission of the
publisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their
individual course preparation. If you are a student using this Manual, you are using it without permission.
Collecting terms,
k1 k2
k
2
k2
k 2 k3
k3
k3
k3 k 4
k4
k4
k 4 k5
k5
x1 m1 g
x m g
2 2
x3 m3 g
k5 x4 m4 g
k5 x5 m5 g
x3 588.60
70 170 100
20 20 x5 882.90
The solution can then be obtained with the following MATLAB script:
clc; format short g
g=9.81;
m1=65;m2=75;m3=60;m4=75;m5=90;
k1=80;k2=40;k3=70;k4=100;k5=20;
A=[k1+k2 -k2 0 0 0
-k2 k2+k3 -k3 0 0
0 -k3 k3+k4 -k4 0
0 0 -k4 k4+k5 -k5
0 0 0 -k5 k5]
b=[m1*g m2*g m3*g m4*g m5*g]'
x=A\b
A =
120
-40
0
0
0
b =
-40
110
-70
0
0
0
-70
170
-100
0
0
0
-100
120
-20
0
0
0
-20
20
637.65
735.75
588.6
PROPRIETARY MATERIAL. The McGraw-Hill Companies, Inc. All rights reserved. No part of this Manual
may be displayed, reproduced or distributed in any form or by any means, without the prior written permission of the
publisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their
individual course preparation. If you are a student using this Manual, you are using it without permission.
735.75
882.9
x =
44.758
118.33
149.87
166.05
210.2
8.13 The position of the three masses can be modeled by the following steady-state force balances
0 k ( x2 x1 ) m1 g kx1
0 k ( x3 x2 ) m2 g k ( x2 x1 )
0 m3 g k ( x3 x2 )
m1 g
0 15 15 x3 29.43
A MATLAB script can be used to obtain the solution for the displacements
clc; format short g
g=9.81;k=15;
K=[2*k -k 0;-k 2*k -k;0 -k k]
m=[2;2.5;3];
mg=m*g
x=K\mg
K =
30
-15
0
mg =
-15
30
-15
0
-15
15
19.62
24.525
29.43
x =
4.905
8.502
10.464
8.14 Just as in Sec. 8.3, the simultaneous equations can be expressed in matrix form as
PROPRIETARY MATERIAL. The McGraw-Hill Companies, Inc. All rights reserved. No part of this Manual
may be displayed, reproduced or distributed in any form or by any means, without the prior written permission of the
publisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their
individual course preparation. If you are a student using this Manual, you are using it without permission.
1
0
0
0
R12
1
1
0
0
R52
R52
1
0
1
0
R32
0
0
1
0
0
0
R65
0
1
0
1
R54
0
0 i12 0
0 i52 0
1 i32 0
1 i65 0
R43 i54 0
0 i43 V1 V6
0 0
0
0
1 i32 0
1
0
0
1
1 i65 0
0 0
0 10 10 0 15 5 i54 0
0 i43 200
5 10 0 20 0
1
-1
0
0
10
-10
1
0
-1
0
-10
0
0
1
0
0
0
-20
0
-1
0
1
-15
0
0
0
1
-1
-5
0
B =
0
0
0
0
0
200
I =
6.1538
-4.6154
-1.5385
-6.1538
-1.5385
-1.5385
i21 = 6.1538
i52 = 4.6154
i32 = 1.5385
i65 =
i54 = 1.5385
i43 = 1.5385
PROPRIETARY MATERIAL. The McGraw-Hill Companies, Inc. All rights reserved. No part of this Manual
may be displayed, reproduced or distributed in any form or by any means, without the prior written permission of the
publisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their
individual course preparation. If you are a student using this Manual, you are using it without permission.
10
6.1538
4.6154
1.5385
1.5385
6.1538
6.1538
1.5385
200
i 21 i 23 i52 0
i 23 i35 i 43 0
i 43 i54 0
i35 i52 i65 i54 0
Voltage equations:
V2 20
35
V2 V3
i23
30
V4 V3
i43
8
140 V5
i65
5
i21
V5 V4
15
V3 V5
i35
7
V5 V2
i52
10
i54
1 1 1 0 0 0
0 1 0 1 1 0
0 0 0 0 1 1
0 0 1 1 0 1
35 0 0 0 0 0
0 30 0 0 0 0
0 0 0 0 8 0
0 0 0 0 0 15
0 0 0 7 0 0
0 0 10 0 0 0
0 0 0 0 0 0
0
0
0
1
0
0
0
0
0
0
5
0 i21 0
0 0 0 0 i23 0
0 0 0 0 i52 0
0 0 0 0 i35 0
1 0 0 0 i43 20
1 1 0 0 i54 0
0 1 1 0 i65 0
0 0 1 1 V2 0
0 1 0 1 V3 0
1 0 0 1 V4 0
0 0 0 1 V5 140
0
11
0
0
0
0
-1 1
0
0
0
-1 1
0
-1 1
R12 0
0
0
0
0
0
0
R32 0
0
0
0
0
0
0
0
0
R34 0
0
0
0
0
0
0
R45 0
0
0
0
R35 0
0
0
0
0
R25 0
0
0
0
0
0
0
0
0
0
R65
B=[0 0 0 0 -V1 0 0 0 0 0 V6]'
I=A\B
0
0
-1
-1
0
0
0
1
0
0
0
0
1
1
0
-1
0
0
0
0
0
0
-1
1
0
0
0
0;
0;
0;
0;
0;
-1;
1;
-1;
1]
I =
2.5107
-0.55342
1.9573
-0.42429
0.12913
0.12913
2.5107
107.87
124.48
125.51
127.45
i23 = 0.55342
i65 = 2.5107
i52 = 1.9573
V2 = 107.87
i35 = 0.42429
V3 = 124.48
i43 = 0.12913
V4 = 125.51
PROPRIETARY MATERIAL. The McGraw-Hill Companies, Inc. All rights reserved. No part of this Manual
may be displayed, reproduced or distributed in any form or by any means, without the prior written permission of the
publisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their
individual course preparation. If you are a student using this Manual, you are using it without permission.