Professional Documents
Culture Documents
Chemical Engineering Department University of Florida
Chemical Engineering Department University of Florida
University of Florida
ECH 6326 COMPUTER PROJECT No. 1
On my honor, I have neither given nor received unauthorized aid in doing this work. I understand that the
instructor may assign a failing grade in this course as a sanction for honor-code violations.
Signature
********* Please submit this SIGNED page with your project *********
GRADING TABLE
1
Chemical Engineering Department
University of Florida
ECH4323L/ECH 6326 COMPUTER LABORATORY EXPERIMENT No. 1
********* Please submit this SIGNED page with your project *********
GRADING TABLE
Problem Score
1 /3
2 /3
3 /3
4 /3
5 /3
6 /3
7 /3
Average Score /6 = /100
Introduction to MATLAB
Problem 1. Reading Assignment
Read the class handout entitled MATLAB MINIGUIDE.
You are responsible for all the material appearing in the handout.
Learn all the commands mentioned in the section entitled "List of Essential Commands and Operators".
Consult the MATLAB on-line manuals for each command, for example, to obtain help on the command
diary , type help diary.
Problem 2. Access MATLAB in your own computer if in one of the following CIRCA labs
that is most convenient for you:
• CSE 211
• Architecture 118
• Weil Hall 408
• Bryan Hall 232
• Norman Hall G514.
2
(c) Quit from MATLAB (type quit or select Quit from the file menu).
(a) Experiment with all the commands discussed in Section 1.4 of the MATLAB MINIGUIDE ("Overview
of MATLAB Operations").
0.1 0.6 log10 19
(b) Let A = and b =
1.2 0.93672 ln 16
(a) Calculate c = Ab =
Λ(A) =
s1 = 1.6993 + 0.9311i
and
s2 = 0.7773 + 1.8313i
(a) Calculate s3 = s1 + s2 =
s1
(b) Calculate s4 = =
s2 1
(c) Calculate s5 = s1 s2 =
3
(d) Calculate s6 = |s1 s2 | =
Problem 5. Indicate how you would represent the following polynomials using the MATLAB
notation.
Problem 6. Use roots command of MATLAB to find the roots of the following polynomials.
4
(b) N (s) = s5 + 4s + 1 Roots:
Problem 7. Use poly command of MATLAB to find a polynomial with the indicated roots.
5
Chemical Engineering Department
University of Florida
ECH4323L/ECH 6326 COMPUTER LABORATORY EXPERIMENT No. 3A
********* Please submit this SIGNED page with your project *********
GRADING TABLE
Problem Score
1 /3
2 /3
3 /3
4 /3
5 /3
Average Score /15 = /100
6
Consider the rational function
2s + 4
G(s) = (1)
s2 + 4s + 3
Because the numerator and denominator are written as weighted sums of powers of s (that is, written as
standard polynomials), function (1) is said to be written in standard rational form. Noting that in this case
N (s) = 2s + 4 = 2(s + 2)
D(s) = s2 + 4s + 3 = (s + 1)(s + 3)
Calculate C(s) =
Calculate C(s) =
Calculate C(s) =
Calculate C(s) =
7
2s3 + 6s2 − 4s + 3
(a) G(s) =
s5 + 7s4 + 9s3 + 3s2 + 5s + 3
Zeros:
Poles:
Zeros:
Poles:
G(s) =
3s2 + 9s + 6
(b) G(s) =
s3 + 14s2 + 56s + 64
G(s) =
s3 + 2s2 − 4s − 8
(c) G(s) =
s4 + 9s3 + 11s2 + 6s
G(s) =
8
Problem 11. Conversion of rational functions to the rational form
Use the MATLAB command conv to assist you in converting the following standard rational functions
to their equivalent pole-zero form.
6 (s + 1) (s + 2)
(a) G(s) =
(s + 3) (s + 4) (s + 5)
G(s) =
6 (s − 1.55) (s + 0.33)
(b) G(s) =
(s + 1.78) (s + 1.55) (s + 0.27)
G(s) =
9
Chemical Engineering Department
University of Florida
ECH4323L/ECH 6326 COMPUTER LABORATORY EXPERIMENT No. 3B
On my honor, I have neither given nor received unauthorized aid in doing this work. I understand that the
instructor may assign a failing grade in this course as a sanction for honor-code violations.
Signature
********* Please submit this SIGNED page with your project *********
GRADING TABLE
Problem Score
1 /3
2 /3
3 /3
Average Score /9 = /100
10
(a) Generate a pdf file of the graph using the MATLAB print command using the syntax
print –dpdf Filename
where Filename is the name that you want for the PDF file that will be produced (in this case
Filename.pdf).
The –d argument in the print command stands for the word “device”, and hence –dpdf defines a
pdf device (printer). Hence, print –dpdf is interpreted as “print using a pdf printer”. For more
information type help print. You are not required to submit an electronic copy of the PDF file.
(b) Open the PDF file created in Item (a) using a PDF reader of your choice (say, Adobe Acrobat reader,
for example) and print a hard copy. Submit the printed copy of the PDF file.
(c) Create an MS Word document that consists of 1 page. On the top of the page write the caption: “The
following figure is obtained by importing a MATLAB-created PDF file into MS Word”.
Import the PDF file created in Item (a) so that the figure appears immediately after the caption.
Submit a printed copy of this document.
If the resulting MS Word document does not contain a clearly visible graph, or if the figure appears
faint, then repeat Item (a) but using the alternative command
which will create an encapsulated postscript (EPS) file (instead of a PDF file) entitled Filename.eps
that will print in a PostScript printer with a resolution of 300 dpi (the default resolution is 150 dpi),
where “dpi” stands for “dots per inch”. The option -tiff creates a 72 dpi preview that allows the
figure to be visible in an MS Word window in a computer screen. Finally, proceed to import the
EPS file into MS Word. Submit a hardcopy of MS Word document (i.e., PDF-imported figure or
EPS-imported figure) that gives you the best result.
Hint 1: Use the MS Word menu commands Insert . Picture (details vary depending on the version of MS
Word being used).
Hint 2: To prevent the figure from automatically positioning itself in a non-desirable location, select
(you many need to right-click) the inserted figure and adjust its Properties (or select Format Picture
in certain versions). Select Layout . Keep with text. The last step will fix the picture at the insertion
point.
Hint 3: If needed, resize the figure to fit in the page. This can be done by adjusting one of the corners
of the figure, but better results are obtained by proceeding as in Hint 2 but selecting Layout . Size.
Hint 4: You can choose to center the paragraph that contains the set the figure in the middle of the
paragraph.
Remark 1: If you have a vector x in row form and you want to change it to column form you can use the
transpose command (a single apostrophe mark): x=x’
Remark 2: For on-line help on relevant commands for exercise you may type help plot, help
title, help xlabel, and help ylabel.
11
(A) Use a dash-dot line to connect the points.
(B) Include a title, an x-label, a y-label, and a grid. IMPORTANT: include your name and the date
as part of the title of your graph.
The M-file must conform to the following specifications:
(i ) The first line of the M-file starts with the comment character %, followed by a statement indi-
cating the file name.
(ii ) The second line of the M-file starts with the comment character %, followed by your name and
the date.
(iii ) The third (and optionally also the fourth) line of the M-file starts with the comment character
%, followed by a brief description of what the M file does.
(iv ) The M-file should generate a table of results that lists the values of the cosine for all the points
in the plot. For your reference, the first 3 entries in the table should appear as follows:
x cos(x)
------ ------
0 1.0000
0.2000 0.9801
0.4000 0.9211
Note that the character "x" is approximately centered with respect to the dashed lines in the first
column, and the string "cos(x)" is located exactly above the sequence of dashes on the second
column. Finally, note that the dashes in both columns are positioned in such a way that they
are aligned with the column of numbers lying below.
Remark 1: you may find useful the commands disp and num2str; type help disp and help num2str
for on-line help.
Remark 2: if your vector x is in row format, you can transpose it to a column form using the MATLAB
command: x = x’ where the prime mark (’) denotes a transposition.
(a) Print the plot and submit a hardcopy.
12