ISE212Engineering Computing: MATLAB Spring_2015

Homework #1 Due: Monday 2/16/2015

Upload your HW1 assignments to the TA by going to Content in Blackboard:

1. Write an executable script file (m-file) that takes no input and returns a vector solving the following system of equations using matrix operations. (Determine the values of s, u, p, w, and v). Also, include the inverse of the left-hand coefficient 5x5 matrix. Use plenty of comments to annotate your code and include your name in the m-file.

(Name your m-file> solutions2015.m).

2s + 5u + 1p-2w+ 3v= 10

3s+ 6u + 8p + 10w +3v = 15

9s + 9u + 7p + 5w +1v = 14

6s + 7u + 8p + 9w+ 5v=27

2s + 4u + 6p - 8w + 7v = 30

Ans=

2. Manufacturing Cost Analysis:

The table below shows the hourly cost of four types of manufacturing processes. It also shows the number of hours required of each process to produce three different products. Use matrices and MATLAB to solve the following:

> Determine the cost of each process to produce one unit of product#1.

> Determine the cost to make one unit of each product.

> Suppose you produce 14 units of product#1, 10 units of product#2, and 9units of

Product#3. Provide the total cost for this scenario.

Write an executable script file (m-file) that takes no inputs to return your solutions.

(Name your m-file: mca2015.m).

Table: Cost and Time Data for Manufacturing Process

Hours Required to Produce One Unit

ProcessHourly Cost $Product#1Product#2Product#3

Lathe20 3 3 1

Grinding22 2 2 3

Milling25 1 2 2

Welding30 2 1 4

Ans=

3. Write an executable script file (m-file) that takes no input and creates a table of temperatures in Celsius and the respective conversion in Fahrenheit for 0°C to 90°C with 10°C intervals. (Note: display each temperature with two decimal digits). (Name your m-file > CtoF2015.m).

Ans=

4. The force required to compress a linear spring is given by the equation: F = kx where Fis the force in newtons and k is the spring constant in newtons per meter. The potential energy stored in the compressed spring is given by the equation: E = kx2/2 where E is the energy in joules. (See figure below).

Write an executable script file (m-file) that takes no inputs and returns the displacement and stored energy of a spring system after prompting the user for the 1) input forces (in N) on the spring and 2) the spring constant (in N/m).Use plenty of comments to annotate your code and include your name in the m-file.

(Name your m-file> energy2015.m).

Ans=

5.A Watson engineering student has just has decided to spend $1,500 on a new home theater system. He took out a four-month loan with a “nominal” yearly rate of 9% (but really3/4% per month). If this student wants to pay the same amount every month, how much will he have to pay? Write an executable script file (m-file) that takes no input and calculates this amount. Also, display a table with the interest accrued, payment on the principal amount, and ending balance for each month with proper numerical formatting (i.e. no scientific notation). (Name your m-file> loan15.m).

The following formula is used to calculate the fixed monthly payment (A) required to fully amortize a loanof P dollars over a term of n months at a monthly interest rate of i. [If the quoted rate is 6%, for example, i is 0.06/12 or 0.005].

A = P[i(1 + i)n]/[(1 + i)n - 1]

6. Write an executable script file (m-file) that takes no input and createsa row vector for theater Wildfire and a row vector fortheater Vestal, having 5 showings at each location whereWildfire has each movie being2h 15minsin length and Vestal being 2hin length. Movies at both locations start at 1PM.

Then make a theater matrix (2x5) by combining the two row vectors.

Finally extract the three late movie showings for each theater into a late theater matrix.

(Name your m-file> movies15.m).

Ans:

THE END