Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

% PLEASE READ ALL THE LOCKED COMMENTS CAREFULLY BEFORE SUBMITTING ANY ANSWERS. % IF YOU DO NOT READ THESE COMMENTS, YOU ARE LIKELY TO OVERLOOK

% PLEASE READ ALL THE LOCKED COMMENTS CAREFULLY BEFORE SUBMITTING ANY ANSWERS.
% IF YOU DO NOT READ THESE COMMENTS, YOU ARE LIKELY TO OVERLOOK AN IMPORTANT DETAIL
% OF THE REQUIRED SUBMISSION STYLE.
% Import your data and make any preliminary calculations between here and the next
% set of locked lines.
% Create your Boyle's Law plot between here and the next set of locked lines.
F1= figure(1)% create a figure handle called F1, for checking your answers
% make sure your figure has a legend or MATLAB Grader will not grade your work correctly.
% Plot your Gay-Lussac's Law figure between here and the next set of locked lines.
F2= figure(2)% create a figure handle called F2, for checking your answers
% make sure your figure has a legend or MATLAB Grader will not grade your work correctly.
% Perform the rest of your calculations below this locked line.
% Define the Excel file name
filename = 'Raw_Data.xlsx';
% Read data from each sheet
% Make sure the sheet names match exactly with those in the Excel file
data_air = readtable(filename, 'Sheet', 'Air');
data_co2= readtable(filename, 'Sheet', 'CO2');
data_n2= readtable(filename, 'Sheet', 'N2');
% Example: Assuming the first column is temperature and the rest are pressures
% Convert temperatures from Celsius to Kelvin
temperatures_air = table2array(data_air(:,1))+273.15; % Celsius to Kelvin
% Assuming the first row is volume and the rest are pressures
% Extract volumes (assuming they are in the first row)
volumes = data_air.Properties.VariableNames(2:end); % Variable names from the second column onwards
% Boyle's Law for Air: P vs V at constant T
% You would use specific rows for specific temperatures
% This is just an example, you need to modify it to match your data
F1= figure(1);
hold on;
for i =1:3% Assume we are plotting for first three temperatures
P_air = table2array(data_air(i,2:end)); % Pressure values for a specific temperature
V = str2double(volumes); % Convert volume strings to numbers
plot(V, P_air, '-o', 'DisplayName', ['T =' num2str(temperatures_air(i))' K']);
end
hold off;
legend('show');
title('Boyle''s Law for Air');
xlabel('Volume (L)');
ylabel('Pressure (kPa)');
% Gay-Lussac's Law for CO2: P vs T at constant V
% Again, you need to choose the appropriate columns for constant volumes
F2= figure(2);
hold on;
for j =1:4% Assume we are plotting for first four volumes
P_co2= table2array(data_co2(:, j+1)); % Pressure values for a specific volume
plot(temperatures_air, P_co2,'-s', 'DisplayName', ['V =' volumes{j}]);
end
hold off;
legend('show');
title('Gay-Lussac''s Law for CO2');
xlabel('Temperature (K)');
ylabel('Pressure (kPa)');
Is Boyle's Law plot x data correct? 0%(5%)
Assertion failed.
Is Boyle's Law plot y data correct? 0%(5%)
Assertion failed.
Assessment result: incorrect Is Gay-Lussac's Law plot x data correct? 0%(5%)
Assertion failed.
Assessment result: incorrect Is Gay-Lussac's Law plot y data correct? 0%(5%)
Assertion failed.
Assessment result: incorrect Is Rair correct? 0%(10%)
The submission must contain a variable named Rair.
Make sure you are using all the given data points for air, using absolute temperature and pressure, and calculating the gas constant with the proper units.
Assessment result: incorrect Is the percent difference for Rair correct? 0%(5%)
The submission must contain a variable named diffRair.
Make sure you are working in a consistent set of units and multipying by 100 to convert to %.
Assessment result: incorrect Is the uncertainty in Rair correct? 0%(5%)
The submission must contain a variable named uRair.
Make sure you are using the default normalization factor of the std function in MATLAB.
Assessment result: incorrect Is RCO2 correct? 0%(10%)
The submission must contain a variable named RCO2.
Make sure you are using all the given data points for carbon dioxide, using absolute temperature and pressure, and calculating the gas constant with the proper units.
Assessment result: incorrect Is the percent difference for RCO2 correct? 0%(5%)
The submission must contain a variable named diffRCO2.
Make sure you are working in a consistent set of units and multipying by 100 to convert to %.
Assessment result: incorrect Is the uncertainty in RCO2 correct? 0%(5%)
The submission must contain a variable named uRCO2.
Make sure you are using the default normalization factor of the std function in MATLAB.
Assessment result: incorrect Is RN2 correct? 0%(10%)
The submission must contain a variable named RN2.
Make sure you are using all the given data points for nitrogen, using absolute temperature and pressure, and calculating the gas constant with the proper units.
Assessment result: incorrect Is the percent difference for RN2 correct? 0%(5%)
The submission must contain a variable named diffRN2.
Make sure you are working in a consistent set of units and multipying by 100 to convert to %.
Assessment result: incorrect Is the uncertainty in RN2 correct? 0%

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions