1. Plotting Shapes
a. Create a figure, with the following specifications:
0. xlim should be [0 10]
1. ylim should both be [0 10]
2. draw a box of size 2x3 somewhere on the 10x10 grid (using hold on)
3. the left line of the box should be green
4. the right line of the box should be red
5. the top of the box should be blue
6. the bottom of the box should be magenta or cyan
Bonus: the script should save the figure as “box.PNG”
. Create another figure, with the following specifications
1. It should have a flower with 7 equally spaced red petals (angles between all petals should be equal).
2. The center of the flower should have circle with a solid yellow infill.
Bonus: the script should save the figure as “flower.PNG”
2. SVM and Animation of Simple Mechanical System (Figure 2.12a of reference [1])
a. In your report, give the FBD of the system shown
. In your report, give the State Variable Equations for the system shown
c. In your report, give the matrix form of the State Variable Equations
d. Write a code which evaluates the system response to a unit step input.
e. Modify your code to animate the system response found above (you can use ‘*’,’s’, or
‘o’ options)
Bonus: include a spring in your animation.
3. SVM of Complex System (Figure P2.5 of Reference [1], shown below)
a. In your report, give the FBD of the system shown
. In your report, give the State Variable Equations for the system shown
c. In your report, give the matrix form of the system shown
d. Write a code which evaluates the system response to a unit step input
e. plot x1 vs time, x2 vs time, x3 vs time
Bibliography
[1] D. F. J. N. C.M. Close, Modelling and Analysis of Dynamic Systems, NY: Wiley & Sons, 2002.