Professional Documents
Culture Documents
Cse522 12 hw2 Q
Cse522 12 hw2 Q
Cse522 12 hw2 Q
Fainekos
Homework 2 - Due 2012.02.2 - Total Points: 100
Instructions
Important: Start the homework early. The homework contains a programming exercise and it could be time consuming if you do not know how to use the software tool. Exercise x.y means Lee & Seshias textbook Exercise y in Chapter x. HW submission policy: The instructions on HW1 still apply. Study groups: The instructions on HW1 still apply. Reminder: each person must submit his/her own answers and mention the other members of his/her discussion group. Please download the updated tutorials for Matlab/Simulink/Stateow from Blackboard under Content > Tutorials. Please review the Stateow tutorial before attempting the HW problems. The Simulink les have been posted on Blackboard so you can replicate the results you observe on the tutorial slides.
Exercises
1. Lee & Seshia 3.1 [30pt] With the following changes: (c) Replace once per day with once every 24hr. This means that (i) the output should be present at the rst reaction over 38 degrees (rather than some other point in the 24hr interval time) and (ii) if a second event as in 3.1(b) occurs within a 24hr period it should be ignored. (d) Implement each version of the state machine in Simulink/Stateow. Note that the semantics of Stateow state machines do not match the semantics of the state machines dened in the book. A Simulink/Stateow template is provided. The template already includes a Stateow chart where within you must develop your solution. In detail, we will assume that the temperature behaves according to the equation (t) = 36 + 4 sin(/12t) + 2 sin(/3t) where t ranges in hours. The events are generated every 1 hr. Our goal is to simulate the system for 2 days, i.e., 48 hours, and plot the output signal event. Your answers should only provide the state machines for parts (a)-(c) and the Stateow charts and the scope graphs for part (d). All the Simulink/Stateow les must be submitted on Blackboard. Grading: (a)-(c) 5 points each, (d) 15 points
2. Lee & Seshia 3.3 [20pt] Note: For part (c), you must show the new state machine and you cannot create new events or variables. Alsomerging does not mean that you will create a hierarchical state, but rather that you have to combine the two states into one while maintaining all the possible transitions and system behaviors. Grading: (a), (b) 5pt each, (c) 10 pt 3. Lee & Seshia 3.5 [5pt] 4. Lee & Seshia 5.2 [10pt] 5. Lee & Seshia 5.3 [25pt] (a) [10pt] Construct a single state machine C representing the composition. Which states of the composition are unreachable? (b) [15pt] Use the provided Simulink/Stateow templates to model the cascade composition of the two state machines A and B in Simulink/Stateow. You need to provide a timetriggered and an event-triggered model. The Statecharts that you design must have the same number of states as the FSM A and B in the textbook. Make sure that the models that you construct output on signal c the expected behavior that you would get from machine C. 6. Lee & Seshia 7.2 [10pt]