Progression of Research/Data

 

LAB 3 SAMPLE DATA

Due to an unscheduled snow day, data and the generated graphs were not able to be collected so sample data was used.

Power vs Time

The power of the AEV is shown at respective times. It is shown that the power increases in the first 3 seconds (as the code shows with “celerate(4,0,40,3);”), the power becomes constant for one second (“goFor(1);”), and the power goes down to 35 for 2 seconds (“motorSpeed(4,35); goFor(2);”). The graph follows the code well, however, it shows that the power that the AEV actually moves with is not as high as it is programmed to go.

Power vs Distance

The power of the AEV is shown at respective distances the AEV travels.

Research to benefit the consumer

To satisfy the consumers of this product, the safety of the designs and how quickly it transports people have also been looked into. The second team design appears to be more stable and have less air resistance in solid works. This might mean it is quicker to transport people. The first design is less stable because the front piece to help make it more aerodynamic are able to secured well. This was also seen when the performance tests were performed. The front panels would fly out of place. The second design has not been tested yet. The findings so far make out Second AEV design more marketable (“MCR”).

 

Advance Research and Development 1

First, two vehicles were designed in MATLAB. The two vehicles tested were the two designs that were initially picked. A MATLAB program was then created that separates the red green and blue concentrations of a heat map (bottom right) created in the SolidWorks Flow Simulation. To learn how to run the SolidWorks Flow Simulation, the solidworks help website, Solidworks Introduction to Motion Studies was used (“Intro to Motion Studies”). The information shown graphically can be used quantitatively to determine the percentage of the air affected by the AEV as well as the intensity of the difference in air velocities. This information is being used to compare and contrast different AEV designs to determine the most efficient shapes. The data collected from the heat maps showed that the printed part design/custom design was more aerodynamic when compare to Prototype Design 1 /Sample AEV design. It was a small difference, but it was originally thought it could help get the cost down. After printing the part and testing the design, the design was decided to be unsafe and was not further used (“AR&D”).

Solidworks Flow Simulation:

This picture is a picture of the solidworks flow simulation using the printed part design. It is visible how the velocity of the air changes when going around the vehicle.

Heatmap:

 

Heatmaps showing how the velocity changes around the vehicle different vehicles.

Final Design SOLIDWORKS Simulation (Animation – Press Link)

Animation 1-1brcc7o

Code for MATLAB Heatmap Generation and analysis:

This was code was used to generate the heat map shown above.

%%Real AEV
color=imread(‘RealAEVMap.JPG’);
redChannel = color(:, :, 1);
greenChannel = color(:, :, 2);
blueChannel = color(:, :, 3);
subplot(2,2,1)
imshow(redChannel)
title(‘redChannel’)
subplot(2,2,2)
imshow(greenChannel)
title(‘greenChannel’)
subplot(2,2,3)
imshow(blueChannel)
title(‘blueChannel’)
subplot(2,2,4)
imshow(color)
rcounter= 0;
for i=1:(size(redChannel,1)*size(redChannel,2))
   if redChannel(i) > 172
       rcounter= rcounter +1;
   end
end
gcounter= 0;
for i=1:(size(greenChannel,1)*size(greenChannel,2))
   if greenChannel(i) > 162
       gcounter= gcounter +1;
   end
end
bcounter= 0;
for i=1:(size(blueChannel,1)*size(blueChannel,2))
   if blueChannel(i) > 170
       bcounter= bcounter +1;
   end
end
%% Sample AEV
color1=imread(‘sampleAEVMap.jpg’);
redChannel1 = color1(:, :, 1);
greenChannel1 = color1(:, :, 2);
blueChannel1 = color1(:, :, 3);
figure
subplot(2,2,1)
imshow(redChannel1)
title(‘redChannel’)
subplot(2,2,2)
imshow(greenChannel1)
title(‘greenChannel’)
subplot(2,2,3)
imshow(blueChannel1)
title(‘blueChannel’)
subplot(2,2,4)
imshow(color1)
rcounter1= 0;
for j=1:(size(redChannel1,1)*size(redChannel1,2))
   if redChannel1(j) > 172
       rcounter1= rcounter1 +1;
   end
end
gcounter1= 0;
for j=1:(size(greenChannel1,1)*size(greenChannel1,2))
   if greenChannel1(j) > 162
       gcounter1= gcounter1 +1;
   end
end
bcounter1= 0;
for j=1:(size(blueChannel1,1)*size(blueChannel1,2))
   if blueChannel1(j) > 170
       bcounter1= bcounter1 +1;
   end
end
numGB= i-rcounter;
numGB1= j-rcounter1;
perGB= (numGB/i)*100;
perGB1= (numGB1/j)*100;
fprintf(‘The custom AEV design shows %3.3f percent of the air particles being slowed significantly’,perGB)
fprintf(‘\nThe sample AEV design shows %3.3f percent of the air particles being slowed significantly’,perGB1)

Advance Research and Development 2

This Research focused on the push vs pull methods of transportation and which is more efficient. The vehicle design used to test this was a different design from the ones used in the previous aR&D and was the 3rd team design of the vehicle. This vehicle was also used for Performance test 2 and the final. To gather the data, the vehicle was ran on a track with no slope and no stop sign.  For the pull method the propellers were in the front of the vehicle and pulled the vehicle along. Since the vehicle design was symmetrical, the vehicle was just reversed to collect data for the push method. It was found that the pull method was significantly more efficient. This method was decided to be the method to used after the caboose is collected because of this (“AR&D”)

Power vs. Distance                                 

 Power vs. Time

These graphs show that the pull method uses less power when compared to the push method.

Efficiency Measurement:

This show the quantitative results of the testing.

Push/Pull Average Total Distance (m) Average Total Energy (J) Efficiency Measurement (Joules/ 1 meter)
Pull 3.517 34.744 9.880
Push 3.108 39.740 12.786

Code for aR&D 2 Test Code (MATLAB generated plots):      

This code was used to run the vehicle.

celerate(4,0,45,2);
goFor(3);
brake(4);
goFor(5);
reverse(4);
celerate(4,0,35,2);
goFor(3);     

Data Collected during Performance Tests

The Data collected from the performance test was used to find out the cost.

Data Collected From Performance Test 2

Power vs. Distance

Power vs. Time

Data Collected From Final Performance Test (Three Averaged Trials)

Power (Watts) Over Time (Seconds)

Power (Watts) Over Distance (Seconds)

AEV Footage

MATLAB Generated Plots Code

Data Extraction Code (“Performance Analysis Tool”)

function AEVDataExtraction(varargin)
% AEVDataExtraction – This script file downloads the EEPROMM data from the
% Arduino Controller and saves it to an excel file
%
% Syntax: AEVDataExtraction:
% User will be prompted to enter a filename for
% the excel file.
%
% AEVDataExtraction(‘fileName’):
% Function will use the filename
% input by the user
%
% Other m-files required: None
% Subfunctions: None
% MAT-files required: None
%
% Author: Dustin West
% The Ohio State University
% email address: west.425@osu.edu
% January 2014; Last revision: 26-September-2014

%————- BEGIN CODE ————–

% Clear the command window
clc

%————————————————————————-
% Check user input:
% For our first check of the input, we will use “nargin”. nargin
% is a matlab function call that returns the number of function
% input arguments the user has included in the function call.
%————————————————————————-
fprintf(‘Checking input…\n\n’);
if nargin == 0

fprintf(‘Click into the “EXCEL FILES” Folder and Enter Filename…\n\n’);

% If no function input arguments are included, then we will ask the
% user for the file name for the excel file by using the function
% “uiputfile”. For more information on uiputfile, type “help uiputfile”
% in the command window.

[file,path] = uiputfile(‘*.xlsx’,’Click into the “EXCEL FILES” Folder and Enter Filename…’);

% If user cancels, abort program
if file == 0
clc
return
end

% The outputs to the uiputfile are “file” and “path”. “File” is the
% file name the user typed into the dialogue box. The “path” is a
% character array of the file path were the file will be placed. Let’s
% assign this to the variable FileName to create a single character
% array.

matName = file;
FileName = [path file];

elseif nargin == 1

% User provided a single input.

% The variable varargin used as the input is a special input variable
% specific to Matlab. varargin is a cell array containing the
% optional input arguments to the function. Since we know we only have
% one input, we’ll assign this input to the variable “FileName”:

FileName = varargin{1};

% Check extenstion
if strcmp(FileName(end-4:end),’.xlsx’) == 0

FileName = [FileName ‘.xlsx’];
matName = [matName ‘.xlsx’];

end

% Notice since varargin is a cell array I needed to use {} brackets in
% order to index into the cell array. Cell arrays are different than
% numerical arrays. For more information on cell arrays and how to use
% them, type “help cell” in the command window.

% Now lets check to make sure FileName is a string using the “isa”
% function. This function determines if the input is of a specified
% class. Here our variable will be FileName, and the type of class
% we want to check for is “char” which is short for Character array.
% For more information on isa, type “help isa” in the command window.

% Note if isa(FileName,’char’) is equal to 1, then the input is a
% character array, else the function will return a zero

if isa(FileName,’char’) == 0

% The input is not a character array, let’s tell the user they
% messed up.

% Assign string to variable
ERRORSTRING = [‘The input can only be a character array.’…
‘ For Example, AEVDataExtraction(”myExcelFile”)’];

% Assign window name
DLGNAME = ‘AEV Data Extraction’;

% Display error message
errordlg(ERRORSTRING,DLGNAME)

% Abort program
return

end

elseif nargin > 1

% If more than 1 function input argument is included we need
% to let the user know they made an error and abort the program.

% Assign string to variable
ERRORSTRING = [‘Too many inputs. Only input needed is a text string’…
‘ of the name of the excel file.’…
‘ For Example, AEVDataExtraction(”myExcelFile”)’];

% Assign window name
DLGNAME = ‘AEV Data Extraction’;

% Display error message
errordlg(ERRORSTRING,DLGNAME)

% Abort program
return

else

end

%————————————————————————-
% Establish connection with Arduino:
%————————————————————————-
fprintf(‘Establishing connection with Arduino controller…\n\n’);
% Delete serial object that may cause issues using the function calls
% “delete” and “instrfindall”
delete(instrfindall)

% Assign the variable “SerialPort” to the port that the Arduino is
% connected to.
SerialPort = AskForSerialPort;

% If SerialPort is assigned a character array of COM1 then the Arduino
% controller may not be properly connected to the computer. Inform the user
% if so.
if any(strcmpi(SerialPort, {‘NONE’}))

% Assign string to variable
ERRORSTRING = [‘Arduino Controller is not recognized. ‘…
‘Check the serial port in the Arduino IDE and try again.’];

% Assign window name
DLGNAME = ‘AEV Data Extraction’;

% Display error message
errordlg(ERRORSTRING,DLGNAME)

% Abort program
return

end

% Define Serial Port
s1 = serial(SerialPort, ‘BaudRate’, 115200, ‘terminator’, ‘LF’);

% Open connection
fopen(s1);

% Signal the arduino to start collection and check connection
w=fscanf(s1,’%i’);

if (w==1) % Connection successful

fprintf(s1,’%i\n’,1);

else % Connection fails

% Assign string to variable
ERRORSTRING = [‘There was an error establishing connection.’…
‘ Make sure the yellow LED on the controller is not blinking.’…
‘ If it is, disconnect the Arduino and turn the power on. Re-connect and try again’];

% Assign window name
DLGNAME = ‘AEV Data Extraction’;

% Display error message
errordlg(ERRORSTRING,DLGNAME)

% Abort program
return;

end

%————————————————————————-
% Read in Arduino data:
%————————————————————————-
fprintf(‘Reading in EEProm data…\n\n’);
% Read in total number of elements. Sometimes we get a 1 in
% the first reading. Scan until we get something other than 1.
nelements = fscanf(s1,’%f’);
while (nelements == 1); nelements = fscanf(s1,’%f’); end

nelements = nelements/5;

% Initialize waitbar
h = waitbar(0,’Reading in data from Arduino controller. Please wait…’);

% Initialize variables
te = zeros(nelements,1);
ie = zeros(nelements,1);
ve = zeros(nelements,1);
marks = zeros(nelements,1);
pos = zeros(nelements,1);

% Read in Arduino Data
for i = 1:(nelements)

te(i) = fscanf(s1,’%f’);
ie(i) = fscanf(s1,’%f’);
ve(i) = fscanf(s1,’%f’);
marks(i) = fscanf(s1,’%f’);
pos(i) = fscanf(s1,’%f’);

pause(.0001);
perc = (i/nelements);
waitbar(perc,h,sprintf(‘%.0f%% complete…’,perc*100))

end

% Convert raw parameters to processed data
t = te./1000;
I = (ie./1024).*2.46.*(1/.185);
V = 3.*(5.*ve)./(1024);
dist_abs = ((3.9/8).*(marks).*.0254);
dist_rel = ((3.9/8).*(pos).*.0254);
Pin = V.*I;
vel = [0;abs(diff(dist_abs))./abs(diff(t))];

% compute incremental and total energy
i = 1:length((te))-1; % Linear index
de = zeros(length(te),1); % Initialize vector
de(i+1) = ((Pin(i) + Pin(i+1))./2).*(t(i+1)-t(i)); % Incremental Energy
E = sum(de); % Total Energy

energy_inc = de; % Incremental Energy
energy_tot = cumsum(de); % Total Energy

% Close serial port connection
fclose(s1);

% Close waitbar
close(h);

% Ask user if they would like to store the arduino program used.
choice = questdlg({‘Would you like to store the Arduino code used for this run?’},…
‘AEV Analysis Tool’,’Yes’,’No’,’Yes’);

drawnow; pause(0.05); % this innocent line prevents the Matlab hang

% Perform action based on choice
switch choice

case ‘Yes’

prompt = {‘Copy & Paste Arduino Code:’};
name = ‘AEV Analysis Tool’;
numlines=[35 75];
Code = inputdlg(prompt,name,numlines); %#ok<*NASGU>

drawnow; pause(0.05); % this innocent line prevents the Matlab hang

case ‘No’

Code = {};

end

% Save data as .mat file
MatName = [matName(1:end-4) ‘mat’];
%var_list = [‘ie’, ‘marks’, ‘pos’, ‘te’, ‘ve’];
matpath = [pwd ‘\Data Analysis Tool\EEProm Data\’ MatName];
save(matpath, ‘ie’, ‘marks’, ‘pos’, ‘te’, ‘ve’, ‘Code’);

%————————————————————————-
% Create cell structure for excel file write out:
%————————————————————————-
fprintf(‘Writing data to excel file…\n\n’);

xlsData = cell(nelements + 8, 21);

xlsData{1,1} = ‘System Analysis’;

xlsData{3,1} = ‘Reference Voltage’; xlsData{3,2} = 2.46;

xlsData{6,1} = ‘EEProm Readouts’;

xlsData{6,1} = ‘EEProm Readouts’; xlsData{6,7} = ‘Conversions to Physical Parameter’;

%xlsData{6,13} = ‘System Analysis 1’; xlsData{6,17} = ‘System Analysis 2 & 3’;

%xlsData{6,19} = ‘AEV Mass (kg)’;

xlsData{8,1} = ‘ Time (ms) ‘;
xlsData{8,2} = ‘ Current (counts) ‘;
xlsData{8,3} = ‘ Voltage (counts) ‘;
xlsData{8,4} = ‘ Marks (wheel counts) ‘;
xlsData{8,5} = ‘ Relative Marks (wheel counts) ‘;

xlsData{8,7} = ‘ Time (s) ‘;
xlsData{8,8} = ‘ Current (A) ‘;
xlsData{8,9} = ‘ Voltage (V) ‘;
xlsData{8,10} = ‘ Distance (m) ‘;
xlsData{8,11} = ‘ Position (m) ‘;
xlsData{8,12} = ‘ Speed (m/s) ‘;
xlsData{8,13} = ‘ Input Power (W) ‘;
xlsData{8,14} = ‘ Incremental Energy (J) ‘;
xlsData{8,15} = ‘ Total Energy (J) ‘;

%xlsData{8,17} = ‘ Velocity (m/s) ‘;
%xlsData{8,18} = ‘ Kinetic Energy (J) ‘;
%xlsData{8,19} = ‘ Propeller RPM ‘;
%xlsData{8,20} = ‘ Propeller Advance Ratio ‘;
%xlsData{8,21} = ‘ Propulsion Efficiency ‘;

xlsData(9:nelements+8,1) = num2cell(te);
xlsData(9:nelements+8,2) = num2cell(ie);
xlsData(9:nelements+8,3) = num2cell(ve);
xlsData(9:nelements+8,4) = num2cell(marks);
xlsData(9:nelements+8,5) = num2cell(pos);

xlsData(9:nelements+8,7) = num2cell(t);
xlsData(9:nelements+8,8) = num2cell(I);
xlsData(9:nelements+8,9) = num2cell(V);
xlsData(9:nelements+8,10) = num2cell(dist_abs);
xlsData(9:nelements+8,11) = num2cell(dist_rel);
xlsData(9:nelements+8,12) = num2cell(vel);
xlsData(9:nelements+8,13) = num2cell(Pin);
xlsData(9:nelements+8,14) = num2cell(energy_inc);
xlsData(9:nelements+8,15) = num2cell(energy_tot);

% Write data to excel file
xlswrite(FileName,xlsData);

% Now for some fancy formatting footwork!
hExcel = actxserver(‘Excel.Application’);
hWorkbook = hExcel.Workbooks.Open(FileName); %find the file

hExcel.Cells.Select;
hExcel.Cells.EntireColumn.AutoFit; %autofit all cells

% merge + bold the headliner cells amd highlight with distinct colors
MergeRange = hExcel.Range(‘A6:E6’);
MergeRange.Select;
MergeRange.MergeCells = 1;
MergeRange.HorizontalAlignment = -4108;

MergeRange = hExcel.Range(‘G6:O6’);
MergeRange.Select;
MergeRange.MergeCells = 1;
MergeRange.HorizontalAlignment = -4108;

hWorkbook.Worksheets.Item(1).Range(‘A6′).Interior.Color=hex2dec(’99CCFF’);
hWorkbook.Worksheets.Item(1).Range(‘G6’).Interior.Color=hex2dec(‘FFCC99’);
set(hWorkbook.Worksheets.Item(1).Range(‘A6’).Font, ‘Bold’, 1);
set(hWorkbook.Worksheets.Item(1).Range(‘G6’).Font, ‘Bold’, 1);

% bold the table headers
set(hWorkbook.Worksheets.Item(1).Range(‘A8:O8’).Font, ‘Bold’, 1);

% center the rest of the cells
centerRange = sprintf(‘A8:O%d’, nelements+8);
hWorkbook.Worksheets.Item(1).Range(centerRange).HorizontalAlignment = -4108;

% close up shop – all done here!
hWorkbook.Save; hWorkbook.Close;

%——–

fprintf(‘Finished!!!\n\n’);

%————————————————————————–
% Sub routine: Locate Serial Port
%————————————————————————–

function SerialPort = AskForSerialPort(varargin)

% What operatin system are we on?
if ispc

% Find current devices recognized by pc
devices = winqueryreg(‘name’, ‘HKEY_LOCAL_MACHINE’,…
‘HARDWARE\DEVICEMAP\SERIALCOMM’);
if (isempty(devices))
ports{1} = ‘NONE’;
else
ports = cell(1, length(devices));
for ii = 1:length(devices)
ports{ii} = winqueryreg(‘HKEY_LOCAL_MACHINE’,…
‘HARDWARE\DEVICEMAP\SERIALCOMM’, devices{ii});
end
end

% Ask user to select com port
[s,v] = listdlg(‘PromptString’,’Select a Com Port:’,…
‘SelectionMode’,’single’,…
‘ListString’,ports);

drawnow; % prevents MATLAB hangup

if v
SerialPort = ports{s};
else
SerialPort = ‘Cancel’;
end

elseif ismac

% ask user to type in the serial port they’re on
x = inputdlg(‘Enter the serial port:’, ‘AEV Analysis’, [1 50]);

drawnow; pause(0.05); % this innocent line prevents the Matlab hang

% User cancels
if isempty(x)
SerialPort = ‘Cancel’;
return
end

% Distribute input
SerialPort = x{:};

end

end

end % Function

Data Analysis Code

function Data_Analysis_Tool
%==========================================================================
% ITS_Analysis – Advance Energy Vehicle Analysis Software, v 1.0.4
%
% Refer to Design Analysis Tool section of the ITS Lab Manual for
% instruction on how to use this tool.
%
% Other m-files required: None
% Subfunctions: None
% MAT-files required: None
%
% Author: Dustin West
% The Ohio State University
% email address: west.425@osu.edu
% Last revision: 29-July-2015
%==========================================================================

%————————————————————————–
% Create Figure
%————————————————————————–

% Assign figure to “gui” and turn off visibility
gui = figure(‘Visible’,’off’);

% Initialize the GUI.
% Change unData to normalized so components resize automatically.
gui.Units = ‘pixels’;
gui.ToolBar = ‘none’;
gui.NumberTitle = ‘off’;
gui.Name = ‘Data Analysis Tool’;
gui.MenuBar = ‘none’;
gui.Resize = ‘on’;
gui.DockControls = ‘off’;
gui.SizeChangedFcn = @FigResize;

% Set “default figure window size
scrsz = get(0, ‘ScreenSize’);
MaxSX = round(scrsz(3)*.85); MaxSY = round(scrsz(4)*.85);
XBorder = (scrsz(3)-MaxSX)/2; YBorder = (scrsz(4)-MaxSY)/2;
gui.Position = [ XBorder, YBorder, MaxSX, MaxSY ];

%————————————————————————–
% Define Menu Options
%————————————————————————–

% File Menu
hfmenu = uimenu;
hfmenu.Parent = gui;
hfmenu.HandleVisibility = ‘callback’;
hfmenu.Label = ‘File’;

% Open File
uimenu(…
‘Parent’,hfmenu,…
‘Label’,’ Open EEProm File… (.mat) ‘,…
‘Separator’,’on’,…
‘HandleVisibility’,’callback’, …
‘Callback’, {@OpenFile,gui});

% Clear file and data
uimenu(…
‘Parent’,hfmenu,…
‘Label’,’ Clear File ‘,…
‘Separator’,’on’,…
‘HandleVisibility’,’callback’, …
‘Callback’, {@ClearFile,gui});

% Tool Menu
htmenu = uimenu;
htmenu.Parent = gui;
htmenu.HandleVisibility = ‘callback’;
htmenu.Label = ‘Tools’;

% Download EEProm Data
uimenu(…
‘Parent’,htmenu,…
‘Label’,’ Download Arduino Data ‘,…
‘Separator’,’on’,…
‘HandleVisibility’,’callback’, …
‘Callback’, {@aevDataRecorder,gui});

% Export plot to figure
uimenu(…
‘Parent’,htmenu,…
‘Label’,’ Export Figure ‘,…
‘Separator’,’on’,…
‘HandleVisibility’,’callback’, …
‘Callback’, {@ExportFigure,gui});

% View energy analysis in table
uimenu(…
‘Parent’,htmenu,…
‘Label’,’ View Performance Analysis ‘,…
‘Separator’,’on’,…
‘HandleVisibility’,’callback’, …
‘Callback’, {@ViewPerformanceAnalysis,gui});

% View arduino program
uimenu(…
‘Parent’,htmenu,…
‘Label’,’ View Arduino Program ‘,…
‘Separator’,’on’,…
‘HandleVisibility’,’callback’, …
‘Callback’, {@ViewArduinoProgram,gui});

% Append arduino program
uimenu(…
‘Parent’,htmenu,…
‘Label’,’ Append Arduino Program ‘,…
‘Separator’,’on’,…
‘HandleVisibility’,’callback’, …
‘Callback’, {@AppendArduinoProgram,gui});

% Plot Menu
hpmenu = uimenu;
hpmenu.Parent = gui;
hpmenu.HandleVisibility = ‘callback’;
hpmenu.Label = ‘Plot Type’;

% Power vs. Time
hdata.timeOption = uimenu(…
‘Parent’,hpmenu,…
‘Label’,’ Power vs. Time ‘,…
‘Separator’,’on’,…
‘Checked’,’on’,…
‘HandleVisibility’,’callback’, …
‘Callback’, {@setPlotType,gui,1});

% Power vs. Distance
hdata.distanceOption = uimenu(…
‘Parent’,hpmenu,…
‘Label’,’ Power vs. Distance ‘,…
‘Separator’,’on’,…
‘HandleVisibility’,’callback’, …
‘Callback’, {@setPlotType,gui,2});

%————————————————————————–
% Construct components
%————————————————————————–

% Plot Window
hdata.plot = axes(‘Parent’,gui,’Units’, ‘Pixels’);
hdata.plot.Box = ‘on’;
grid on

% Get default color scheme
hdata.colors = get(hdata.plot,’colororder’);

% University and Department Logo
hdata.component.logo = uicontrol(…
‘Style’ , ‘text’,…
‘Parent’ , gui, …
‘string’ , {‘The Ohio State University’,…
‘Engineering Education Innovation Center’},…
‘HorizontalAlignment’ , ‘center’,…
‘FontSize’ , 10);

% File 1 Components
hdata.component.file(1).label = uicontrol(…
‘Style’ , ‘text’ ,…
‘Parent’ , gui ,…
‘Units’ , ‘pixels’ ,…
‘string’ , ‘File :’ ,…
‘HorizontalAlignment’ , ‘left’ ,…
‘FontSize’ , 12 );
hdata.component.energy(1).label = uicontrol(…
‘Style’ , ‘text’,…
‘Parent’ , gui,…
‘Units’ , ‘pixels’,…
‘string’ , ‘Energy (J) :’,…
‘HorizontalAlignment’ , ‘left’,…
‘FontSize’ , 12);
hdata.component.file(1).text = uicontrol(…
‘Style’ , ‘text’,…
‘Parent’ , gui,…
‘Units’ , ‘pixels’,…
‘string’ , ”,…
‘ForegroundColor’ , hdata.colors(1,:),…
‘BackgroundColor’ , [1 1 1],…
‘enable’ , ‘on’,…
‘HorizontalAlignment’ , ‘center’,…
‘FontSize’ , 12);
hdata.component.energy(1).text = uicontrol(…
‘Style’ , ‘text’,…
‘Parent’ , gui,…
‘Units’ , ‘pixels’,…
‘string’ , ”,…
‘ForegroundColor’ , hdata.colors(1,:),…
‘BackgroundColor’ , [1 1 1],…
‘enable’ , ‘on’,…
‘HorizontalAlignment’ , ‘center’,…
‘FontSize’ , 12);

% File 2 Components
hdata.component.file(2).label = uicontrol(…
‘Style’ , ‘text’ ,…
‘Parent’ , gui ,…
‘Units’ , ‘pixels’ ,…
‘string’ , ‘File :’ ,…
‘HorizontalAlignment’ , ‘left’ ,…
‘FontSize’ , 12 );
hdata.component.energy(2).label = uicontrol(…
‘Style’ , ‘text’,…
‘Parent’ , gui,…
‘Units’ , ‘pixels’,…
‘string’ , ‘Energy (J) :’,…
‘HorizontalAlignment’ , ‘left’,…
‘FontSize’ , 12);
hdata.component.file(2).text = uicontrol(…
‘Style’ , ‘text’,…
‘Parent’ , gui,…
‘Units’ , ‘pixels’,…
‘string’ , ”,…
‘ForegroundColor’ , hdata.colors(2,:),…
‘BackgroundColor’ , [1 1 1],…
‘enable’ , ‘on’,…
‘HorizontalAlignment’ , ‘center’,…
‘FontSize’ , 12);
hdata.component.energy(2).text = uicontrol(…
‘Style’ , ‘text’,…
‘Parent’ , gui,…
‘Units’ , ‘pixels’,…
‘string’ , ”,…
‘ForegroundColor’ , hdata.colors(2,:),…
‘BackgroundColor’ , [1 1 1],…
‘enable’ , ‘on’,…
‘HorizontalAlignment’ , ‘center’,…
‘FontSize’ , 12);

% File 3 Components
hdata.component.file(3).label = uicontrol(…
‘Style’ , ‘text’ ,…
‘Parent’ , gui ,…
‘Units’ , ‘pixels’ ,…
‘string’ , ‘File :’ ,…
‘HorizontalAlignment’ , ‘left’ ,…
‘FontSize’ , 12 );
hdata.component.energy(3).label = uicontrol(…
‘Style’ , ‘text’,…
‘Parent’ , gui,…
‘Units’ , ‘pixels’,…
‘string’ , ‘Energy (J) :’,…
‘HorizontalAlignment’ , ‘left’,…
‘FontSize’ , 12);
hdata.component.file(3).text = uicontrol(…
‘Style’ , ‘text’,…
‘Parent’ , gui,…
‘Units’ , ‘pixels’,…
‘string’ , ”,…
‘ForegroundColor’ , hdata.colors(3,:),…
‘BackgroundColor’ , [1 1 1],…
‘enable’ , ‘on’,…
‘HorizontalAlignment’ , ‘center’,…
‘FontSize’ , 12);
hdata.component.energy(3).text = uicontrol(…
‘Style’ , ‘text’,…
‘Parent’ , gui,…
‘Units’ , ‘pixels’,…
‘string’ , ”,…
‘ForegroundColor’ , hdata.colors(3,:),…
‘BackgroundColor’ , [1 1 1],…
‘enable’ , ‘on’,…
‘HorizontalAlignment’ , ‘center’,…
‘FontSize’ , 12);

% File 4 Components
hdata.component.file(4).label = uicontrol(…
‘Style’ , ‘text’ ,…
‘Parent’ , gui ,…
‘Units’ , ‘pixels’ ,…
‘string’ , ‘File :’ ,…
‘HorizontalAlignment’ , ‘left’ ,…
‘FontSize’ , 12 );
hdata.component.energy(4).label = uicontrol(…
‘Style’ , ‘text’,…
‘Parent’ , gui,…
‘Units’ , ‘pixels’,…
‘string’ , ‘Energy (J) :’,…
‘HorizontalAlignment’ , ‘left’,…
‘FontSize’ , 12);
hdata.component.file(4).text = uicontrol(…
‘Style’ , ‘text’,…
‘Parent’ , gui,…
‘Units’ , ‘pixels’,…
‘string’ , ”,…
‘ForegroundColor’ , hdata.colors(4,:),…
‘BackgroundColor’ , [1 1 1],…
‘enable’ , ‘on’,…
‘HorizontalAlignment’ , ‘center’,…
‘FontSize’ , 12);
hdata.component.energy(4).text = uicontrol(…
‘Style’ , ‘text’,…
‘Parent’ , gui,…
‘Units’ , ‘pixels’,…
‘string’ , ”,…
‘ForegroundColor’ , hdata.colors(4,:),…
‘BackgroundColor’ , [1 1 1],…
‘enable’ , ‘on’,…
‘HorizontalAlignment’ , ‘center’,…
‘FontSize’ , 12);

%————————————————————————–
% Initialize variables
%————————————————————————–
hdata.FileTracker = zeros(1,4); % File tracker

%————————————————————————–
% Make GUI visible and save GUI data
%————————————————————————–

% Save gui data to prepare for immediate use of resize function.
guidata(gui,hdata);

% Make figure visible
gui.Visible = ‘on’;

% Disable java warning for status bar and maximizing figure window
warning(‘off’,’MATLAB:HandleGraphics:ObsoletedProperty:JavaFrame’);

% Add status bar.
hdata.SB = statusbar(gui,’Ready.’);

% Update gui data again now that status bar has been added.
guidata(gui,hdata);

% Update figure window and process callbacks.
drawnow;

% Maximize figure window.
jFrame = get(handle(gcf),’JavaFrame’);
jFrame.setMaximized(true);

% Re-enable java warning
warning(‘on’,’MATLAB:HandleGraphics:ObsoletedProperty:JavaFrame’);

end