George Mason University Computer Programming with Matlab Paper

Doing exercises using MATLAB. Submit your code in more that one .m script file. So, one script for each problem.

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

Do not put spaces for MATLAB file names.

Random Numbers
3.20 Many games require the player to roll two dice. The number on each die can
vary from 1 to 6.
(a) Use the randi function to create a simulation of one roll of one die.
(b) Use your results from part (a) to create a simulation of the value rolled
with a second die.
(c) Add your two results to create a value representing the total rolled dur-
ing each turn.
(d) Use your program to determine the values rolled in a favorite board
game, or use the game shown in Figure P3.20.
3.13 You can use trigonometry to find the height of a building, as shown in
Figure P3.13. Suppose you measure the angle between the line of sight and
the horizontal line connecting the measuring point and the building. You
can calculate the height of the building with the following formulas:
tan (0) = n/d
h= d tan (0)
Assume that the distance to the building along the ground is 120 m, and the
angle measured along the line of sight is 30° + 3º. Find the maximum and
minimum heights the building can be.
3.16 The range of an object shot at an angle with respect to the x-axis and an
initial velocity vo (see Figure P3.16) is given by
Range = sin (20)
g
for 0 SAS 7/2 and neglecting air resistance. Use g=9.81 m/s and an
initial velocity vo of 100 m/s. Show that the maximum range is obtained
at approximately 0 = 7/4 by computing the range in increments of 7/100
between 0 OT/2. You won’t be able to find the exact angle that results in
the maximum range, because your calculations are at evenly spaced angles
of /100 radian.
Complex Numbers
3.22 Consider the circuit shown in Figure P3.22, which includes the following:
• A sinusoidally varying voltage source, V.
• An inductor, with an inductance, L
• A capacitor, with a capacitance, C.
• A resistor, with a resistance,
We can find the current. I, in the circuit by using Ohm’s law (generalized
for alternating currents)
V= IZT
where Zt is the total impedance in the circuit. (Impedance is the AC corol-
lary to resistance.)
Assume that the impedance for each component is as follows:
Z=0+ 5j ohms
Zc=0 – 15j ohms
R= ZR = 5 + Oj ohms
Z1 = Zc+ZR
and that the applied voltage is
V= 10 + Oj volts.
(Electrical engineers usually use jinstead of i for imaginary numbers.)
Find the current, I, in the circuit. You should expect a complex number
as a result. Enter the complex values of impedance into your calculations
using the complex function.
3.23 Impedance is related to the inductance, L, and the capacitance, C by the
following equations:
1
Zc-
wa
ZwLj
For a circuit similar to the one shown in Figure P3.22 assume the following:
C=1 4F (microfarads).
L = 200 mH (millihenries).
R= 5 ohms.
f=15 kHz (kilohertz).
w = 27.
V= 10 volts.
(a) Find the impedance for the capacitor (Z) and for the inductor (Z).
(b) Find the total impedance
2 = 2c + Z+R
D
Figure P3.22
A simple circuit illustrating
a sinusoidally varying
voltage source, V.
What is the log, of 10 when bis defined from 1 to 10 in increments of 1?
3.3 Populations tend to expand exponentially, that is,
P= Pole”
where
P = current population,
Po = original population,
r = continuous growth rate, expressed as a fraction, and
1 = time.
If you originally have 100 rabbits that breed at a continuous growth rate of
90% (r=0.9) per year, find how many rabbits you will have at the end of 10
years.

Still stressed from student homework?
Get quality assistance from academic writers!

Order your essay today and save 25% with the discount code LAVENDER