Computer Tools Final Exam

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

1. CREATE A WORD DOCUMENT.

2. Copy and Paste your m file, Simulink Model, and Result onto Word documents.
3. Add comments if the question requires it.
4. Upload word document, m-files, and Simulink model on Canvas!
5. Only methods, materials, approaches, and functions we have used during the class time are
allowed!
1. (20 Point) A system is known to have the following dynamic equations

(*x indicates product)

Draw the 3 D image of the states (x 1,x2, and x3) by using ode45() function and plot3() function with the
given values for a, b, c, d, and e. a=9.1, b=-0.75590,c=-1.39386,d=16.5811, and e=0.138083. Use your U-
number for the initial conditions. Please follow the format, [Your 1st U-number. Your 2nd U-number,
Your 3rd U-number. Your 4th U-number, Your 5th U-number. Your 6th U-number ]. (EX U12345678 =>
initial conditions = [1.2, 3.4, 5.6])

 In the first equation, pairs of [ ], { } and ( ) was used for emphasis purpose. Please, check
where the other part is placed.
 Use abs() function for |x1+1| or |x1-1| (i.e. |x+1|=> abs(x+1) in matlab)
 x (NOT x1,x2, and x3!) indicates multiplication.
 Do not forget to put grid on in the plot and also Do not forget to label axis. (Use xlabel,
ylabel, zlabel. zlabel('x_3') will put x3 on the z-axis.)

0
x3

-2

-4

-6

-8
1.5
1
5
0.5
0
-0.5 0

-1
x2 -1.5 -5 x1

Figure 1 Suggested Output

*Upload an m-file for this problem!


2. (15 Point) Redo Problem 1 by using “for loop”. (Hint: You can use materials on pages 49 – 54
in Matlab_Lecture008.pptx.)

3. (15 Point) A system is known to have the following input and output relationship. (y output,
f input)
y’’’+3y’’+y’+2y=f”+3f’+2f.
A) Create a Simulink model based on this system (Do not Use Transfer function block. Use
Integrator (1/s), Gain block, and adder (or subtractor) for Transfer function.)
B) Create a M-file based on this system. Use “dsolve” function to find y(t)
The input f(t) is te-0.5t. Assume zero Initial Conditions

4. (10 Point) Find the convolution between two signals – graphically.

https://slideplayer.com/slide/17251150/

5. (10 Point) Use Matlab to draw the following REPEATING signal -f(t). Use the given
coefficients.

1.1

0.9

0.8

0.7

Keep in mind – during class demonstration, bn was zero. 0.6

0.5

0.4

0.3

0.2

0.1
0 2 4 6 8 10 12 14 16
6. (20 Point) Repeat problem 1 and 2 by creating Simulink model simulation.
A) Export states’ x1, x2, and x3 onto workspace.
B) Plot x1,x2, and x3 by using plot3 function.
C) Plot result from problem 1, problem 2, and problem 3 in a single figure.
D) Use legend and different line pattern for indication.
E) Compare the result. Do you see any difference? If you see any difference, brief explain why
there is / are differences.

--------------------------------------------------------------------------------------------------------------------------------
A system is known to have the following dynamic equations

(*x indicates product)

Draw the 3 D image of the states (x 1,x2, and x3) by using ode23() or ode45() function and plot3() function
with the given values for a, b, c, d, and e. a=9.1, b=-0.75590,c=-1.39386,d=16.5811, and e=0.138083 and
given initial conditions [Your 1st U-number. Your 2nd U-number,, Your 3rd U-number. Your 4th U-
number, Your 5th U-number. Your 6th U-number ]. (EX U12345678 => initial conditions = [1.2,3.4,5.6])

Leave comments on the word document on the differences among result from q 1, q 2, and q 6. What do
you think have caused the difference?)

7. (10 Point) For the system given below,

y[k+2]-0.9y[k+1]+0.2y[k]=f[k+2]+2f[k] with initial conditions y[-1]=-1,y[-2]=2. f[k] = exp(-k)u[k].

Find y[k] iteratively. (Use methods on Pages 72 – 75 in Matlab_Lecture008.pptx)

You might also like