Programming Concepts Graphical User Interface Project

Slide 1 of 3

EML 3035 – Programming Concepts Project SU21 Graphical User Interface Due date July 23rd, 2021 @ 11:59PM. Late projects are not considered. 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) to Canvas under the Project 2 assignment in the Projects Module 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 All of you have taken Thermodynamics at this point. Hence you will be familiar with the table shown in Figure 1. 1 Final PDF to printer 956 PROPERTY TABLES AND CHARTS 908 PROPERTY TABLES AND CHARTS TABLE A–17 TA B L E A– 1 7 E Ideal-gas properties of air Ideal-gas properties of air T K 200 210 220 230 240 h kJ/kg 199.97 209.97 219.97 230.02 240.02 Pr u kJ/kg vr s° kJ/kg·K 0.3363 0.3987 0.4690 0.5477 0.6355 142.56 149.69 156.82 164.00 171.13 1707.0 1512.0 1346.0 1205.0 1084.0 1.29559 1.34444 1.39105 1.43557 1.47824 T T RK h h kJ/kg Btu/lbm PPr r uu kJ/kg Btu/lbm vrv r s°s° kJ/kg·K Btu/lbm·R T R 580 586.04 0.3363 14.38 419.55 115.7 2.37348 360 85.97 61.29 396.6 0.50369 1600 590 596.52 15.31 427.15 110.6 2.39140 380 90.75 0.4061 64.70 346.6 0.51663 1650 600 607.02 16.28 434.78 105.8 2.40902 400 95.53 68.11 305.0 0.52890 1700 610 617.53 0.4858 17.30 442.42 101.2 2.42644 420 100.32 0.5760 71.52 270.1 0.54058 1750 620 628.07 18.36 450.09 96.92 2.44356 440 105.11 0.6776 74.93 240.6 0.55172 1800 250 250.05 0.7329 178.28 979.0 1.51917 630 109.90 638.63 0.7913 19.84 457.78 92.84 460 78.36 215.33 2.46048 0.56235 1850 260 260.09 0.8405 185.45 887.8 1.55848 640 114.69 649.22 0.9182 20.64 465.50 88.99 480 81.77 193.65 2.47716 0.57255 1900 270 270.11 0.9590 192.60 808.0 1.59634 650 119.48 659.84 1.0590 21.86 473.25 85.34 500 85.20 174.90 2.49364 0.58233 1950 280 280.13 1.0889 199.75 738.0 1.63279 660 670.47 23.13 481.01 81.89 2.50985 520 124.27 1.2147 88.62 158.58 0.59173 2000 285 285.14 1.1584 203.33 706.1 1.65055 670 681.14 24.46 488.81 78.61 2.52589 537 128.10 1.3593 91.53 146.34 0.59945 2050 290 290.16 1.2311 206.91 676.1 1.66802 680 129.06 691.82 1.3860 25.85 496.62 75.50 540 92.04 144.32 2.54175 0.60078 2100 295 295.17 1.3068 210.49 647.9 1.68515 690 133.86 702.52 1.5742 27.29 504.45 72.56 560 95.47 131.78 2.55731 0.60950 2150 298 298.18 1.3543 212.64 631.9 1.69528 700 713.27 28.80 512.33 69.76 2.57277 580 138.66 1.7800 98.90 120.70 0.61793 2200 300 300.19 1.3860 214.07 621.2 1.70203 710 143.47 724.04 2.005 30.38 102.34 520.23 67.07 600 110.88 2.58810 0.62607 2250 305 305.22 1.4686 217.67 596.0 1.71865 720 148.28 734.82 2.249 32.02 105.78 528.14 64.53 620 102.12 2.60319 0.63395 2300 310 310.24 1.5546 221.25 572.3 1.73498 730 153.09 745.62 2.514 33.72 109.21 536.07 62.13 640 94.30 2.61803 0.64159 2350 315 315.27 1.6442 224.85 549.8 1.75106 740 157.92 756.44 2.801 35.50 112.67 544.02 59.82 660 87.27 2.63280 0.64902 2400 320 320.29 1.7375 228.42 528.6 1.76690 750 162.73 767.29 3.111 37.35 116.12 551.99 57.63 680 80.96 2.64737 0.65621 EML 3035 Programming Concepts Graphical User Interface Project

2450 325 325.31 1.8345 232.02 508.4 1.78249 760 167.56 778.18 3.446 39.27 119.58 560.01 55.54 700 75.25 2.66176 0.66321 2500 330 330.34 1.9352 235.61 489.4 1.79783 780 172.39 800.03 3.806 43.35 123.04 576.12 51.64 720 70.07 2.69013 0.67002 2550 740 65.38 2.71787 0.67665 2600 340 340.42 2.149 242.82 454.1 1.82790 800 177.23 821.95 4.193 47.75 126.51 592.30 48.08 760 61.10 2.74504 0.68312 2650 350 350.49 2.379 250.02 422.2 1.85708 820 182.08 843.98 4.607 52.59 129.99 608.59 44.84 360 360.58 2.626 257.24 393.4 1.88543 840 186.94 866.08 5.051 57.60 133.47 624.95 41.85 780 57.20 2.77170 0.68942 2700 370 370.67 2.892 264.46 367.2 1.91313 860 191.81 888.27 5.526 63.09 136.97 641.40 39.12 800 53.63 2.79783 0.69558 2750 380 380.77 3.176 271.69 343.4 1.94001 880 196.69 910.56 6.033 68.98 140.47 657.95 36.61 820 50.35 2.82344 0.70160 2800 840 47.34 2.84856 0.70747 2850 390 390.88 3.481 278.93 321.5 1.96633 900 201.56 932.93 6.573 75.29 143.98 674.58 34.31 860 44.57 2.87324 0.71323 2900 400 400.98 3.806 286.16 301.6 1.99194 920 206.46 955.38 7.149 82.05 147.50 691.28 32.18 Figure properties sorted by temperature, T, in7.761 Kelvin151.02 or Rankine. stands 880 42.01 h 2.89748 0.71886 for 2950 410 1. Ideal-gas 411.12 4.153 293.43of air 283.3 2.01699 940 211.35 977.92 89.28 708.08 30.22 900 216.26 8.411 154.57 0.72438 420 4.522 pressure 300.69 266.6 Vr2.04142 960 1000.55 97.00 725.02 enthalpy, Pr421.26 for relative and is relative volume. Table on the left is 28.40 SI39.64 units2.92128 and table3000 430 431.43 4.915 307.99 251.1 2.06533 980 221.18 1023.25 105.2 741.98 26.73 920 9.102 158.12 37.44 2.94468 0.72979 3050 on the is English 940 9.834 161.68 35.41 2.96770 0.73509 3100 440right441.61 5.332units. 315.30 236.8 2.08870 1000 226.11 1046.04 114.0 758.94 25.17 960 165.26 33.52 2.99034 0.74030 3150 450 451.80 5.775 322.62 223.6 2.11161 1020 231.06 1068.89 10.61 123.4 776.10 23.72 980 168.83 31.76 3.01260 0.74540 3200 460 462.02 6.245 329.97 211.4 2.13407 1040 236.02 1091.85 11.43 133.3 793.36 23.29 1000 172.43 30.12 3.03449 0.75042 3250 470 472.24 6.742 337.32 200.1 2.15604 1060 240.98 1114.86 12.30 143.9 810.62 21.14 1040 14.18 179.66 27.17 3.05608 0.76019 3300 7.268 we 344.70 189.5 other 2.17760properties 1080 250.95 1137.89 155.2 827.88 19.98 For a480 given 482.49 temperature, can obtain such as enthalpy (h), relative pressure 1080 186.93 24.58 3.07732 0.76964 3350 490 492.74 7.824 352.08 179.7 2.19876 1100 260.97 1161.07 16.28 167.1 845.33 18.896 (Pr) or Similarly, property, such 194.25 as enthalpy, can also 3400 1120 22.30we3.09825 0.77880 500 relative 503.02volume 8.411 (Vr). 359.49 170.6 given 2.21952a different 1120 271.03 1184.28 18.60 179.7 862.79 17.886 1160 281.14 201.63 20.29 3.11883 0.78767 510the other 513.32 properties 9.031 366.92 162.1 with 2.23993such 1140 1207.57 193.1 880.35 obtain that go along enthalpy. The21.18 problem arises16.946 when we need to3450 1200 209.05 18.51 3.13916 0.79628 3500 520 523.63 9.684 374.36 154.1 2.25997 1160 291.30 1230.92 24.01 207.2 897.EML 3035 Programming Concepts Graphical User Interface Project

91 16.064 301.52 216.53 16.93 in3.15916 0.80466 look 530 up properties for a temperature (or any other1240 property) that27.13 is not directly our table. 3550 533.98 10.37 381.84 146.7 2.27967 1180 1254.34 222.2 915.57 given 15.241 224.05 15.52 0.81280 3600 540 544.35 389.34 is 326.3 139.7 K, 2.29906 1277.79 238.0other933.33 14.470for3.17888 For instance, if my11.10 temperature what 1280 is1200 the 311.79 value of 30.55 the properties such 1320 322.11 34.31 231.63 14.25 0.82075 3650 550 554.74 11.86 396.86 133.1 2.31809 1220 1301.31 254.7 951.09 13.747 3.19834 1360 332.48 239.25 13.12 0.82848 3700 temperature? Or if12.66 my relative is 1.185, is the38.41 value of the other properties 560 565.17 404.42 pressure 127.0 (Pr) 2.33685 1240 what 1324.93 272.3 968.95 13.069 3.21751 1400 342.90 42.88 246.93 12.10 0.83604 3750 570 575.59 13.50 411.97 121.2 2.35531 corresponding to such Pr? 1440 353.37 47.75 254.66 11.17 0.84341 3800 1480 363.89 53.04 262.44 10.34 0.85062 3850 1520 374.47 58.78 270.26 9.578 0.85767 3900 In these cases, we need to interpolate. The primary objective your GUI will be 8.890 to perform 1560 385.08 of 65.00 278.13 0.86456 3950 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. cen22672_app01_881-930.indd 908 11/06/17 09:32 AM cen22672_app02_931-972.indd 2 956 h Btu/lbm 395.74 409.13 422.59 436.12 449.71 463.37 477.09 490.88 504.71 518.71 532.55 546.54 560.59 574.69 588.82 603.00 617.22 631.48 645.78 660.12 674.49 688.90 703.35 717.83 732.33 746.88 761.45 776.05 790.68 805.34 820.03 834.75 849.48 864.24 879.02 893.83 908.66 923.52 938.40 953.30 968.21 983.15 998.11 1013.1 1028.1 1043.1 1058.1 1073.2 Variable given: x Variable to be found: y x1 y1 x2 y2 x1, x2, y1, y2 are values from the table x is a given value that falls between x1 and x2 y is the value to be found through interpolation Figure 2. General table with variables x and y. In order to find y we can use the following formula: 𝑦 = 𝑦! + 𝑦” − 𝑦! (𝑥 − 𝑥! ) 𝑥” − 𝑥! Feel free to use any other interpolation formula if you feel more comfortable with it. 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. EML 3035 Programming Concepts Graphical User Interface Project

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. When the user clicks on the CLEAR button, it should erase the content of all 4 text boxes at once. 4 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. Grading criteria The project will be graded based on completeness and proper operation of the GUI interface. Additional features to the basic design (more push-buttons, more capabilities) will also be rewarded, but are not required. 5 Home Tools Screenshot_1.pdf @ 76 2 do Edit PDF elit T Add text T Add text Add image Add more or link crop Pages Header ex Footer Watermark E More Close FORMAT 360 380 396.6 346.6 305.00 2701 240.6 215:33 19365 174.90 TSRS 16.34 0:50369 0.51663 0.52890 0.540S 055122 056235 0.57255 58233 Τ Τ Τ Τ Τ JE Cue Da ELIOSO SPOSO • TE KO 2 AV 85.97 90.75 95.53 100.32 TOS. 11 109.90 114.00 119,48 124.27 12.10 129.06 133.86 138.66 143.47 148.28 15.00 157.92 162.73 167156 172.89 177.23 182.0 T6.94 19181 196.09 120 40 100 180 SEX 520 537 540 560 580 600 620 640 660 680 700 720 7:40 760 70 KOKI 820 0.3363 61.29 03061 64.70 0.4858 6811 0.5760 21.52 016776 74.93 0.7973 78.36 0.0182 81.77 1.05X 15.20 1.2147 02 SON 91.53 13860 02.04 1.5742 95.AZ HO 98.90 2.005 102.34 2.249 105.78 2514 109.21 2.800 112.67 16.12 119.58 3.86 123.04 4.193 120.51 1.007 129.90 SOSI 13.47 5.526 136.97 603 14032 OBJECTS th Q 13178 120.70 T1088 TOZ.12 9430 17.27 N006 75.25 70007 05:3N 1.10 57.20 53.63 35 0.602178 0.000 0,61793 0.462607 0,6395 DOS 0.64902 0.65621 0.66321 0.67012 0167605 0.68.312 1,68942 0.60SSN 0.70160 2 SCANNED DOCUMENTS tingi Restricted in fellas, make the separate tables into a different pdf and copy the converted text to make ur life easier Index in position 1 exceeds array bounds (must not exceed 14). Error in myapp>display Callback (line 245) elseif h>data1(i, 2) && h@(hobject, eventdata)myapp(‘display Callback’, hObjec Error while evaluating UI Control Callback.

Get a 10 % discount on an order above $ 50
Use the following coupon code :
NURSING10

 
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"