1 attachmentsSlide 1 of 1

  • attachment_1attachment_1


Graphical User Interface Goal To gain familiarity with the Matlab Graphical User Interface (GUI) by: • Creating a simple GUI to interpolate Thermodynamics tables. Submission guidelines Upload a zip file (compressed file, .zip extension) containing the GUI function .m file and the GUI figure .fig file. Both files should have the same name. The difference is the extension: .m and .fig Key functions handles guidata(hObject,handles) callback functions str2double loops if statements Problem to be solved 1 For a given temperature, we can obtain other properties such as enthalpy (h), relative pressure (Pr) or relative volume (Vr). Similarly, given a different property, such as enthalpy, we can also obtain the other properties that go along with such enthalpy. The problem arises when we need to look up properties for a temperature (or any other property) that is not directly given in our table. For instance, if my temperature is 326.3 K, what is the value of the other properties for such temperature? Or if my relative pressure (Pr) is 1.185, what is the value of the other properties corresponding to such Pr? In these cases, we need to interpolate. The primary objective of your GUI will be to perform such interpolation for you given the value of one of the properties. Interpolation equation Let’s think general. Imagine we know a variable with a value of x, which falls between values x1 and x2 given in the table. For such value of x, we need to find the value y of another variable. Figure 2 summarizes this idea in a graphical way. 2 Basic design of GUI This projects admits flexibility with the GUI design. At the very least, it should present the components shown in Figure 3. 3 T h Pr Eng. Units Vr Clear Figure 3. Basic GUI design. It contains 4 text boxes for temperature (T), enthalpy (h), relative pressure (Pr) and relative volume (Vr). Also, a units radio button and a clear push button. Your GUI must at least contain: • • • 4 text boxes for temperature (T), enthalpy (h), relative pressure (Pr) and relative volume (Vr). A units radio button. The default units will be SI units. By clicking in the radio button, the user can interpolate values in the English units table. A clear push button that will erase all text boxes. NOTE: the units radio button is not a units conversion button. It does not convert units. It is simply a way to choose which table you want to work with, either the one with SI units or the one with English units. The way the GUI should work Once completed, the way the GUI should operate is as follows: the user types in a value for one any of the 4 properties (temperature, enthalpy, relative pressure or relative volume) in the respective text box and when it hits enter, the rest of the text boxes should populate with the proper interpolated values for those properties. If the user enters a value that is out range, the GUI does not have to do anything. If it causes an error, it is okay, it is the user’s fault. The user can simply press CLEAR in the GUI and enter a proper value next time. 4 When the user clicks on the CLEAR button, it should erase the content of all 4 text boxes at once. When the user wants to work with the English units table, it should select the radio button and then enter a property value in the corresponding text box. You can use the SI units table as the default one. Table range You do not need to type in the whole A-17 and A-17E tables into Matlab. You can limit yourself to the range of values shown in Figure 1. Keep in mind the only variables required for this GUI are temperature, enthalpy, relative pressure and relative volume. You can ignore the rest. You will have to manually enter the values for such properties in your script. You can do so by creating two matrices: one for table A-17 and another for table A-17E. You can define these matrices in the Opening function (OpeningFcn) of your GUI script. 5

Do you similar assignment and would want someone to complete it for you? Click on the ORDER NOW option to get instant services at essayloop.com

Do you have a similar assignment and would want someone to complete it for you? Click on the ORDER NOW option to get instant services at essayloop.com. We assure you of a well written and plagiarism free papers delivered within your specified deadline.