# MATLAB GUIs or virtual laboratories to support learning of system analysis and design

A number of GUIS have been developed to act like virtual laboratories. These allow students to interact with a scenario a little like in a laboratory by changing parameters and viewing the impact. The intention is that students can check behaviours against expected behaviours and thus reinforce their understanding of key priniciples, analysis techniques and systems.

GUIs are written so that students do not need MATLAB skills, however they do need the basic awareness of how to ensure MATLAB can find the file they wish to run. ADVICE: (i) Create a folder on your computer; (ii) copy the GUI files (usually a *.p and *.fig file) to this folder; (iii) move MATLAB to this folder and (iv) run the file by typing its name in the command window. A simple illustration of this via screen dumps is given here. |

The available GUIs are listed nexted. With each of these there is a separate file which gives some of the modelling and theoretical background to the simulations.

- Matlab GUIs - 1st order responses.
- Matlab GUIs - tank level system.
- Matlab GUIs - tank level with disturbances.
- Matlab GUIs - mixing tank.
- Matlab GUIs - house temperature.
- Matlab GUIs - servo position control.
- Matlab GUIs - cruise control.
- Matlab GUIs - experimental modelling of a DC servo.
- Matlab GUIs - landing aircraft.
- Matlab GUIs - Heat exchanger.
- Matlab GUIs - Heat exchanger with disturbances.
- Matlab GUIs - gain and phase cross-over frequencies and margins.
- Matlab GUIs - Aeroplane roll example with lead compensator design.
- Matlab GUIs - satellite tracking with a radar and lag compensator design.

## Matlab GUIs - 1st order responses

Demonstrates the dependence of 1st order step responses on the time constant and gain. View the corresponding section for information on these responses.

- A summary of the GUI and how it works is given in the pdf file.
- The GUI (a MATLAB p-file and fig file) are available here (both needed).

## Matlab GUIs - tank level system

Illustrates the behaviour of a single tank model (see section on 1st order models) with and without feedback to control the input flow rate. Users can change the PI parameters and thus investigate the impact of different choices on behaviour; the behaviour reduces to standard 1st order and 2nd order dynamics.

- A summary of the GUI and how it works is given in the pdf file.
- The GUI (a MATLAB p-file and fig file) are available here (both needed).
- A short video demonstration of how to use the files.

## Matlab GUIs - tank level with disturbances

This GUI builds on the previous one and introduces uncertainty that is present in real world scenarios. The main purpose is to help students understand the need for closed-loop control. The system is affected by small but time varying disturbances to the inflow rate and outlet resistance. Users are challenged to maintain the desired depth in the tank using open-loop or manual control (dynamically changing the in flow directly through a slider) and then to compare this with automatic control.

- A summary of the GUI and how it works is given in the pdf file.
- The GUI (a MATLAB p-file and fig file) are available here (both needed).
- A short video demonstration of how to use the GUI.

## Matlab GUIs - mixing tank

Illustrates the behaviour of a simple mixng tank common in chemical engineering (see section on 1st order models). Users can change the tank volume, flow rate, inlet concentration and initial tank concentration and thus observe the impact of these changes on the concentration in the tank over time. The behaviour reduces to standard 1st order dynamics so students can compare with the expectations of the corresponding analysis.

- A summary of the GUI and how it works is given in the pdf file.
- The GUI (a MATLAB p-file and fig file) are available here (both needed).
- A short video demonstration of how to run this gui is available here.

## Matlab GUIs - house temperature

Illustrates the behaviour of a simple heating system (see section on 1st order models).

In the first GUI, users can change the heat capacitance, the heat loss coefficient, the target temperature and the PI compensators used to control the heat supply. The behaviour reduces to standard 1st and 2nd order dynamics (depending on whether integral is included) so students can compare with the expectations of the corresponding mathematical analysis.

The second GUI has a similar scenario but fixes the model parameters and allows students to compare between the use of PI control and a simpler on-off control with a dead-band.

- A summary of the GUI and how it works is given in the pdf file.
- First GUI (a MATLAB p-file and fig file) are available here (both needed).
- Second GUI (a MATLAB p-file and fig file) are available here (both needed).

## Matlab GUIs - servo position control

Demonstrates the use of PI compensation in order to realise position control of an object moved by a DC servo. The underlying model for the DC servo is an over damped 2nd order model and it moves a man on a seat. Users can manipulate the choices of PI paramters to investigate their impact on behaviour.

- A summary of the GUI and how it works is given in the pdf file.
- The GUI (a MATLAB p-file and fig file) are available here (both needed).

## Matlab GUIs - cruise control

Demonstrates how PI control is effective for cruise control of a car. Specifically it allows the user to explore the impact of uncertainty on the behaviour of speed. This GUI allows for variations in the car mass, engine power and road slope, that is three different types of realistic uncertainty.

- A summary of the GUI and how it works is given in the pdf file.
- The GUI (a MATLAB p-file and fig file) are available here (both needed).

## Matlab GUIs - experimental modelling of a DC servo

Demonstrates an experimental technique for finding the parameters of a 1st order model representing the dynamics of a DC servo (between applied voltage and steady-state velocity). Students are encouraged to use the GUI in a formulaic way to represent the processes required with equipment.

- A summary of the GUI and how it works is given in the pdf file.
- The GUI (a MATLAB p-file, fig file and a simulink file) are available here (all 3 are needed).

## Matlab GUIs - landing aircraft

This GUI is a bit of fun and looks at 2nd order dynamics (Mass-spring-damper) through the passenger motion of a landing aircraft. Users investigate the effects of different choices on passenger comfort.

- A summary of the GUI and how it works is given in the pdf file.
- The GUI (a MATLAB p-file and fig file) are available here (both needed).

## Matlab GUIs - heat exchanger

This GUI illustrates the dynamic behaviour of a simple steam powered heat exchanger. The key variables are the temperature of the inlet flow, the flow rate through the exchanger, the tank volume and the flow rate of steam. As the USER modifies each of these, they will be able to oberve the impact on outlet temperature dynamics.

- A summary of the GUI and how it works is given in the pdf file.
- The GUI (a MATLAB p-file and fig file) are available here (both needed).
- A short video demonstration of how to use this GUI.

## Matlab GUIs - heat exchanger with disturbances

This GUI builds on the previous one and introduces uncertainty that is present in real world scenarios. The main purpose is to help students understand the need for closed-loop control. The system is affected by small but time varying disturbances to the inflow temperature and flow rate. Users are challenged to maintain the desired outlet temperature using open-loop or manual control (dynamically changing the steam flow directly through a slider) and then to compare this with automatic control.

- A summary of the GUI and how it works is given in the pdf file.
- The GUI (a MATLAB p-file and fig file) are available here (both needed).
- A short video demonstration of how to use this GUI.

## Matlab GUIs - gain and phase cross-over frequencies and margins

This GUI is focussed on process for finding gain and phase margins and the intermediate computations for gain and phase cross over frequencies. It is designed to help students think systematically about the required computations and ordering and thus takes them through one step at a time, encouuraging some reflection or individual work to compare with the answers provided.

- A summary of the GUI and how it works is given in the pdf file.
- The GUI (a MATLAB p-file and fig file) are available here (both needed).

## Aeroplane roll example with lead compensator design

This GUI is focussed on the process of finding a lead compensator for roll control in an aircraft, and of course assessing the efficacy and limitations. Students are able to see the Bode and root-loci diagrams and select the lead parameters as well as viewing the impact on behaviour. The aeroplane time constant and gain can also be changed.

- A short video introduction to the GUI is available here.
- A summary of the GUI and the underlying context is given in the pdf file.
- The GUI (a MATLAB p-file and fig file) are available here (both needed).

## Matlab GUIs - satellite tracking with a radar and lag compensator design

This GUI is focussed on the process of tracking a satellite, or other flying object, with a radar. The GUI assumes given radar dynamics and that the tracking problem is equivalent to following a ramp target. Lag compensation is used to increase the low frequency gain. Students can test the efficacy of different uplifts in low frequency gain.

- A short video introduction to the GUI is available here.
- A summary of the GUI and the underlying context is given in the pdf file.
- The GUI (a MATLAB p-file and fig file) are available here (both needed).