EML3035 matlab question everything you need is in the file attached EML3035 S19 Homework 1 Due: Mondays, 2/4 ; Wednesdays, 2/1 NOTE: Solve all problems in
EML3035 matlab question everything you need is in the file attached EML3035
S19
Homework 1
Due: Mondays, 2/4 ; Wednesdays, 2/1
NOTE: Solve all problems in a single .m file and submit it to Canvas when you are done.
Problem 1
The Brinell hardness test consists of indenting an spherical tip into the sample material and
using the size of the indentation to calculate the magnitude of the material’s hardness. The
$%
formula used to obtain the hardness is: =
+
+
&'(‘)√’ ),
where, L is the applied load, D is the diameter of the indentor and d is the diameter of the
indentation. For a load of 3000 kg, an indentor diameter of 10 mm and an indentation diameter
of 7.2 mm, write a Matlab program in an .m file that performs the following tasks:
First define the parameters above and print in the command window the values of L, D and d
such as: The load applied in kg is 3000. The diameter of the indentor is….
Then calculate the Brinell hardness based on the formula provided above and print the result in
the command window.
Problem 2
2
Given = .5
2
1
−2
0
3
5.7 9 ,
−1
5
2
a) Solve the following system of equations: . $ 9 = .−19
;
1
b) Calculate the inverse of A.
c) Multiply the last two rows element by element.
d) Calculate the natural logarithm of the first column of A.
Problem 3
5=
Plot the following function = 5)> +, where s represents position and F is force. F should be in
the y-axis and position s in the x-axis. Use a position range going from -10 to 10. Make sure you
use enough points so that the curve looks smooth. In the same figure, plot this other function,
=
;7
√&?
@+
) AB for x going from -8 to 8. Use a different color and line style for this second
function.
Problem 4
Let’s try to manage some of the traffic lights in an 4 way intersection. We will focus just on one
direction. If there’s a car on the left lane, turn both lights (the arrow and the circle) green. If
there’s a car on the right lane and no cars on the left lane, turn the circle light green and keep
the arrow red. If there are no cars, keep both lights red. Pretend you can turn on/off the lights
by just sending written commands using fprintf.
Light
Problem 5
The cost of electricity varies depending on the time of the day. We want to calculate the cost of
using a machine for certain hours each day. Write a program to calculate such cost. We will
input the time we turn the machine on and the time we turn it off. Based on this, your program
has to calculate the total cost of electricity. The machine uses 125,000 W (watts). The cost of
electricity is given below:
Time frame
6AM – 11:59AM
12PM – 8:59PM
9PM – 11:59PM
12AM-5:59AM
Calculate the cost for the following cases:
a) On at 7AM, off at 10PM
b) On at 9AM, off at 4AM
c) On at noon, off at midnight
Cost ($ per kWh)
0.75
1.1
0.6
0.4
Purchase answer to see full
attachment