Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %%Question 2
- H_conc=logspace(-3,-1,10);
- pH=-log10(H_conc);
- pHtable = table(H_conc.', pH.','VariableNames',{'H_Conc','pH'})
- %%Question 3
- Q = 8000;
- R = 1.987;
- k0 = 1200;
- T = linspace(100,500,50);
- k = k0*exp(-Q./(R*T));
- Arrhenius_table=table(T.',k.','VariableNames',{'T','k'})
- %%Question 4
- format short g
- thermocouple = [84.3 90.0 86.7
- 86.4 89.5 87.6
- 85.2 88.6 88.3
- 87.1 88.9 85.3
- 83.5 88.9 80.3
- 84.8 90.4 82.4
- 85.0 89.3 83.4
- 85.3 89.5 85.4
- 85.3 88.9 86.3
- 85.2 89.1 85.3
- 82.3 89.5 89.0
- 84.7 89.4 87.3
- 83.6 89.8 87.2]
- max_thermocouple = max(thermocouple);
- max_thermocouple1 = max_thermocouple(1)
- max_thermocouple2 = max_thermocouple(2)
- max_thermocouple3 = max_thermocouple(3)
- %%Question 5
- clear;clc
- t = 100:100:1000;
- p = 100:100:1000;
- R = 0.2870;
- [T,P]=meshgrid(t,p);
- v=(R*T)./P
- %%Question 6
- clear;clc
- Hv = 2.453 * 10^6;
- Rair = 461;
- Tf = -60:10:120;
- Tk = (Tf-32)*(5/9) + 273.15 %Conversion from Fahrenheit to Kelvin
- po = 6.11*exp((Hv/Rair)*((1/273)-(1./Tk)));
- Table6=table(Tf.',po.','VariableNames',{'T_K','po_mbar'})
- plot(po,Tf)
- title('Temperature vs Saturation Vapor Pressures');
- xlabel('po, mbar')
- ylabel('T, °F')
- %%Question 7
- Q = 1000;
- k0 = 10;
- R = 8.314;
- T = 300:1000;
- k = k0*exp(-Q./(R*T));
- lgk = log10(k);
- Tinv = 1./T;
- subplot(2,1,1)
- plot(T,k)
- title('k vs T')
- xlabel('T')
- ylabel('k')
- subplot(2,1,2)
- plot(lgk,Tinv)
- title('lgk vs 1/T')
- xlabel('1/T')
- ylabel('lgk')
- %%Question 8
- mass = 1:1:10;
- mr = [78.115 46.07 102.3];
- nmoles(mass,mr)
- %%Question 9
- n = 1:1:10;
- mr = [78.115 46.07 102.3];
- mass(n,mr)
- %%Question 11
- clear;clc
- a = 28.90;
- b = 0.1967 * 10^-2;
- c = 0.4802 * 10^-5;
- d = -1.966 * 10^-9;
- T1 = 300;
- T2 = 300; %Initial guess
- h = a*(T2-T1) + 0.5*b*(T2^2-T1^2)+(c/3)*(T2^3-T1^3)+0.25*d*(T2^4-T1^4);
- while h<8900 %Iterative loop
- T2 = T2 + 0.01;
- h = a*(T2-T1) + 0.5*b*(T2^2-T1^2)+(c/3)*(T2^3-T1^3)+0.25*d*(T2^4-T1^4);
- end
- T2
- %%nmoles
- %Needed to save as separate file, nmoles.m to answer Question 8
- function output = nmoles(mass,mr)
- [MASS,MR]=meshgrid(mass,mr);
- output = (MASS./MR)';
- %%mass
- %Needed to save as separate file, mass.m to answer Question 9
- function output = mass(moles,mr)
- [MOLES,MR]=meshgrid(moles,mr);
- output = (MOLES.*MR)';
- %%heat
- %Needed to save as separate file, heat.m to answer Question 10
- function output = heat(mass)
- m = 1;
- Cp = 1;
- output = mass*m*Cp;
- %%cal_to_j
- %Needed to save as separate file, cal_to_j.m to answer Question 10
- function output = cal_to_j(cal)
- output = 4.2*cal;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement