Professional Documents
Culture Documents
Assignment One - Solutions
Assignment One - Solutions
Family Name:
First/Given Name:
Student Number:
1. The following data represent the radial intensity of a radio-frequency plasma obtained by
scanning the plasma with an optical spectrometer.
Radius (mm) 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
Intensity (cps) 49274 49274 46541 45423 44551 40707 33570 28643 20877 16443 8809
Also, the following equation is a 3rd order polynomial which has been fit to the data points
above using the least-square regression method.
𝐼 = 135.65𝑟 3 − 2679𝑟 2 + 1971.9𝑟 + 48768
Develop a simple m-file in MATLAB to plot both the data points and the fitted curve in one
figure.
Your m-file should include the following:
Print your m-file in the box below. Also, after plotting the graph, in the plot window, “save-
as” your image with JPEG format, paste it in a word document and print it. Then cut it and
paste it in the designated box.
1
Staple Here
m-file
clear
clc
hold on
Plot
2
Staple Here
2. The Genco Olive Oil Company intends to sell its oil products to the customers in 1-Liter
cylindrical cans. The owner has asked you to minimize the cost of metal sheet for fabricating
the cans. To fulfill his request:
a) First obtain a formula for the surface area 𝐴 of the can in terms of its base radius 𝑟.
(Hint: Remember that the container has to have a lid as well).
b) Then using the Newton-Raphson method and the formula you obtained in the previous
part, find the base radius 𝑟 for which the surface area and, as a result, the metal sheet
required to fabricate the can is minimum. Use 𝑟 = 10 𝑐𝑚 as you initial guess and
continue your iterations to achieve a relative error of less than 1%. Use the table
provided below to organize your calculations. Write the details of your calculations for
the first two iterations and keep 4 significant figures after the decimal point. (First fill out
the table and then print the page).
c) What would be the height ℎ of the cans?
Newton-Raphson Method:
iteration 𝑟, 𝑐𝑚 𝑓(𝑟) 𝑓 ′ (𝑟) 𝜀𝑎 (%)
1 10 105.6600 16.5660
2 3.6219 −106.9499 96.7557 176.1000
4.7272 −30.0960 50.4310 23.3828
5.3240 −3.6574 39.0719 11.2091
5.4176 −0.0639 37.7216 1.7278
𝟓. 𝟒𝟏𝟗𝟑 0.0000 37.6980 𝟎. 𝟎𝟑𝟏𝟑
< 𝟏%
Calculations:
3
Staple Here
4
Staple Here
3. First, explain the difference between truncation error and round-off error. Then using the
Taylor series expansion, derive an expression for the truncation error due to approximating
the 2nd derivative of 𝑓(𝑥) at 𝑥 = 𝑥0 using the following relation. Also determine the order 𝑛
of the error for this approximation.
4. First plot 𝑓(𝑥) = 𝑥 2 |cos(√𝑥)| using the grid provided below by finding some (at least 25)
points and then connecting the points using a smooth curve. Next, based on the insight
obtained from plotting the function, use the false-position method to determine the smallest
positive root of 𝑥 2 |cos(√𝑥)| = 0.5 where 𝑥 is in radians. Use the table provided below for
your iterations and calculations. In solving the problem use a stopping criterion of 𝜀𝑠 = 0.5%.
Write the details of your calculations only for the first two iteration. In your calculations, keep
4 significant figures after the decimal point. (First fill out the table and then print the page).
5
Staple Here
False-Position Method:
iteration 𝑥𝑙 𝑥𝑢 𝑓(𝑥𝑙 ) 𝑓(𝑥𝑢 ) 𝑥𝑟 𝑓(𝑥𝑟 ) 𝑓(𝑥𝑙 ) × 𝑓(𝑥𝑟 ) 𝜀𝑎 (%)
1 0.2 1.2 0.4639 −0.1590 0.9447 −0.003089 −0.001433
2 0.2 0.9447 0.4639 −0.003089 0.9398 0.0002941 0.0001364 0.5241
3 0.9398 0.9447 0.0002941 −0.003089 𝟎. 𝟗𝟒𝟎𝟐 −0.0000003891 −0.0000000001144 𝟎. 𝟎𝟒𝟓𝟓𝟒
< 𝟎. 𝟓%
6
Staple Here Answer Sheet
Page Number: 7