Exam 2 Review
Supplemental Instruction
Iowa State University / Leader: / Zach
Course: / Ch E 160
Instructor: / Heinen & Haman
Date: / 4/9/17

Economics Equations:

MATLAB:

State the value of the variable that results from each of the MATLAB commands.

T = 4;T =

while T <= 52

T = T*2 ;

end

z(1,1) = 40; z =

for count = 2:5

z(1,count) = z(1,count-1) / 2;

end

x = 2;answer =

if x > 10

answer = 55;

elseif x > 4 & x < 10

answer = 34;

else

answer = 22;

end

Plot the following data and fit a curve (trend line) to model the data.

Time (s) / Voltage (V)
6 / 98
10 / 62
17 / 23
25 / 9.5
32 / 3.2
38 / 1.9
42 / 1.3
  1. Assign the time values to column vector ‘T’.
  1. Assign the voltage vectors to column vector ‘V’.
  1. Graph the data on a rectangular axis blue-filled circles with red outlines, and again on a semilog axis with yellow filled triangles with black outlines. Display both stacked vertically using subplot with rectangular on top plot and semilog on bottom plot. Add title and axis labels.

Write a nested for loop to create the following matrix:

Write out this matrix by hand.

for r = 1:3

for c = 1:4

matrix(r,c) = 3*r – c ;

end

end

Use matrix algebra to solve the linear algebraic equations below:

3x – 5y + 8z = 19

2x + 14y +7z = 29

4x + 5y – 6z = 17

Create a function that calculates the Reynolds number for a fluid given density, velocity, viscosity, and diameter. The equation for calculating a Reynolds number is . After your function is created, run the function using ρ=1.31,V=8.25, D=0.50, and μ=1.28*10-3. Reynolds numbers ˂ 2000 are considered laminar, while Reynolds numbers above ˃ 4000 are considered turbulent. 2000 ˂ Re ˂ 4000 are transitional flows. End your function with an If/Elseif/Else loop that classifies the flow. (Don’t worry about units for this one).

A Reynolds number is defined by . Use a while loop to find the maximum fluid velocity while keeping a laminar flow. Use the values ρ=1.31, D=0.50, and μ=1.28*10-3. Start at a velocity of 1 and increase by 0.5 for each iteration. Reynolds numbers ˂ 2000 are considered laminar. Use fprintf to display the velocity. (Don’t worry about units for this one).

A loan of $32,000 is to be paid in monthly installments over 4 years at an annual interest rate of 6.2% compounded monthly. Calculate the monthly payment.

Calculate the APR for a 30-year, $260,000 home mortgage, with annual interest of 7.25%, compounded monthly.

Two machines are being considered to do a certain task. Machine A costs $24,000 new and $2,600 to operate and maintain each year. Machine B costs $32,000 new and $1,200 to operate and maintain each year. Assume both will be worthless after 12 years and that the annual interest rate is 3.2%. Determine which machine is the better purchase. Include a cash flow diagram for each machine. Solve using EUAC values.

Repeat the last problem, but this time assume that Machine A can be sold for $1400 and Machine B can be sold for $2800 at the end of the 12 years. Does this change which machine is more cost-effective? Assume all other costs and the interest rate is unchanged.