This preview shows pages 1–6. Sign up to view the full content.
Solutions to Problems in Chapter Three
Test Your Understanding Problems
T3.11
The session is
±
diary diary1.txt
±
x = [1:5];y = [0:2:8];
±
x.*y
ans =
041
22
44
0
±
save session1
±
clear x y
±
load session1
±
x.*y
ans =
0
±
diary off
±
type diary1.txt
x = [1:5];y = [0:2:8];
x.*y
ans =
0
4
12
24
40
save session1
clear x y
load session1
x.*y
ans =
0
4
12
24
40
diary off
T3.31
The script ﬁle is
% script file rad_deg.m
rad_angle = [1:5];
deg_angle = rad_angle*(180/pi);
angle_table =
format bank
disp(
0
radians degrees
0
)
disp(angle_table)
The session is
31
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document ±
rad_deg
radians degrees
1.00
57.30
2.00
114.59
3.00
171.89
4.00
229.18
5.00
286.48
T3.32
The script ﬁle is
% script file sphere_v.m
format bank
r = [1:.1:2];
V = 4*pi*r.^3/3;
vol_table = [r
0
,V
0
];
disp(
0
radius volume
0
)
disp(vol_table)
The session is
±
sphere_v
radius volume
1.00
4.19
1.10
5.58
1.20
7.24
1.30
9.20
1.40
11.49
1.50
14.14
1.60
17.16
1.70
20.58
1.80
24.43
1.90
28.73
2.00
33.51
T3.33
The script ﬁle is
% script file sphere
a.m
r = input(
0
Enter a value for the radius:
0
);
A = 4*pi*r.^2;
disp(
0
The area of the sphere is:
0
)
A
32
The session is
±
sphere
a
Enter a value for the radius:
3
The area of the sphere is:
A=
113.097
T3.41
The session is
±
x = [5:20:85];
±
y = [10:30:130];
±
log(x.*y)(log(x)+log(y))
ans =
1.0e014 *
0.0444
0
0.1776
0.1776
0.1776
T3.42
The session is
±
x = sqrt(2+6i)
x=
2.0402 + 1.4705i
±
abs(x)
ans =
2.5149
±
angle(x)
ans =
0.6245
±
real(x)
ans =
2.0402
±
imag(x)
ans =
1.4705
T3.43
The session is
±
x = [0:.4:2*pi];
±
exp(i*x)(cos(x)+i*sin(x))
The answers are essentially zero, which demonstrates that the identity is correct.
33
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document T3.44
The session is
±
x = [0:.4:2*pi];
±
asin(x)+acos(x)pi/2
The answers are essentially zero, which demonstrates that the identity is correct.
T3.45
The session is
±
x = [0:.4:2*pi];
±
tan(2*x)2*tan(x)./(1tan(x).^2)
The answers are essentially zero, which demonstrates that the identity is correct.
T3.46
The session is
±
x = [0:.1:5];
±
sin(i*x)i*sinh(x)
The answers are essentially zero, which demonstrates that the identity is correct.
T3.51
The function ﬁle is
function y = f5(x)
y = exp(.2*x).*sin(x+2).1;
You can plot the function to obtain solution estimates to use with
fzero
,oryoucans
imply
try values of
x
between 0 and 10. The session is
±
fzero(
0
f5
0
,0)
ans =
1.0187
±
fzero(
0
f5
0
,4)
ans =
4.5334
±
fzero(
0
f5
0
,6)
ans =
7.0066
So the solutions are
x
=1
.
0187, 4.5334, and 7.0066.
34
T3.52
The function ﬁle is
function y = f6(x)
y = 1 + exp(.2*x).*sin(x+2);
You can plot the function to obtain solution estimates to use with
fminbnd
,o
ryoucan
simply try values of
x
between 0 and 10. The session is
±
fminbnd(
0
f6
0
,0)
ans =
2.5150
±
f6(ans)
ans =
0.4070
±
fminbnd(
0
f6
0
,10)
ans =
8.7982
±
f6(ans)
ans =
0.8312
So the solutions are (
x, y
)=(2
.
5150
,
0
.
4070) and (
x, y
)=(8
.
7982
,
0
.
8312).
T3.53
Refer to Example 3.52. Modify the function ﬁle given in the example to use an
area of 200 ft
2
rather than 100 ft
2
. The function ﬁle is
function L = channel(x)
L = 200./x(1)x(1)./tan(x(2))+2*x(1)./sin(x(2));
Because this problem is similar to Example 3.51, we can try the same guess as in the
example. The session is
±
x = fminsearch(
0
channel
0
,[20,1])
x=
10.7457
1.0472
The answer is
d
=10
.
7457 ft and
θ
=1
.
0472 radians, or 60
◦
.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview. Sign up
to
access the rest of the document.
This note was uploaded on 10/21/2009 for the course ENGR 290 taught by Professor Priritera during the Spring '05 term at S. Alabama.
 Spring '05
 Priritera

Click to edit the document details