Note that to complete this assignment, you will be asked to write a structure plan / pseudocode for each

problem. The structure will be similarly to the “Given/Find” format you are familiar with from other

homework assignments. Similarly, actually writing functioning code will fulfill the “Solution” portion of

the problem-solving format. It is expected that you use MATLAB to test your script files.

Problem 1 (5 points) (modified version of Exercise 8.13 from textbook, page 126)

A projectile is launched from the point O with an initial velocity of 55 m/s at an angle of 50 degrees to the

horizontal. Write a program which computes and displays the time in the air, and horizontal and vertical

displacement from the point O every 0.5 seconds, as long as the projectile remains above a horizontal plane

through O.

Hints:

• Use a while loop for this problem.

• Use the disp() function to display the results in table format. The char() function can be used within

the disp() to make the columns line up nicely. For example:

disp([‘t = ‘,num2str(t),char(9),char(9),’x = ‘,num2str(x,’%10.1f’)])

Deliverables:

• Hardcopy of your M-file containing your structure plan describing how you plan to solve the

problem along with your executable code.

Problem 2 (10 points) (Problem 3 from Homework 4)

Recall the vertical tank problem from Homework 4. (See Homework 4 for details).

For this homework assignment, plot Volume and Weight as a function of height of solid in the tank (put

height on x-axis). Set the bounds and major gridlines such that the data series for volume and weight are

superimposed on each other. Assume the following parameters:

a. Total height of the tank: ℎ = 20 𝑓𝑓𝑓𝑓

b. Diameter of the cylinder: 𝐷𝐷 = 10 𝑓𝑓𝑓𝑓

c. Angle of the cone: 𝜃𝜃 = 35 𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑.

d. Bulk density of solid contents: 𝛾𝛾 = 25 𝑝𝑝𝑝𝑝𝑝𝑝.

Hint: If you want dual y-axis, the book recommends using plotyy(), but this is not recommended. Check

online documentation for plotyy() and it will link to yyaxis, a better solution.

Deliverables:

• Hardcopy containing the following:

o Your M-file containing your structure plan describing how you plan to solve the problem

along with your executable code.

o Figure showing the plot of the data.

Problem 3 (10 points) (modified version of Exercise 9.1 from textbook, page 232)

Draw a graph of the population of the USA from 1790 to 2000 using the (logistic) model:

𝑃𝑃(𝑡𝑡) = 197,273,000

1 + 𝑒𝑒−0.03134(𝑡𝑡−1913.25)

where t is the date in years.

Actual data (in 1000s) for every decade from 1790 to 1950 are as follows:

Years Population

(in 1000s) Years Population

(in 1000s) Years Population

(in 1000s)

1790 3,929 1850 23,192 1910 91,972

1800 5,308 1860 31,443 1920 105,711

1810 7,240 1870 38,558 1930 122,775

1820 9,638 1880 50,156 1940 131,669

1830 12,866 1890 62,948 1950 150,697

1840 17,069 1900 75,995

Superimpose this data on the graph of P(t). Plot the data as discrete circles (i.e. do not join them with lines).

Hint: Your plot should look similar to Figure 9.16 on page 233 of the textbook.

Deliverables:

• Hardcopy containing the following:

o Your M-file containing your structure plan describing how you plan to solve the problem

along with your executable code.

o Figure showing the plot of the data.

Problem 4 (15 points) (modified version of Exercise 8.12 from textbook, page 195)

A student borrows $10,000 to buy a used car. Interest on her loan is compounded at the rate of 2% per

month while the outstanding balance of the loan is more than $5000, and at 1% per month otherwise. She

pays back $400 every month, except for the last month, when the repayment must be less than $400. She

pays at the end of the month, after the interest on the balance has been compounded. The first repayment is

made one month after the loan is paid out. Write a program which displays a monthly statement of the

balance (after the monthly payments has been made), the final payment, and the month of the final payment.

Hint: Use a while loop for this problem.

Deliverables:

• Hardcopy of your M-file containing your structure plan describing how you plan to solve the

problem along with your executable code.

Name _________________________________________

Last, First

Problem 1 (5 pts)

Below Avg. (4 pts) Average (7 pts) Excellent (10 pts) Points

Problem attempted, but

incorrect, and poor

attempt at structure plan.

Solution has minor errors or

incomplete structure plan.

Correct numerical solution.

Well documented M-file &

structure plan.

Problem 2 (10 pts)

Below Avg. (4 pts) Average (7 pts) Excellent (10 pts) Points

Problem attempted, but

incorrect, and poor

attempt at structure plan.

Solution / plot has minor errors or

incomplete structure plan.

Correct solution numerical

solution with well-presented

plot.

Well documented M-file &

structure plan.

Problem 3 (10 pts)

Below Avg. (4 pts) Average (7 pts) Excellent (10 pts) Points

Problem attempted, but

incorrect, and poor

attempt at structure plan.

Solution / plot has minor errors or

incomplete structure plan.

Correct solution numerical

solution with well-presented

plot.

Well documented M-file &

structure plan.

Problem 4 (15 pts)

Below Avg. (4 pts) Average (7 pts) Excellent (10 pts) Points

Problem attempted, but

incorrect, and poor

attempt at structure plan.

Solution has minor errors or

incomplete structure plan.

Correct numerical solution.

Well documented M-file &

structure plan.

General Requirements (10 pts)

Requirement Unacceptable

(5 pts)

Expected

(10 pts)

Points

Use provided cover sheet.

If any of the

requirements are

missing or do not

meet specification.

All format

requirements

met.

Header on each page (Course, Assignment, Name, page #).

Single sided print copy.

Each problem on a new page (single sided).

Pages in correct order.

One staple in the upper left corner.

Final answers boxed / highlighted.

Clear / Neat formatting.

Excel file submitted to D2L