Homework 2
SECTION 1
Date:Feb 26, 2010
Name: Dylan Nelson
Student ID: djn157
Signature:
Problem 3.6
:
To solve the first part of this problem you
have to add up the amount of
Joules/ per second are contributed by the appliances, light bulbs, and
outside. That will give you the amount of heat the air conditioner must
remove to keep a constant temp.
For the second part, you must use the output from p
art A to divide it up and
find the amount of air conditioners needed in the case of this house.
Inputs
light bulbs

20 *
100J/s
appliances

4 *
500J/s
Outside heat

1 *
3000J/s
Ou
t
puts
Excess_heat

heat from: light bulbs + appliances +outsi
de heat
all in J/s so the units
are the same throughout the whole problem.
Equation/Hand Example
Excess heat = 100J/s * light bulb + 500J/s * appliances + 3000j/s
Matlab Solution
>> excess_heat=(20*100 + 4*500 + 3000)
excess_heat =
7000
>> 70
00/2000
ans =
3.500

dividing the total heat by the amount of J/s the A/C puts out gives you the air
conditioners needed to keep remove the excess heat. A
pproximately 3.5 air
conditioners at 2000J/s are needed for this house to keep a constant temp.
Problem 3.11
:
This problem consists of a formula for finding the displacement of a spring
with an attached mass over a time period. With inputs A, maximum
displacement, w, the angular frequency, and t, the time interval. Are in the
formula to get, x, the
displacement at time, t.
Inputs
A= 4 cm, maximum displacement
w= .06 radians/sec, angular frequency
t= 0:10, time in seconds
Homework 2
SECTION 1
Date:Feb 26, 2010
Name: Dylan Nelson
Student ID: djn157
Signature:
Outputs
x=
displacement at time t, units in cm.
Formula for Displacement of spring
x= A*cos(w*t)

The maximum displacement
multiplied by the cosine of angular frequency
multiplied by time.
Matlab Solution
Spring_311 contents
%Dylan Nelson
%this program gives the displacement of a spring with a mass
%attached over a time interval
%compsci 200 sect
1
%homework 2
%spring_311
A=4;
%the maximum displacement of the spring in cm
w=0.6;
%the angular frequency depending on the spring constant and the mass
%attached to the spring.
t=0:10;
%the time interval for the experiment.
x=A*cos(w.*t)
% x is equal to the displacement according to
the time.
Tested Solution
>> (spring_311)
x =
Columns 1 through 8
4.0000 3.3013 1.4494

0.9088

2.9496

3.9600

3.5870

1.9610
Columns 9 through 11
0.3500 2.5388 3.8407
>> table=[t
;
x]'
table =
0
4.0000
1.0000 3.3013
2.0000 1.4494
3.0000

0.9088
4.0000

2.9496
Homework 2
SECTION 1
Date:Feb 26, 2010
Name: Dylan Nelson
Student ID: djn157
Signature:
5.0000

3.9600
6.0000

3.5870
7.0000

1.9610
8.0000 0.3500
9.0000 2.5388
10.0000 3.8407
Problem 3.12:
This problem corre
sponds with the inputs from the previous problem
, so the
variables were kept in the workspace,
but now has a formula for the
acceleration
of the spring
during the time period, t.
Inputs
A= 4 cm, maximum displacement
w= .06 radians/sec, angular frequency
t=
0:10, time in seconds
Output
a = acceleration at time t, units in m/s
2
Equation for the acceleration of spring
a =

A*w^2 * cos(w*t)
Matlab Solution
Spring_312 contents
%Dylan Nelson
%this program calculates the acceleration over time of
%a spring
with an attached mass
%compsci 200 sect 1
%homework 2
%spring_312
A=4;
%the maximum displacement of the spring in cm
w=0.6;
%the angular frequency depending on the spring constant and the mass
%attached to the spring.
t=0:10;
%the time interval for the e
xperiment.
a=(

A*w^2)*cos(w.*t)
% x is equal to the displacement according to the time.
Tested Solution
>> (spring_312)
a =
Columns 1 through 8

1.4400

1.1885

0.5218 0.3272 1.0618 1.4256 1.2913 0.7060
Homework 2
SECTION 1
Date:Feb 26, 2010
Name: Dylan Nelson
Student ID: djn157
Signature:
Columns 9 through 11

0.1260

0.9140

1.3826
>> table=[t
;
x
;
a]'
table =
0
4.0000

1.4400
1.0000 3.3013

1.1885
2.0000 1.4494

0.5218
3.0000

0.9088 0.3272
4.0000

2.9496 1.0618
5.0000

3.9600 1.4256
6.0000

3.5870 1.2913
7.0000

1.9610 0.7060
8.0000 0.3500

0.1260
9.0000 2.5388

0.9140
10.0000 3.8407

1.3826
Problem 3.16:
Contents of the Command window
The problem asks to use the equation for a launched obj
ect with a given
in
itial velocity, launch angles from 0

pi/2 in increments pi/100 so I should be
returned 100
outputs from my m

file. Also to show that the farthest range
occurs at pi/4 which I will show with a plot.
Inputs
Vo= 100, the initial velocity o
f the projectile in m/s
g = 9.81, the gravitational constant for the acceleration of a falling object in m/s
2
theta= 0:pi/100:pi/2
Ouputs
R= the range of the object when launched with an initial speed at an angle, units in
meters.
Equation for Range
R=
(Vo^2/g) *sin(2*theta)

The intial speed of the projectile divided by the gravitational constant
multiplied by the sine of 2 times the launch angle.
Matlab Solution
Range_316 contents
%Dylan Nelson
%this program calculates the range of a launched
projectil
e with
%a given initial launch velocity and angle
%compsci 200 sect 1
%homework 2
%range_316
Homework 2
SECTION 1
Date:Feb 26, 2010
Name: Dylan Nelson
Student ID: djn157
Signature:
g=9.81;
%the gravitational constant of a falling object in m/s
Vo=100;
%the initial velocity of the projectile in m/s
theta=0:pi/100:pi/2;
%this is the range of
angles that the projectile can be launched at,
the
%object of the problem is to show that at pi/4 the range is the
greatest.
R=(Vo^2/g)*sin(2*theta)
%the equation for the range of a launched object with respect the x

axis
Tested Solution
>> (range_316)
R
=
1.0e+003 *
Columns 1 through 8
0 0.0640 0.1278 0.1910 0.2535 0.3150 0.3753 0.4340
Columns 9 through 16
0.4911 0.5462 0.5992 0.6498 0.6978 0.7431 0.7854 0.8247
Columns 17 through 24
0.8607 0.8933 0.9224 0.9478 0.9695 0.9873 1.0013 1.0113
Columns 25 through 32
1.0174 1.0194 1.0174 1.0113 1.0013 0.9873 0.9695 0.9478
Columns 33 through 40
0.9224 0.8933 0.8607 0.8247
0.7854 0.7431 0.6978 0.6498
Columns 41 through 48
0.5992 0.5462 0.4911 0.4340 0.3753 0.3150 0.2535 0.1910
Columns 49 through 51
0.1278 0.0640 0.0000
Homework 2
SECTION 1
Date:Feb 26, 2010
Name: Dylan Nelson
Student ID: djn157
Signature:

This plot shows the range of the object as the launch angle increases, the red
dot shows the range of the projectile at ,pi/4 (pi/4=.785), as you can see
there is a maximum range at this angle.
Problem 4.7:
Contents of the command window

This problem is looking for the specific volume of
air
using a specific
formulation of the ideal gas law
. We are given the pressure of the gas, the
temperature and the ideal gas constant for air.
Inputs
R= 0.2870, the ideal gas constant for air for this t
ype of ideal gas law equation,
Units are in kJ/(kgK)
T= 100:1000, the range of temperatures of the gas in Kelvin
P= 100:1000, the range of pressures of the equation in kPa(kilopascals)
Outputs
V= the specific volume of the gas under the conditions of the
input, units in m
3
/kg
Equation for the specific volume
of air
V= R*T/P

The ideal gas law transformed to solve for the specific volume
Matlab Solution
Volume_47 contents
%Dylan Nelson
%this program calculates the specific volume of air with a given
pressure and temperature using a formulation of the ideal gas law
%compsci 200 sect 1
%homework 2
%volume_47
Homework 2
SECTION 1
Date:Feb 26, 2010
Name: Dylan Nelson
Student ID: djn157
Signature:
T=100:100:1000;
%the temperature of the gas in Kelvin
P=100:100:1000;
%the pressure of the gas in kPascals
[T,P]=meshgrid(T,P);
%meshing the
temperature and pressure matrices so the solution is a two
%dimesnsional matrix
R=0.2870;
%this is usually a constant in ideal gas law when moles are involved
but
%for this case they give us the value in kJ/(kg K)
V=(R.*T)./P
%the equation for the volume
as pressure and temperature increase from
100
%to 1000.
Tested Solution
>>V =
Columns 1 through 8
0.2870 0.5740 0.8610 1.1480 1.4350 1.7220 2.0090 2.2960
0.1435 0.2870 0.4305 0.5740 0.7175 0.8610 1.0045 1.1480
0.0957 0.1913 0.2870 0.3827 0.4783 0.5740 0.6697 0.7653
0.0717 0.1435 0.2153 0.2870 0.3588 0.4305 0.5022 0.5740
0.0574
0.1148 0.1722 0.2296 0.2870 0.3444 0.4018 0.4592
0.0478 0.0957 0.1435 0.1913 0.2392 0.2870 0.3348 0.3827
0.0410 0.0820 0.1230 0.1640 0.2050 0.2460 0.2870 0.3280
0.0359 0.0717 0.
1076 0.1435 0.1794 0.2153 0.2511 0.2870
0.0319 0.0638 0.0957 0.1276 0.1594 0.1913 0.2232 0.2551
0.0287 0.0574 0.0861 0.1148 0.1435 0.1722 0.2009 0.2296
Columns 9 through 10
2.5830
2.8700
1.2915 1.4350
0.8610 0.9567
0.6457 0.7175
0.5166 0.5740
0.4305 0.4783
0.3690 0.4100
0.3229 0.3588
0.2870 0.3189
0.2583 0.2870
Problem 5.11:
Homework 2
SECTION 1
Date:Feb 26, 2010
Name: Dylan Nelson
Student ID: djn157
Signature:

This problem
uses a figure to show how the strength of a material is tested
by using a tensile testing machine, where stress is applied to an object using
a load force and from this you can find the strain in the material at that force.
As the load increases a breaki
ng point is reached in the material making the
deformation permanent, using the given loads on the material and the
lengths of it we can calculate the stress and strain of the specimen then
plotting them to find the breaking point.
Inputs
F=
[0
,1650,3400,5200,6850,7750,8650,9300,10100,10400,]
l= [2.002,2.004,2.006,2.008,2.010,2.020,2.040,2.080,2.12]
L= 2, the original length of the material
A=pi*r
2
, the cross sectional area of a rod is the area of a circle because that is where
the load force
is being applied to
r=
.505/2
Outputs
stress= F/A and strain= (l

L)/L
Matlab Solution
Contents of stress_strain_511
%Dylan Nelson
%this program calculates the stress and strain of a material
%in a tensile tester and plots the stress vs. the strain i
n
%a plot
%compsci 200 sect 1
%homework 2
%stress_strain_511
F= [1650,3400,5200,6850,7750,8650,9300,10100,10400,];
%the given load forces in lbf
l= [2.002,2.004,2.006,2.008,2.010,2.020,2.040,2.080,2.12];
%the length of the material with a load force appli
ed
L= 2;
%original length of the material
r=.2525;
%the radius of the rod in inches
A=pi*r^2;
%the cross sectional area of the rod in square inches
stress=F./A
%the stress on the rod as the force increases
strain=(l

L)/L
%the of
the rod as the length increases because of the force.
plot(strain,stress,
'

ok'
);
title=(
'strain vs. stress on a rod'
);
ylabel(
'stress'
);
xlabel(
'strain'
);
Homework 2
SECTION 1
Date:Feb 26, 2010
Name: Dylan Nelson
Student ID: djn157
Signature:
Tested Solution
>> (stress_strain_511)
stress =
1.0e+004 *
Columns 1 through 8
0.8238 1.6975 2.5962 3.4199 3.8693 4.3186 4.6431 5.0425
Column 9
5.1923
strain =
Columns 1 through 8
0.0010 0.0020 0.0030 0.0040 0.0050 0.0100 0.0200 0.0400
Column 9
0.0600
>> text(.0
08,4.3e4,'yield point')
Homework 2
SECTION 1
Date:Feb 26, 2010
Name: Dylan Nelson
Student ID: djn157
Signature:
Problem 5.17

This problem is a classic computer science law called Moore’s law. In 1965
Tom Moore predicted that the number of transistors on an integrated circuit
doubles every 12

18 months and this law has held since that time.
In the is
problem we will look at this law by using the formula for the law, increasing
our time in two year intervals, and analyzing a subplot of the results.
Inputs
t=
1965 +[1
:2:45
]
, this time interval is
in years
from the time the law was made until
present day
in two year intervals
Output
N= the predicted number of transistors on an integrated circuit
Formula of Moore’s Law
N=30*(2^(t./2))
Matlab Solution
%Dylan Nelson
%this program follows Moore’s law and predicts the predicted
%number of
transistors over time.
%compsci 200 sect 1
%homework 2
%stress_strain_511
t=1:2:45;
%the time interval in years from 1965 to present day
N=30*(2.^(t./2))
%the formula for moores law from 1965
table_t_N=[t;N]'
%a table of the year vs
the number of transistors on that year.
subplot(2,2,1);
plot(t,N,
'

b'
);
title(
'transistors over time'
);
xlabel(
'time, years'
);
ylabel(
'transistors'
);
subplot(2,2,2);
semilogy(t,N,
'

g'
);
title(
'transistors over time'
);
xlabel(
'time, years'
);
ylabel(
'trans
istors'
);
subplot(2,2,3);
semilogx(t,N,
'

r'
);
title(
'transistors over time'
);
xlabel(
'time, years'
);
ylabel(
'transistors'
);
subplot(2,2,4);
loglog(t,N,
'

m'
);
title(
'transistors over time'
);
xlabel(
'time, years'
);
ylabel(
'transistors'
);
Homework 2
SECTION 1
Date:Feb 26, 2010
Name: Dylan Nelson
Student ID: djn157
Signature:
Tested Solution

Due to the large size of
,
N
,
a table of time vs.
N
didn’t work wel
l in M
atlab
so I
neglected to show it
.
>> (transistors_517)
N =
1.0e+008 *
Columns 1 through 8
0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0001
Col
umns 9 through 16
0.0001 0.0002 0.0004 0.0009 0.0017 0.0035 0.0070 0.0139
Columns 17 through 23
0.0278 0.0556 0.1112 0.2224 0.4449 0.8897 1.7795

T
he linear graph in the top right shows the truth of
Moore’s law as the
number of transistors increases consistently over time.
Comments 0
Log in to post a comment