SlideShare a Scribd company logo
Instructor’s Manual c
to accompany
Introduction to Matlab 6 for Engineers
by
William J. Palm III
University of Rhode Island
c Instructor’s Manual Copyright 2000 by McGraw-Hill Companies, Inc.
0-1
Solutions to Problems in Chapter One
Test Your Understanding Problems
T1.1-1 a) 6*10/13 + 18/(5*7) + 5*9^2. Answer is 410.1297.
b) 6*35^(1/4) + 14^0.35. Answer is 17.1123.
T1.3-1 The session is:
x = [[cos(0):0.02:log10(100)];
length(x)
ans =
51
x(25)
ans =
1.4800
T1.3-2 The session is:
roots([1, 6, -11, 290]
ans =
-10.000
2.0000 + 5.0000i
2.0000 - 5.0000i
poly(ans)
ans =
1.0000 6.0000 -11.0000 290.0000
which are the given coefficients. Thus the roots are −10 and 2 ± 5i.
T1.3-3 a) z = 0 0 1 1 1
b) z = 1 0 0 0 0
c) z = 1 0 1 1 1
d) z = 0 0 0 0 1
T1.3-4 The session is:
x = [-4, -1, 0, 2, 10];y = [-5, -2, 2, 5, 9];
x(x>y)
ans =
-4 -1 10
find(x>y)
ans =
1 2 5
1-1
T1.3-5 The session is:
t = [0:0.01:5];
s = 2*sin(3*t+2) + sqrt(5*t+1);
plot(t,s),xlabel( Time (sec) ),ylabel( Speed (ft/sec) )
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
0
1
2
3
4
5
6
7
Time t (sec)
Speeds(ft/sec)
Figure : for Problem T1.3-5
T1.3-6 The session is:
x = [0:0.01:1.55];
s = 4*sqrt(6*x+1);
z = polyval([4,6,-5,3],x);
plot(x,y,x,z, -- ),xlabel( Distance (meters) ),ylabel( Force (newtons)
T1.3-7 The session is:
A = [6, -4, 8; -5, -3, 7; 14, 9, -5];
b = [112; 75; -67];
x = Ab
1-2
0 0.5 1 1.5
0
5
10
15
20
25
Distance x (meters)
Force(newtons)
y
z
Figure : for Problem T1.3-6
x =
2.0000
-5.0000
10.0000
A*x
ans =
112 75 -67
Thus the solution is x = 2, y = −5, and z = 10.
T1.4-1 The session is:
a = 112; b = 75; c = -67;
A = [6, -4, 8; -5, -3, 7; 14, 9, -5];
bvector = [a; b; c];
x = Abvector
x =
2.0000
-5.0000
10.0000
1-3
A*x
ans =
112 75 -67
Thus the solution is x = 2, y = −5, and z = 10.
T1.4-2 The script file is:
x = -5;
if x < 0
y = sqrt(x^2+1)
elseif x < 10
y = 3*x+1
else
y = 9*sin(5*x-50)+31
end
For x = −5, y = 5.0990. Changing the first line to x = 5 gives y = 16. Changing the first
line to x = 15 gives y = 29.8088.
T1.4-3 The script file is
sum = 0;
for k = 1:20
sum = sum + 3*k^2;
end
sum
The answer is sum = 8610.
T1.4-4 The script file is
sum = 0;k = 0;
while sum <= 2000
k = k + 1;
sum = sum + 3*k^2;
end
k
sum
The answers are k = 13 and sum = 2457.
End-of-Chapter Problems
1. The session is:
1-4
x = 10; y = 3;
u = x + y
u =
13
v = x*y
v =
30
w = x/y
w =
3.3333
z = sin(x)
z =
-0.5440
r = 8*sin(y)
r =
1.1290
s = 5*sin(2*y)
s =
-1.3971
2. The session is:
y*x^3/(x-y)
ans =
-13.3333
3*x/(2*y)
ans =
0.6000
3*x*y/2
ans =
15
x^5/(x^5-1)
ans =
1.0323
3. The session is:
x = 3; y = 4;
1/(1-1/x^5)
ans =
1.0041
3*pi*x^2
1-5
ans =
84.8230
3*y/(4*x-8)
ans =
3
4*(y-5)/(3*x-6)
ans =
-1.3333
4. a) x = 2;y = 6*x^3 + 4/x. The answer is y = 50.
b) x = 8;y = (x/4)*3. The answer is y = 6.
c) x = 10;y = (4*x)^2/25. The answer is y = 64.
d) x = 2;y = 2*sin(x)/5. The answer is y = 0.3637.
e) x = 20;y = 7*x^(1/3) + 4*x^0.58. The answer is y = 41.7340.
5. The session is:
a = 1.12; b = 2.34; c = 0.72;d = 0.81;f = 19.83;
x = 1 + a/b + c/f^2
x =
1.4805
s = (b-a)/(d-c)
s =
13.556
r = 1/(1/a + 1/b + 1/c + 1/d)
r =
0.2536
y = a*b/c*f^2/2
y =
715.6766
6. The session is:
r = 5;
V = 4*pi*^3/4;
V = 1.3*V;
r = ((3*V)/(4*pi))^(1/3);
r =
4.9580
The required radius is 4.958.
1-6
7. The session is
x = -7-5i;y = 4+3i;
x+y
ans =
-3.0000 - 2.0000i
x*y
ans =
-13.0000 -41.0000i
x/y
ans =
-1.7200 + 0.0400i
8. The session is:
(3+6i)*(-7-9i)
ans =
33.0000 -69.0000i
(5+4i)/(5-4i)
ans =
0.2195 + 0.9756i
3i/2
ans =
0 + 1.5000i
3/2i
ans =
0 - 1.5000i
9. The session is:
x = 5+8i;y = -6+7i;
u = x + y;v = x*y;
w = x/y;z = exp(x)
r = sqrt(y);s = x*y^2;
The answers are u = −1+51i, v = −86−13i, w = 0.3059−0.9765i, z = −21.594+146.83i,
r = 1.2688 + 2.7586i, and s = 607 − 524i.
10. The session is:
n = 1;R = 0.08206;T = 273.2;V=22.41;
a = 6.49;b = 0.0562;
Pideal = n*R*T/V
1-7
Pideal =
1.0004
P1 = n*R*T/(V - nb)
P1 =
1.0029
P2 = (a*n^2)/V^2
P2 =
0.0129
Pwaals = P1 + P2
Pwaals =
1.0158
The ideal gas law predicts a pressure of 1.0004 atmospheres, while the van der Waals model
predicts 1.0158 atmospheres. Most of the difference is due to the P2 term, which models
the molecular attractions.
11. The ideal gas law gives
T
V
=
P
nR
= constant
Thus T1/V1 = T2/V2, or V2 = V1T2/T1. The session is:
V1 = 28500;T1 = 273.2 - 15;T2 = 273.2 + 31;
V2 = V1*T2/T1
V2 =
3.3577e+4
The volume is 3.3577 × 104 ft3.
12. The session is:
x=[1:.2:5];
y = 7*sin(4*x)
y =
Columns 1 through 7
-5.2976 -6.9732 -4.4189 0.8158 5.5557 6.9255 4.0944
Columns 8 through 14
-1.2203 -5.7948 -6.8542 -3.7560 1.6206 6.0141 6.7596
Columns 15 through 21
3.4048 -2.0153 -6.2130 -6.6419 -3.0420 2.4032 6.3906
y(3)
ans =
-4.4189
1-8
There are 21 elements. The third element is −4.4189.
13. The session is:
x = [sin(-pi/2):0.05:cos(0)];
length(x)
ans =
41
x(10)
ans =
0.5500
There are 41 elements. The tenth element is 0.55.
14. The session is:
p = ([13,182,-184,2503];
r = roots(p)
r =
-15.6850
0.8425 + 3.4008i
0.8425 - 3.4008i
polyval(p,r)
ans =
1.0e-012 *
0.1137 - 0.0001i
0 - 0.0002i
0
The roots are x = −15.685 and x = 0.8425 ± 3.4008i. When these roots are substituted
into the polynomial, we obtain values close to zero, as they should be.
15. The session is:
p = [36, 12, -5, 10];
roots(p)
ans =
-0.8651
0.2659 + 0.5004i
0.2659 - 0.5004i
The roots are −0.8651 and 0.2659 ± 0.5004i. Typing polyval(p,ans) returns three values
that are close to zero. This confirms that the roots satisfy the equation 36x3 + 12x2 − 5x +
10 = 0.
1-9
16. The session is:
r = [3+6i,3-6i,8,8,20];
p = poly(r)
p =
1 -42 645 -5204 24960 -57600
roots(p)
ans =
20.0000
3.0000 + 6.0000i
3.0000 - 6.0000i
8.0000
8.0000
Because the roots command returns the same roots as those given, the answer is correct.
It is x5 − 42x4 + 645x3 − 5204x2 + 24, 960x − 57, 600.
17. No solution is needed.
18. a) z = 0 1 0 0 1 b) z = 1 0 1 0 0
c) z = 1 1 1 0 1 d) z = 0 0 0 1 0
e) z = 0 0 1 1 1
19. The session is:
x = [-15, -8, 9, 8, 5];y = [-20, -12, 4, 8, 9];
x(x>y)
ans =
-15 9
find(x>y)
ans =
1 3
The first and third elements of x are greater than the first and third elements of y.
20. The session is:
t = [1:0.005:3];
T = 6*log(t) - 7*exp(-0.2*t);
plot(t,T),title( Temperature Versus Time ),...
xlabel( Time t (minutes) ),ylabel( Temperature T (◦ C) )
The plot is shown in the figure.
1-10
1 1.2 1.4 1.6 1.8 2 2.2 2.4 2.6 2.8 3
−6
−5
−4
−3
−2
−1
0
1
2
3
Time t (minutes)
TemperatureT(
o
C)
Temperature Versus Time
Figure : for Problem 20
21. The session is:
x = [0:0.01:2];
u = 2*log10(60*x+1);
v = 3*cos(6*x);
plot(x,u,x,v, -- ),ylabel( Speed (miles/hour) ),...
xlabel( Distance x (miles) )
The plot is shown in the figure.
1-11
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
−3
−2
−1
0
1
2
3
4
5
Distance x (miles)
Speed(miles/hour)
u
v
Figure : for Problem 21
1-12
22. The session is:
x = [-3:0.01:3];
p1 = [3,-6,8,4,90];
p2 = [3,5,-8,70];
y = polyval(p1,x);
z = polyval(p2,x);
plot(x,y,x,z, -- ),ylabel( Current (milliamps) ),...
xlabel( Voltage x (volts) )
The plot is shown in the figure.
−3 −2 −1 0 1 2 3
0
100
200
300
400
500
600
Voltage x (volts)
Current(milliamps)
y
z
Figure : for Problem 22
1-13
23. The session is:
p = [3,-5,-28,-5,200];
x = [-1:0.005:1];
y = polyval(p,x);
plot(x,y),ylabel( y ),xlabel( x ),ginput(1)
The peak as measured with the mouse cursor is y = 200.3812 at x = −0.0831
−1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1
175
180
185
190
195
200
205
x
y
Figure : for Problem 23
24. The session is:
A = [7,14,-6;12,-5,9;-5,7,15];
b = [95;-50;145];
x = Ab
The answers are −3, 10, and 4, which correspond to x = −3, y = 10, and z = 4. Typing
A*x gives the result 95, -50, 145, which are the right-hand sides of the equations. Thus the
values of x, y, and z are correct.
25. The script file is:
1-14
x = -5;
if x < -1
y = exp(x + 1)
elseif x < 5
y = 2 + cos(pi*x)
else
y = 10*(x - 5) + 1
end
The answer for x = −5 is y = 0.0183. Change the first line to x = 3 to obtain y = 1. Then
change the first line to x = 15 to obtain y = 101.
26. The script file is:
sum = 0;
for k = 1:10
sum = sum + 5*k^3;
end
sum
The answer is sum = 15125.
27. The script file is:
sum = 0;k = 0;
while sum <= 2000
sum = sum + 2^k;
end
k
sum
The answers are k = 10 and sum = 2046.
28. The script file is:
amt1 = 1000;amt2 = 1000;
k1 = 0;k2 = 0;
while amt1 < 50000
k1 = k1 + 1;
amt1 = amt1*1.055 + 1000;
end
while amt2 < 50000
k2 = k2 + 1;
amt2 = amt2*1.045 + 1000;
1-15
end
diff = k2 - k1
The answer is diff = 2. Thus it takes 2 more years in the second bank.
29. The script file is:
a = 95;b = -50;c = 145;
A = [7, 14, -6;12, -5, 9;-5, 7, 15];
bvector = [a;b;c];
x = Abvector
The answers for x are −3, 10, 4, which correspond to x = −3, y = 10, and z = 4. Typing
A*x gives the result 95, -50, 145, which are the right-hand sides of the equations. Thus the
values of x, y, and z are correct.
30. The script file is:
k = 0;
for x = -2:.01:6
k = k + 1;
if x < -1
y(k) = exp(x+1);
elseif x < 5
y(k) = 2 + cos(pi*x);
else
y(k) = 10*(x-5) + 1;
end
end
x = [-2:.01:6];
plot(x,y),xlabel( Time x (seconds) ),ylabel( Height y (kilometers) )
The figure shows the plot.
1-16
−2 −1 0 1 2 3 4 5 6
0
2
4
6
8
10
12
Time x (seconds)
Heighty(kilometers)
Figure : for Problem 30
1-17
31. The script file is:
x = 0;
y = 0;k = 0;
while y < 9.8
k = k + 1;
x = x + 0.01;
y(k) = 10*(1-exp(-x/4));
end
xmax = x
x = [0:.01:xmax];
plot(x,y),xlabel( Time x (seconds) ),ylabel( Force y (newtons) )
The figure shows the plot.
0 2 4 6 8 10 12 14 16
0
1
2
3
4
5
6
7
8
9
10
Time x (seconds)
Forcey(newtons)
Figure : for Problem 31
1-18
32. The area is given by
A = WL +
1
2
W
2
2
which can be solved for L:
L =
A − W2/8
W
The perimeter is given by
P = 2L + W + 2
W
2
2
+
W
2
2
= 2L + W + 2
W
√
2
The script file is:
W = 6;A = 80;
L = (A - W^2/8)/W
P = 2*L + W + 2*W/sqrt(2)
The answers are L = 12.58 meters and the total length is the perimeter P = 39.65 meters.
33. Applying the law of cosines to the two traingles gives
a2
= b2
1 + c2
1 − 2b1c1 cos A1
a2
= b2
2 + c2
2 − 2b2c2 cos A2
With the given values we can solve the first equation for a, then solve the second equation
for c2. The second equation is a quadratic in c2, and can be written as
c2
2 − (2b2 cos A2)c2 + b2
2 − a2
= 0
The script file is:
b1 = 180;b2 = 165;c1 = 115;A1 = 120*pi/180;A2 = 100*pi/180;
a = sqrt(b1^2 + c1^2 - 2*b1*c1*cos(A1));
roots([1,-2*b2*cos(A2),b2^2-a^2])
The two roots are c2 = -228 and c2 = 171. Taking the positive root gives c2 = 171 meters.
34. The area is given by
A = 2RL +
1
2
πR2
which can be solved for L:
L =
A − πR2/2
2R
The cost is given by
C = 30(2R + 2L) + 40πR
The script file is given below. Several guesses for the range of x had to be made to find the
range where the cost showed a minimum value.
1-19
clear
A = 1600;k = 0;
for x = 5:0.01:30
k = k + 1;
R(k) = x;
L(k) = (A - 0.5*pi*x^2)/(2*x);
C(k) = 30*(2*x + 2*L(k)) + 40*pi*x;
end
plot(R,C,R,20*L),xlabel( Radius (ft) ),ylabel( Cost ($) ),...
[rmin,costmin] = ginput(1)
Lmin = (A - 0.5*pi*rmin^2)/(2*rmin)
r1 = 0.8*rmin;r2 = 1.2*rmin;
L1 = (A - 0.5*pi*r1^2)/(2*r1);
L2 = (A - 0.5*pi*r2^2)/(2*r2);
cost1 = 30*(2*r1 + 2*L1) + 40*pi*r1
cost2 = 30*(2*r2+2*L2) + 40*pi*r2
The figure shows the plot. Using the cursor to select the minimum point on the curve, we
obtain the optimum value of the radius R to be rmin = 18.59 feet, and the corresponding
cost is costmin = $5140. The corresponding length L is Lmin = 28.4 feet. The costs
corresponding to a ±20% change from r = 18.59 are cost1 = $5288 (a 3% increase) and
cost2 = $5243 (a 2% increase). So near the optimum radius, the cost is rather insensitive
to changes in the radius.
1-20
5 10 15 20 25 30
5000
6000
7000
8000
9000
10000
11000
Radius (ft)
Cost($)
Figure : for Problem 34
1-21
35. Typing help plot gives the required information. Typing help label obtains the
response label not found. In this case we need to be more specific, such as by typing
help xlabel, because label is not a command or function, or we can type lookfor label.
Similarly, typing help cos gives the required information, but typing help cosine obtains
the response cosine not found. Typing lookfor cosine directs you to the cos command.
Typing help : and help * gives the required information.
36. (a) If we neglect drag, then conservation of mechanical energy states that the kinetic
energy at the time the ball is thrown must equal the potential energy when the ball reaches
the maximum height. Thus
1
2
mv2
= mgh
where v is the initial speed and h is the maximum height. We can solve this for v: v =
√
2gh.
Note that the mass m cancels, so the result is independent of m.
For h = 20 feet, we get v = 2(32.2)(20) = 35.9 feet/second. Because speed measured
in miles per hour is more familiar to most of us, we can convert the answer to miles per
hour as a “reality check” on the answer. The result is v = 35.9(3600)/5280 = 24.5 miles
per hour, which seems reasonable.
(b) The issues here are the manner in which the rod is thrown and the effect of drag on
the rod. If the drag is negligible and if we give the mass center a speed of 35.9 feet/second,
then the mass center of the rod will reach a height of 20 feet. However, if we give the rod
the same kinetic energy, but throw it upward by grasping one end of the rod, then it will
spin and not reach 20 feet. The kinetic energy of the rod is given by
KE =
1
2
mv2
mc +
1
2
Iω2
where vmc is the speed of the rod’s mass center. For the same rotational speed ω and kinetic
energy KE, a rod with a larger inertia I will reach a smaller height, because a larger fraction
of its energy is contained in the spinning motion. The inertia I increases with the length
and radius of the rod. In addition, a longer rod will have increased drag, and will thus reach
a height smaller than that predicted using conservation of mechanical energy.
37. (a) When A = 0◦, d = L1 + L2. When A = 180◦, d = L1 − L2. The stroke is the
difference between these two values. Thus the stroke is L1 + L2 − (L1 − L2) = 2L2 and
depends only on L2.
b) The Matlab session looks like the one shown in the text, except that L1 = 0.6 is
used for the first plot and L1 = 1.4 for the second plot . The plots are shown in the two
figures. Their general shape is similar, but they are translated vertically relative to one
another.
1-22
0 20 40 60 80 100 120 140 160 180
0
0.2
0.4
0.6
0.8
1
1.2
A (degrees)
d(feet)
Figure : for Problem 37
1-23
0 20 40 60 80 100 120 140 160 180
0.8
1
1.2
1.4
1.6
1.8
2
A (degrees)
d(feet)
Figure : for Problem 37
1-24

More Related Content

What's hot

Solution Manual : Chapter - 06 Application of the Definite Integral in Geomet...
Solution Manual : Chapter - 06 Application of the Definite Integral in Geomet...Solution Manual : Chapter - 06 Application of the Definite Integral in Geomet...
Solution Manual : Chapter - 06 Application of the Definite Integral in Geomet...
Hareem Aslam
 
Local linear approximation
Local linear approximationLocal linear approximation
Local linear approximation
Tarun Gehlot
 
Solution Manual : Chapter - 05 Integration
Solution Manual : Chapter - 05 IntegrationSolution Manual : Chapter - 05 Integration
Solution Manual : Chapter - 05 Integration
Hareem Aslam
 
5.2 arithmetic sequences and sums t
5.2 arithmetic sequences and sums t5.2 arithmetic sequences and sums t
5.2 arithmetic sequences and sums t
math260
 
Solution Manual : Chapter - 01 Functions
Solution Manual : Chapter - 01 FunctionsSolution Manual : Chapter - 01 Functions
Solution Manual : Chapter - 01 Functions
Hareem Aslam
 
Hand book of Howard Anton calculus exercises 8th edition
Hand book of Howard Anton calculus exercises 8th editionHand book of Howard Anton calculus exercises 8th edition
Hand book of Howard Anton calculus exercises 8th edition
PriSim
 
Complex Numbers 1 - Math Academy - JC H2 maths A levels
Complex Numbers 1 - Math Academy - JC H2 maths A levelsComplex Numbers 1 - Math Academy - JC H2 maths A levels
Complex Numbers 1 - Math Academy - JC H2 maths A levels
Math Academy Singapore
 
Chapter 2(limits)
Chapter 2(limits)Chapter 2(limits)
Chapter 2(limits)
Eko Wijayanto
 
Capítulo 01 introdução
Capítulo 01   introduçãoCapítulo 01   introdução
Capítulo 01 introdução
Jhayson Carvalho
 
Advanced Trigonometry
Advanced TrigonometryAdvanced Trigonometry
Advanced Trigonometrytimschmitz
 
Factoring by the trial and-error method
Factoring by the trial and-error methodFactoring by the trial and-error method
Factoring by the trial and-error method
Tarun Gehlot
 
Computer Graphic - Lines, Circles and Ellipse
Computer Graphic - Lines, Circles and EllipseComputer Graphic - Lines, Circles and Ellipse
Computer Graphic - Lines, Circles and Ellipse
2013901097
 

What's hot (16)

Solution Manual : Chapter - 06 Application of the Definite Integral in Geomet...
Solution Manual : Chapter - 06 Application of the Definite Integral in Geomet...Solution Manual : Chapter - 06 Application of the Definite Integral in Geomet...
Solution Manual : Chapter - 06 Application of the Definite Integral in Geomet...
 
Local linear approximation
Local linear approximationLocal linear approximation
Local linear approximation
 
Solution Manual : Chapter - 05 Integration
Solution Manual : Chapter - 05 IntegrationSolution Manual : Chapter - 05 Integration
Solution Manual : Chapter - 05 Integration
 
5.2 arithmetic sequences and sums t
5.2 arithmetic sequences and sums t5.2 arithmetic sequences and sums t
5.2 arithmetic sequences and sums t
 
Solution Manual : Chapter - 01 Functions
Solution Manual : Chapter - 01 FunctionsSolution Manual : Chapter - 01 Functions
Solution Manual : Chapter - 01 Functions
 
Hand book of Howard Anton calculus exercises 8th edition
Hand book of Howard Anton calculus exercises 8th editionHand book of Howard Anton calculus exercises 8th edition
Hand book of Howard Anton calculus exercises 8th edition
 
Integration
IntegrationIntegration
Integration
 
Circles
CirclesCircles
Circles
 
Complex Numbers 1 - Math Academy - JC H2 maths A levels
Complex Numbers 1 - Math Academy - JC H2 maths A levelsComplex Numbers 1 - Math Academy - JC H2 maths A levels
Complex Numbers 1 - Math Academy - JC H2 maths A levels
 
Chapter 2(limits)
Chapter 2(limits)Chapter 2(limits)
Chapter 2(limits)
 
Chapter 16
Chapter 16Chapter 16
Chapter 16
 
Capítulo 01 introdução
Capítulo 01   introduçãoCapítulo 01   introdução
Capítulo 01 introdução
 
Advanced Trigonometry
Advanced TrigonometryAdvanced Trigonometry
Advanced Trigonometry
 
Sect1 1
Sect1 1Sect1 1
Sect1 1
 
Factoring by the trial and-error method
Factoring by the trial and-error methodFactoring by the trial and-error method
Factoring by the trial and-error method
 
Computer Graphic - Lines, Circles and Ellipse
Computer Graphic - Lines, Circles and EllipseComputer Graphic - Lines, Circles and Ellipse
Computer Graphic - Lines, Circles and Ellipse
 

Similar to Palm ch1

Solutions_Manual_to_accompany_Applied_Nu.pdf
Solutions_Manual_to_accompany_Applied_Nu.pdfSolutions_Manual_to_accompany_Applied_Nu.pdf
Solutions_Manual_to_accompany_Applied_Nu.pdf
WaleedHussain30
 
Numerical Method for UOG mech stu prd by Abdrehman Ahmed
Numerical Method for UOG mech stu prd by Abdrehman Ahmed Numerical Method for UOG mech stu prd by Abdrehman Ahmed
Numerical Method for UOG mech stu prd by Abdrehman Ahmed
አብድረህማን አህመድ
 
Question 1. a) (i)(4+i2).(1+i3)4(1+i3)+i2(1+i3)4+i12+i2-6.docx
Question 1.  a) (i)(4+i2).(1+i3)4(1+i3)+i2(1+i3)4+i12+i2-6.docxQuestion 1.  a) (i)(4+i2).(1+i3)4(1+i3)+i2(1+i3)4+i12+i2-6.docx
Question 1. a) (i)(4+i2).(1+i3)4(1+i3)+i2(1+i3)4+i12+i2-6.docx
IRESH3
 
Quantitative techniques for MBA (QDM)
Quantitative techniques for MBA (QDM)Quantitative techniques for MBA (QDM)
Quantitative techniques for MBA (QDM)
npazare
 
Matrix chain multiplication
Matrix chain multiplicationMatrix chain multiplication
Matrix chain multiplication
Kiran K
 
Algebra and function
Algebra and functionAlgebra and function
Algebra and function
Azlan Ahmad
 
Ch01
Ch01Ch01
Department of MathematicsMTL107 Numerical Methods and Com.docx
Department of MathematicsMTL107 Numerical Methods and Com.docxDepartment of MathematicsMTL107 Numerical Methods and Com.docx
Department of MathematicsMTL107 Numerical Methods and Com.docx
salmonpybus
 
Shi20396 ch05
Shi20396 ch05Shi20396 ch05
Shi20396 ch05
Paralafakyou Mens
 
SolutionsPlease see answer in bold letters.Note pi = 3.14.docx
SolutionsPlease see answer in bold letters.Note pi = 3.14.docxSolutionsPlease see answer in bold letters.Note pi = 3.14.docx
SolutionsPlease see answer in bold letters.Note pi = 3.14.docx
rafbolet0
 
Initial value problems
Initial value problemsInitial value problems
Initial value problems
Ali Jan Hasan
 
1520 differentiation-l1
1520 differentiation-l11520 differentiation-l1
1520 differentiation-l1
Dr Fereidoun Dejahang
 
Mathematics
MathematicsMathematics
Mathematics
MathematicsMathematics
Mathematics
jiteshtuteja
 
Presentation on calculus
Presentation on calculusPresentation on calculus
Presentation on calculus
Shariful Haque Robin
 
trapezoidal rule.pptx
trapezoidal rule.pptxtrapezoidal rule.pptx
trapezoidal rule.pptx
SatishKotwal
 
Algebra ii honors study guide
Algebra ii honors study guideAlgebra ii honors study guide
Algebra ii honors study guidemorrobea
 
Algebra ii honors study guide
Algebra ii honors study guideAlgebra ii honors study guide
Algebra ii honors study guidemorrobea
 

Similar to Palm ch1 (20)

Solutions_Manual_to_accompany_Applied_Nu.pdf
Solutions_Manual_to_accompany_Applied_Nu.pdfSolutions_Manual_to_accompany_Applied_Nu.pdf
Solutions_Manual_to_accompany_Applied_Nu.pdf
 
Numerical Method for UOG mech stu prd by Abdrehman Ahmed
Numerical Method for UOG mech stu prd by Abdrehman Ahmed Numerical Method for UOG mech stu prd by Abdrehman Ahmed
Numerical Method for UOG mech stu prd by Abdrehman Ahmed
 
Question 1. a) (i)(4+i2).(1+i3)4(1+i3)+i2(1+i3)4+i12+i2-6.docx
Question 1.  a) (i)(4+i2).(1+i3)4(1+i3)+i2(1+i3)4+i12+i2-6.docxQuestion 1.  a) (i)(4+i2).(1+i3)4(1+i3)+i2(1+i3)4+i12+i2-6.docx
Question 1. a) (i)(4+i2).(1+i3)4(1+i3)+i2(1+i3)4+i12+i2-6.docx
 
Quantitative techniques for MBA (QDM)
Quantitative techniques for MBA (QDM)Quantitative techniques for MBA (QDM)
Quantitative techniques for MBA (QDM)
 
Matrix chain multiplication
Matrix chain multiplicationMatrix chain multiplication
Matrix chain multiplication
 
Algebra and function
Algebra and functionAlgebra and function
Algebra and function
 
Ch01
Ch01Ch01
Ch01
 
Department of MathematicsMTL107 Numerical Methods and Com.docx
Department of MathematicsMTL107 Numerical Methods and Com.docxDepartment of MathematicsMTL107 Numerical Methods and Com.docx
Department of MathematicsMTL107 Numerical Methods and Com.docx
 
Shi20396 ch05
Shi20396 ch05Shi20396 ch05
Shi20396 ch05
 
SolutionsPlease see answer in bold letters.Note pi = 3.14.docx
SolutionsPlease see answer in bold letters.Note pi = 3.14.docxSolutionsPlease see answer in bold letters.Note pi = 3.14.docx
SolutionsPlease see answer in bold letters.Note pi = 3.14.docx
 
Initial value problems
Initial value problemsInitial value problems
Initial value problems
 
1520 differentiation-l1
1520 differentiation-l11520 differentiation-l1
1520 differentiation-l1
 
4. simplifications
4. simplifications4. simplifications
4. simplifications
 
Mathematics
MathematicsMathematics
Mathematics
 
Mathematics
MathematicsMathematics
Mathematics
 
Presentation on calculus
Presentation on calculusPresentation on calculus
Presentation on calculus
 
trapezoidal rule.pptx
trapezoidal rule.pptxtrapezoidal rule.pptx
trapezoidal rule.pptx
 
Maths05
Maths05Maths05
Maths05
 
Algebra ii honors study guide
Algebra ii honors study guideAlgebra ii honors study guide
Algebra ii honors study guide
 
Algebra ii honors study guide
Algebra ii honors study guideAlgebra ii honors study guide
Algebra ii honors study guide
 

Recently uploaded

Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
Kamal Acharya
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
R&R Consult
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
AmarGB2
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
Jayaprasanna4
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
SamSarthak3
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
SupreethSP4
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
Vijay Dialani, PhD
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
karthi keyan
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
gerogepatton
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
Jayaprasanna4
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
Massimo Talia
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Dr.Costas Sachpazis
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
ankuprajapati0525
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
ViniHema
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
Pratik Pawar
 

Recently uploaded (20)

Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 

Palm ch1

  • 1. Instructor’s Manual c to accompany Introduction to Matlab 6 for Engineers by William J. Palm III University of Rhode Island c Instructor’s Manual Copyright 2000 by McGraw-Hill Companies, Inc. 0-1
  • 2. Solutions to Problems in Chapter One Test Your Understanding Problems T1.1-1 a) 6*10/13 + 18/(5*7) + 5*9^2. Answer is 410.1297. b) 6*35^(1/4) + 14^0.35. Answer is 17.1123. T1.3-1 The session is: x = [[cos(0):0.02:log10(100)]; length(x) ans = 51 x(25) ans = 1.4800 T1.3-2 The session is: roots([1, 6, -11, 290] ans = -10.000 2.0000 + 5.0000i 2.0000 - 5.0000i poly(ans) ans = 1.0000 6.0000 -11.0000 290.0000 which are the given coefficients. Thus the roots are −10 and 2 ± 5i. T1.3-3 a) z = 0 0 1 1 1 b) z = 1 0 0 0 0 c) z = 1 0 1 1 1 d) z = 0 0 0 0 1 T1.3-4 The session is: x = [-4, -1, 0, 2, 10];y = [-5, -2, 2, 5, 9]; x(x>y) ans = -4 -1 10 find(x>y) ans = 1 2 5 1-1
  • 3. T1.3-5 The session is: t = [0:0.01:5]; s = 2*sin(3*t+2) + sqrt(5*t+1); plot(t,s),xlabel( Time (sec) ),ylabel( Speed (ft/sec) ) 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 0 1 2 3 4 5 6 7 Time t (sec) Speeds(ft/sec) Figure : for Problem T1.3-5 T1.3-6 The session is: x = [0:0.01:1.55]; s = 4*sqrt(6*x+1); z = polyval([4,6,-5,3],x); plot(x,y,x,z, -- ),xlabel( Distance (meters) ),ylabel( Force (newtons) T1.3-7 The session is: A = [6, -4, 8; -5, -3, 7; 14, 9, -5]; b = [112; 75; -67]; x = Ab 1-2
  • 4. 0 0.5 1 1.5 0 5 10 15 20 25 Distance x (meters) Force(newtons) y z Figure : for Problem T1.3-6 x = 2.0000 -5.0000 10.0000 A*x ans = 112 75 -67 Thus the solution is x = 2, y = −5, and z = 10. T1.4-1 The session is: a = 112; b = 75; c = -67; A = [6, -4, 8; -5, -3, 7; 14, 9, -5]; bvector = [a; b; c]; x = Abvector x = 2.0000 -5.0000 10.0000 1-3
  • 5. A*x ans = 112 75 -67 Thus the solution is x = 2, y = −5, and z = 10. T1.4-2 The script file is: x = -5; if x < 0 y = sqrt(x^2+1) elseif x < 10 y = 3*x+1 else y = 9*sin(5*x-50)+31 end For x = −5, y = 5.0990. Changing the first line to x = 5 gives y = 16. Changing the first line to x = 15 gives y = 29.8088. T1.4-3 The script file is sum = 0; for k = 1:20 sum = sum + 3*k^2; end sum The answer is sum = 8610. T1.4-4 The script file is sum = 0;k = 0; while sum <= 2000 k = k + 1; sum = sum + 3*k^2; end k sum The answers are k = 13 and sum = 2457. End-of-Chapter Problems 1. The session is: 1-4
  • 6. x = 10; y = 3; u = x + y u = 13 v = x*y v = 30 w = x/y w = 3.3333 z = sin(x) z = -0.5440 r = 8*sin(y) r = 1.1290 s = 5*sin(2*y) s = -1.3971 2. The session is: y*x^3/(x-y) ans = -13.3333 3*x/(2*y) ans = 0.6000 3*x*y/2 ans = 15 x^5/(x^5-1) ans = 1.0323 3. The session is: x = 3; y = 4; 1/(1-1/x^5) ans = 1.0041 3*pi*x^2 1-5
  • 7. ans = 84.8230 3*y/(4*x-8) ans = 3 4*(y-5)/(3*x-6) ans = -1.3333 4. a) x = 2;y = 6*x^3 + 4/x. The answer is y = 50. b) x = 8;y = (x/4)*3. The answer is y = 6. c) x = 10;y = (4*x)^2/25. The answer is y = 64. d) x = 2;y = 2*sin(x)/5. The answer is y = 0.3637. e) x = 20;y = 7*x^(1/3) + 4*x^0.58. The answer is y = 41.7340. 5. The session is: a = 1.12; b = 2.34; c = 0.72;d = 0.81;f = 19.83; x = 1 + a/b + c/f^2 x = 1.4805 s = (b-a)/(d-c) s = 13.556 r = 1/(1/a + 1/b + 1/c + 1/d) r = 0.2536 y = a*b/c*f^2/2 y = 715.6766 6. The session is: r = 5; V = 4*pi*^3/4; V = 1.3*V; r = ((3*V)/(4*pi))^(1/3); r = 4.9580 The required radius is 4.958. 1-6
  • 8. 7. The session is x = -7-5i;y = 4+3i; x+y ans = -3.0000 - 2.0000i x*y ans = -13.0000 -41.0000i x/y ans = -1.7200 + 0.0400i 8. The session is: (3+6i)*(-7-9i) ans = 33.0000 -69.0000i (5+4i)/(5-4i) ans = 0.2195 + 0.9756i 3i/2 ans = 0 + 1.5000i 3/2i ans = 0 - 1.5000i 9. The session is: x = 5+8i;y = -6+7i; u = x + y;v = x*y; w = x/y;z = exp(x) r = sqrt(y);s = x*y^2; The answers are u = −1+51i, v = −86−13i, w = 0.3059−0.9765i, z = −21.594+146.83i, r = 1.2688 + 2.7586i, and s = 607 − 524i. 10. The session is: n = 1;R = 0.08206;T = 273.2;V=22.41; a = 6.49;b = 0.0562; Pideal = n*R*T/V 1-7
  • 9. Pideal = 1.0004 P1 = n*R*T/(V - nb) P1 = 1.0029 P2 = (a*n^2)/V^2 P2 = 0.0129 Pwaals = P1 + P2 Pwaals = 1.0158 The ideal gas law predicts a pressure of 1.0004 atmospheres, while the van der Waals model predicts 1.0158 atmospheres. Most of the difference is due to the P2 term, which models the molecular attractions. 11. The ideal gas law gives T V = P nR = constant Thus T1/V1 = T2/V2, or V2 = V1T2/T1. The session is: V1 = 28500;T1 = 273.2 - 15;T2 = 273.2 + 31; V2 = V1*T2/T1 V2 = 3.3577e+4 The volume is 3.3577 × 104 ft3. 12. The session is: x=[1:.2:5]; y = 7*sin(4*x) y = Columns 1 through 7 -5.2976 -6.9732 -4.4189 0.8158 5.5557 6.9255 4.0944 Columns 8 through 14 -1.2203 -5.7948 -6.8542 -3.7560 1.6206 6.0141 6.7596 Columns 15 through 21 3.4048 -2.0153 -6.2130 -6.6419 -3.0420 2.4032 6.3906 y(3) ans = -4.4189 1-8
  • 10. There are 21 elements. The third element is −4.4189. 13. The session is: x = [sin(-pi/2):0.05:cos(0)]; length(x) ans = 41 x(10) ans = 0.5500 There are 41 elements. The tenth element is 0.55. 14. The session is: p = ([13,182,-184,2503]; r = roots(p) r = -15.6850 0.8425 + 3.4008i 0.8425 - 3.4008i polyval(p,r) ans = 1.0e-012 * 0.1137 - 0.0001i 0 - 0.0002i 0 The roots are x = −15.685 and x = 0.8425 ± 3.4008i. When these roots are substituted into the polynomial, we obtain values close to zero, as they should be. 15. The session is: p = [36, 12, -5, 10]; roots(p) ans = -0.8651 0.2659 + 0.5004i 0.2659 - 0.5004i The roots are −0.8651 and 0.2659 ± 0.5004i. Typing polyval(p,ans) returns three values that are close to zero. This confirms that the roots satisfy the equation 36x3 + 12x2 − 5x + 10 = 0. 1-9
  • 11. 16. The session is: r = [3+6i,3-6i,8,8,20]; p = poly(r) p = 1 -42 645 -5204 24960 -57600 roots(p) ans = 20.0000 3.0000 + 6.0000i 3.0000 - 6.0000i 8.0000 8.0000 Because the roots command returns the same roots as those given, the answer is correct. It is x5 − 42x4 + 645x3 − 5204x2 + 24, 960x − 57, 600. 17. No solution is needed. 18. a) z = 0 1 0 0 1 b) z = 1 0 1 0 0 c) z = 1 1 1 0 1 d) z = 0 0 0 1 0 e) z = 0 0 1 1 1 19. The session is: x = [-15, -8, 9, 8, 5];y = [-20, -12, 4, 8, 9]; x(x>y) ans = -15 9 find(x>y) ans = 1 3 The first and third elements of x are greater than the first and third elements of y. 20. The session is: t = [1:0.005:3]; T = 6*log(t) - 7*exp(-0.2*t); plot(t,T),title( Temperature Versus Time ),... xlabel( Time t (minutes) ),ylabel( Temperature T (◦ C) ) The plot is shown in the figure. 1-10
  • 12. 1 1.2 1.4 1.6 1.8 2 2.2 2.4 2.6 2.8 3 −6 −5 −4 −3 −2 −1 0 1 2 3 Time t (minutes) TemperatureT( o C) Temperature Versus Time Figure : for Problem 20 21. The session is: x = [0:0.01:2]; u = 2*log10(60*x+1); v = 3*cos(6*x); plot(x,u,x,v, -- ),ylabel( Speed (miles/hour) ),... xlabel( Distance x (miles) ) The plot is shown in the figure. 1-11
  • 13. 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 −3 −2 −1 0 1 2 3 4 5 Distance x (miles) Speed(miles/hour) u v Figure : for Problem 21 1-12
  • 14. 22. The session is: x = [-3:0.01:3]; p1 = [3,-6,8,4,90]; p2 = [3,5,-8,70]; y = polyval(p1,x); z = polyval(p2,x); plot(x,y,x,z, -- ),ylabel( Current (milliamps) ),... xlabel( Voltage x (volts) ) The plot is shown in the figure. −3 −2 −1 0 1 2 3 0 100 200 300 400 500 600 Voltage x (volts) Current(milliamps) y z Figure : for Problem 22 1-13
  • 15. 23. The session is: p = [3,-5,-28,-5,200]; x = [-1:0.005:1]; y = polyval(p,x); plot(x,y),ylabel( y ),xlabel( x ),ginput(1) The peak as measured with the mouse cursor is y = 200.3812 at x = −0.0831 −1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1 175 180 185 190 195 200 205 x y Figure : for Problem 23 24. The session is: A = [7,14,-6;12,-5,9;-5,7,15]; b = [95;-50;145]; x = Ab The answers are −3, 10, and 4, which correspond to x = −3, y = 10, and z = 4. Typing A*x gives the result 95, -50, 145, which are the right-hand sides of the equations. Thus the values of x, y, and z are correct. 25. The script file is: 1-14
  • 16. x = -5; if x < -1 y = exp(x + 1) elseif x < 5 y = 2 + cos(pi*x) else y = 10*(x - 5) + 1 end The answer for x = −5 is y = 0.0183. Change the first line to x = 3 to obtain y = 1. Then change the first line to x = 15 to obtain y = 101. 26. The script file is: sum = 0; for k = 1:10 sum = sum + 5*k^3; end sum The answer is sum = 15125. 27. The script file is: sum = 0;k = 0; while sum <= 2000 sum = sum + 2^k; end k sum The answers are k = 10 and sum = 2046. 28. The script file is: amt1 = 1000;amt2 = 1000; k1 = 0;k2 = 0; while amt1 < 50000 k1 = k1 + 1; amt1 = amt1*1.055 + 1000; end while amt2 < 50000 k2 = k2 + 1; amt2 = amt2*1.045 + 1000; 1-15
  • 17. end diff = k2 - k1 The answer is diff = 2. Thus it takes 2 more years in the second bank. 29. The script file is: a = 95;b = -50;c = 145; A = [7, 14, -6;12, -5, 9;-5, 7, 15]; bvector = [a;b;c]; x = Abvector The answers for x are −3, 10, 4, which correspond to x = −3, y = 10, and z = 4. Typing A*x gives the result 95, -50, 145, which are the right-hand sides of the equations. Thus the values of x, y, and z are correct. 30. The script file is: k = 0; for x = -2:.01:6 k = k + 1; if x < -1 y(k) = exp(x+1); elseif x < 5 y(k) = 2 + cos(pi*x); else y(k) = 10*(x-5) + 1; end end x = [-2:.01:6]; plot(x,y),xlabel( Time x (seconds) ),ylabel( Height y (kilometers) ) The figure shows the plot. 1-16
  • 18. −2 −1 0 1 2 3 4 5 6 0 2 4 6 8 10 12 Time x (seconds) Heighty(kilometers) Figure : for Problem 30 1-17
  • 19. 31. The script file is: x = 0; y = 0;k = 0; while y < 9.8 k = k + 1; x = x + 0.01; y(k) = 10*(1-exp(-x/4)); end xmax = x x = [0:.01:xmax]; plot(x,y),xlabel( Time x (seconds) ),ylabel( Force y (newtons) ) The figure shows the plot. 0 2 4 6 8 10 12 14 16 0 1 2 3 4 5 6 7 8 9 10 Time x (seconds) Forcey(newtons) Figure : for Problem 31 1-18
  • 20. 32. The area is given by A = WL + 1 2 W 2 2 which can be solved for L: L = A − W2/8 W The perimeter is given by P = 2L + W + 2 W 2 2 + W 2 2 = 2L + W + 2 W √ 2 The script file is: W = 6;A = 80; L = (A - W^2/8)/W P = 2*L + W + 2*W/sqrt(2) The answers are L = 12.58 meters and the total length is the perimeter P = 39.65 meters. 33. Applying the law of cosines to the two traingles gives a2 = b2 1 + c2 1 − 2b1c1 cos A1 a2 = b2 2 + c2 2 − 2b2c2 cos A2 With the given values we can solve the first equation for a, then solve the second equation for c2. The second equation is a quadratic in c2, and can be written as c2 2 − (2b2 cos A2)c2 + b2 2 − a2 = 0 The script file is: b1 = 180;b2 = 165;c1 = 115;A1 = 120*pi/180;A2 = 100*pi/180; a = sqrt(b1^2 + c1^2 - 2*b1*c1*cos(A1)); roots([1,-2*b2*cos(A2),b2^2-a^2]) The two roots are c2 = -228 and c2 = 171. Taking the positive root gives c2 = 171 meters. 34. The area is given by A = 2RL + 1 2 πR2 which can be solved for L: L = A − πR2/2 2R The cost is given by C = 30(2R + 2L) + 40πR The script file is given below. Several guesses for the range of x had to be made to find the range where the cost showed a minimum value. 1-19
  • 21. clear A = 1600;k = 0; for x = 5:0.01:30 k = k + 1; R(k) = x; L(k) = (A - 0.5*pi*x^2)/(2*x); C(k) = 30*(2*x + 2*L(k)) + 40*pi*x; end plot(R,C,R,20*L),xlabel( Radius (ft) ),ylabel( Cost ($) ),... [rmin,costmin] = ginput(1) Lmin = (A - 0.5*pi*rmin^2)/(2*rmin) r1 = 0.8*rmin;r2 = 1.2*rmin; L1 = (A - 0.5*pi*r1^2)/(2*r1); L2 = (A - 0.5*pi*r2^2)/(2*r2); cost1 = 30*(2*r1 + 2*L1) + 40*pi*r1 cost2 = 30*(2*r2+2*L2) + 40*pi*r2 The figure shows the plot. Using the cursor to select the minimum point on the curve, we obtain the optimum value of the radius R to be rmin = 18.59 feet, and the corresponding cost is costmin = $5140. The corresponding length L is Lmin = 28.4 feet. The costs corresponding to a ±20% change from r = 18.59 are cost1 = $5288 (a 3% increase) and cost2 = $5243 (a 2% increase). So near the optimum radius, the cost is rather insensitive to changes in the radius. 1-20
  • 22. 5 10 15 20 25 30 5000 6000 7000 8000 9000 10000 11000 Radius (ft) Cost($) Figure : for Problem 34 1-21
  • 23. 35. Typing help plot gives the required information. Typing help label obtains the response label not found. In this case we need to be more specific, such as by typing help xlabel, because label is not a command or function, or we can type lookfor label. Similarly, typing help cos gives the required information, but typing help cosine obtains the response cosine not found. Typing lookfor cosine directs you to the cos command. Typing help : and help * gives the required information. 36. (a) If we neglect drag, then conservation of mechanical energy states that the kinetic energy at the time the ball is thrown must equal the potential energy when the ball reaches the maximum height. Thus 1 2 mv2 = mgh where v is the initial speed and h is the maximum height. We can solve this for v: v = √ 2gh. Note that the mass m cancels, so the result is independent of m. For h = 20 feet, we get v = 2(32.2)(20) = 35.9 feet/second. Because speed measured in miles per hour is more familiar to most of us, we can convert the answer to miles per hour as a “reality check” on the answer. The result is v = 35.9(3600)/5280 = 24.5 miles per hour, which seems reasonable. (b) The issues here are the manner in which the rod is thrown and the effect of drag on the rod. If the drag is negligible and if we give the mass center a speed of 35.9 feet/second, then the mass center of the rod will reach a height of 20 feet. However, if we give the rod the same kinetic energy, but throw it upward by grasping one end of the rod, then it will spin and not reach 20 feet. The kinetic energy of the rod is given by KE = 1 2 mv2 mc + 1 2 Iω2 where vmc is the speed of the rod’s mass center. For the same rotational speed ω and kinetic energy KE, a rod with a larger inertia I will reach a smaller height, because a larger fraction of its energy is contained in the spinning motion. The inertia I increases with the length and radius of the rod. In addition, a longer rod will have increased drag, and will thus reach a height smaller than that predicted using conservation of mechanical energy. 37. (a) When A = 0◦, d = L1 + L2. When A = 180◦, d = L1 − L2. The stroke is the difference between these two values. Thus the stroke is L1 + L2 − (L1 − L2) = 2L2 and depends only on L2. b) The Matlab session looks like the one shown in the text, except that L1 = 0.6 is used for the first plot and L1 = 1.4 for the second plot . The plots are shown in the two figures. Their general shape is similar, but they are translated vertically relative to one another. 1-22
  • 24. 0 20 40 60 80 100 120 140 160 180 0 0.2 0.4 0.6 0.8 1 1.2 A (degrees) d(feet) Figure : for Problem 37 1-23
  • 25. 0 20 40 60 80 100 120 140 160 180 0.8 1 1.2 1.4 1.6 1.8 2 A (degrees) d(feet) Figure : for Problem 37 1-24