Me160 Experiment No. 2 Matlab Gui
Me160 Experiment No. 2 Matlab Gui
EXPERIMENT NO. 2
SUBMITTED BY:
Submitted To:
Engr. Julian Albert Nohay
October 5, 2022
ABSTRACT
Graphic User Interface is a helpful MATLAB tool case to produce envisioned user-friendly user
interfaces and configurations for data and procedures. In this conduct experiment, we utilize our
understanding of simple MATLAB coding in constructing GUIs that resolves a certain
engineering task. The outline of the GUIs is developed all through the Design App in MATLAB,
which includes mechanisms, for instance, data entry, button, table, etc., that are effortlessly
programmable to operate a particular algorithm. Some procedures are applied in creating the data
of each GUI function that we get acquainted with. Therefore, each GUI is user-friendly since it is
effortlessly reasonable due to how it is created with the intent of minimalism and functionality.
OBJECTIVE
CONCLUSION 12
RECOMMENDATION 12
REFERENCES 13
THEORIES AND PRINCIPLES
Temperature Conversion
We understand that the idea of temperature is the warmth and coldness of a particular thing. But
we be able to calculate it in numerous methods and can distinguish it with the help of many
components of temperature. Celsius and Fahrenheit is the most familiar. Then next one is Kelvin,
a full sale often applied in science. The very last one is the Rankine which is utilized in
engineering techniques and can be calculated by means of Fahrenheit.
Figure 1. Boiling point and Freezing point of Water in different Scales of Temperature
Vibratory systems are made for storing Potential and Kinetic energy. Hence, variables such as
velocity, mass, displacement, spring constant, and unstretched length are always of use. A
famous example of this exercise is an automotive suspension system under load.
Figure 2. Simplified mass-spring model for vibration.
For this GUI, Graph block will be added to the application that will be coded by values and
formulas to show the corresponding graph for the corresponding values.
Pump performance curves are valuable sketches created by the pump producer. Pump
presentation curves are largely applied to forecast the difference of the discrepancy head across
the pump, as the flow is shifted. Moreover, difference of effectiveness, power, NPSH expected
etc., as the flow is adjusted, can also be characterized on the pump performing curves by the
producer.
DISCUSSION
Temperature Conversion
A data acquisition system for equipment maintenance involves the measurement of temperature
in degree Celsius. However, conversions to different temperature scales are needed in the data
analysis.
TF = 1.8TC + 32
TK = TC + 273
TR = TF +460
Where:
Vibration in spring-mass system can be analyzed by plotting the equation that can
describe its displacement. If manual graphing will be applied, the process will be time-
consuming.
where:
y: displacement (m)
L: unstretched length (m)
s: initial position (m)
v: initial velocity (m/s)
k : spring constant (N/m)
m: mass (kg)
Figure 7. Vibration of Spring-Mass System GUI
The position of the particle under curvilinear motion can be separated into rectangular
components. By viewing the graphs for each component as a function of time, the positions x, y
& z can be studied. However, plotting each component one at a time will be inefficient.
a = app.AEditField.Value;
b = app.BEditField.Value;
t1 = app.LowerEditField.Value;
t2 = app.UpperEditField.Value;
t = t1:0.01:t2;
x = sin(a*t);
y = cos(a*t);
z = exp(b*t);
plot(app.UIAxesSin,t,x);
plot(app.UIAxesCos,t,y);
loglog(app.UIAxesExp,t,z);
where:
x = is where the sine values are plotted
y = is where the cosine values are plotted
z = is where the exponential values are plotted
A pump performance curve can be used to estimate the pump head, power, efficiency and
Net Positive Suction Head Required (NPSHR) for operation if the flowrate is known.
Unfortunately, consulting the curve (figure 7) for the values is time-consuming and inconvenient.
H = 36.8-(2*10^-4)*(Q-40000)-(8*10^-9)*(Q-40000)*(Q-42500)-(5.3333*10^-
12)*(Q40000)*(Q-42500)*(Q-45000)+(8.5333*10^-16)*(Q-40000)*(Q-42500)*(Q-
45000)*(Q-47500)- (1.024*10^-19)*(Q-40000)*(Q-42500)*(Q-45000)*(Q-47500)*(Q-
50000)+(1.2516*10^-23)*(Q40000)*(Q-42500)*(Q-45000)*(Q-47500)*(Q-50000)*(Q-
52500)-(1.5279*10^-27)*(Q40000)*(Q-42500)*(Q-45000)*(Q-47500)*(Q-50000)*(Q-
52500)*(Q-55000)+(1.6091*10^- 31)*(Q-40000)*(Q-42500)*(Q-45000)*(Q-47500)*(Q-
50000)*(Q-52500)*(Q-55000)*(Q57500)-(1.3653*10^-35)*(Q-40000)*(Q-42500)*(Q-
45000)*(Q-47500)*(Q-50000)*(Q52500)*(Q-55000)*(Q-57500)*(Q-60000);
N = 79.52+(1.192*10^-3)*(Q-40000)-(5.726*10^-8)*(Q-40000)*(Q-
42500)+(3.9467*10^- 12)*(Q-40000)*(Q-42500)*(Q-45000)-(6.9333*10^-16)*(Q-
40000)*(Q-42500)*(Q-45000)*(Q47500)+(7.68*10^-20)*(Q-40000)*(Q-42500)*(Q-
45000)*(Q-47500)*(Q-50000)-(8.4764*10^- 24)*(Q-40000)*(Q-42500)*(Q-45000)*(Q-
47500)*(Q-50000)*(Q-52500)+(1.0305*10^-27)*(Q40000)*(Q-42500)*(Q-45000)*(Q-
47500)*(Q-50000)*(Q-52500)*(Q-55000)-(1.1789*10^- 31)*(Q-40000)*(Q-42500)*(Q-
45000)*(Q-47500)*(Q-50000)*(Q-52500)*(Q-55000)*(Q57500)+(1.3037*10^-35)*(Q-
40000)*(Q-42500)*(Q-45000)*(Q-47500)*(Q-50000)*(Q52500)*(Q-55000)*(Q-
57500)*(Q-60000);
P = 5190.476+(2.8572*10^-2)*(Q-40000)-(3.8096*10^-6)*(Q-40000)*(Q-
42500)+(3.5557*10^- 10)*(Q-40000)*(Q-42500)*(Q-45000)-(9.1431*10^-14)*(Q-
40000)*(Q-42500)*(Q-45000)*(Q47500)+(1.8286*10^-17)*(Q-40000)*(Q-42500)*(Q-
45000)*(Q-47500)*(Q-50000)- (2.5736*10^-21)*(Q-40000)*(Q-42500)*(Q-45000)*(Q-
47500)*(Q-50000)*(Q52500)+(2.6316*10^-25)*(Q-40000)*(Q-42500)*(Q-45000)*(Q-
47500)*(Q-50000)*(Q52500)*(Q-55000)-(1.9118*10^-29)*(Q-40000)*(Q-42500)*(Q-
45000)*(Q-47500)*(Q50000)*(Q-52500)*(Q-55000)*(Q-57500)+(7.4991*10^-34)*(Q-
40000)*(Q-42500)*(Q45000)*(Q-47500)*(Q-50000)*(Q-52500)*(Q-55000)*(Q-
57500)*(Q-60000);
NPSHR = 13.33-(1.4*10^-4)*(Q-40000)-(8*10^-10)*(Q-40000)*(Q-
42500)+(1.3867*10^- 12)*(Q-40000)*(Q-42500)*(Q-45000)-(2.6667*10^-16)*(Q-
40000)*(Q-42500)*(Q-45000)*(Q47500)+(4.1813*10^-20)*(Q-40000)*(Q-42500)*(Q-
45000)*(Q-47500)*(Q-50000)- (4.1529*10^-24)*(Q-40000)*(Q-42500)*(Q-45000)*(Q-
47500)*(Q-50000)*(Q52500)+(2.3731*10^-28)*(Q-40000)*(Q-42500)*(Q-45000)*(Q-
47500)*(Q-50000)*(Q52500)*(Q-55000)-(3.25089*10^-34)*(Q-40000)*(Q-42500)*(Q-
45000)*(Q-47500)*(Q50000)*(Q-52500)*(Q-55000)*(Q-57500)-(1.5821*10^-36)*(Q-
40000)*(Q-42500)*(Q45000)*(Q-47500)*(Q-50000)*(Q-52500)*(Q-55000)*(Q-
57500)*(Q-60000);
Where:
Q: flowrate (cu. m/h)
H: Output head (m)
N: Pump Efficiency (%)
P: Power (KW)
Temperature Conversion
function GraphButtonPushed(app,event)
C = app.TemperatureCEditField.Value
if C >= -273
end
F = C * 1.8 + 32;
K = C + 273;
R = F + 460;
tempTable = {F K R};
app.UITable.Data = tempTable
function GraphButtonPushed(app,event)
m = app.MasskEditField.Value;
s = app.StiffnessNmEditField.Value;
k = app.InitialPositionmEditField.Value;
l = app.UnstretchedLengthmEditField.Value;
v = app.InitialVelocitymsEditField.Value;
t1 = app.Time1EditField.Value;
t2 = app.Time2EditField.Value;
x = t1:0.01:t2;
y = 1+(((s-1)^2+((v^2)*m/k))^(1/2))*sin(((k/m)^(1/2))*x+atan((s-1)*((k/m^1/2))/v));
plot(app.UIAxesVSMS,x,y);
end
end
function GraphButtonPushed(app,event)
a = app.AEditField.Value;
b = app.BEditField.Value;
t1 = app.LowerEditField.Value;
t2 = app.UpperEditField.Value;
t = t1:0.01:t2;
x = sin(a*t);
y = cos(a*t);
z = exp(b*t);
plot(app.UIAxesSin,t,x);
plot(app.UIAxesCos,t,y);
loglog(app.UIAxesExp,t,z);
end
end
Figure 12. Parametric Equations of Motions result
Pump Performance
Ta = app.TempaEditField.Value;
Tb = app.TempbEditField.Value;
Tc = app.TempcEditField.Value;
Td = app.TempdEditField.Value;
k = app.ThermalConductivitykEditField.Value;
x = [-4,1,0,1,0,0,0,0,0;1,-4,1,0,1,0,0,0,0;0,1,-4,0,0,1,0,0,0;1,0,0,-
4,1,0,1,0,0;0,1,0,1,-4,1,0,1,0;0,0,1,0,1,-4,0,0,1;0,0,0,1,0,0,-4,1,0;0,0,0,0,1,0,1,-
4,1;0,0,0,0,0,1,0,1,-4];
y = [-Ta-Tb;-Tb;-Tb-Tc;-Ta;0;-Tc;-Ta-Td;-Td;-Tc-Td];
z = x\y;
T1 = z(1,1);
T2 = z(2,1);
T3 = z(3,1);
T4 = z(4,1);
T5 = z(5,1);
T6 = z(6,1);
T7 = z(7,1);
T8 = z(8,1);
T9 = z(9,1);
Qleft = k*(3*Ta-T1-T4-T7);
Qup = k*(3*Tb-T1-T2-T3);
Qright = k*(3*Tc-T3-T6-T9);
Qdown = k*(3*Td-T7-T8-T9);
Checking = Qleft + Qright + Qup + Qdown;
app.UITableTempA.Data = {T1 T2 T3};
app.UITableTempA_2.Data = {T4 T5 T6};
app.UITableTempA_3.Data = {T7 T8 T9};
app.UITableQCheck.Data = {Qleft Qright Qup Qdown Checking};
CONCLUSION
We learned the fundamentals of MATLAB through the five exercises we created. Basics, for
example, incorporate callbacks, building blocks like tables, axes, and lists, into comprehending a
variety of controls and scripts to produce a usable software. Therefore, not only are the groups of
tasks a good way to appreciate the App designer tool, but they also encourage one to think
carefully about fundamental measurable concepts like temperature converters, equations of
motion, Hooke's law, and, finally, nodal temperatures.
RECOMMENDATION
It is important for a GUI's design to be appealing to the eye and simple enough for a novice user
to understand. By adding labels and extra visual elements, make sure it is easily understandable.
Don't emphasis the layout too much, which means that for most of the section, you must remain
straightforward. Decide what your program is going to resolve and its goal before beginning the
encryption process. Investigate thoroughly to pinpoint the issue so that you can put the code
more effectively. To sum up, make sure you are proficient with MATLAB controls because they
are essential.