Question

In: Computer Science

(MATLAB ONLY) (MATLAB ONLY) (MATLAB ONLY) (MATLAB ONLY) (MATLAB ONLY) (MATLAB ONLY) Please complete the following...

(MATLAB ONLY) (MATLAB ONLY) (MATLAB ONLY) (MATLAB ONLY) (MATLAB ONLY) (MATLAB ONLY)

Please complete the following Question in MATLAB ASAP, Thanks. :)

2a. Write a function that outputs the amount of freezing point depression (in degrees C) given a mass of magnesium chloride salt and a volume of water. Formula to calculate freezing point depression: ΔT = iKm in which ΔT is the change in temperature in °C, i is the van't Hoff factor, which = 3 for MgCl2 because it dissociates into three ions, one Mg+2 and two Cl- , K is a constant that equals 1.86 °C kg/mol and m is the molality of the solute in mol/kg. Other useful information so you don’t have to look it up: Moles of MgCl2 = (mass MgCl2)/((atomic mass Mg)+2*(atomic mass Cl)) Atomic mass Mg = 24.31 Atomic mass Cl = 35.45 Assume the density of water is 1.0 g/mL

2b. Use your function to calculate the depression for 100g MgCl2 dissolved in 500mL water

2c. Use your function to calculate the depression for 220g MgCl2 dissolved in 1L water

2d. Make a plot that shows the mass of MgCl2 necessary to depress the freezing point of a given volume (range: 1L - 100L) water by 1 degree Celsius. Give your plot appropriate labels and a title.

Solutions

Expert Solution

Matlab code:

clc
clear all

% part 2a : function definition is at the end of the code. please scroll
% down

% part 2b 

mass_salt = 100; % mass of MgCl2 in g 
vol_water= 500; % vol of water in ml 
delta_T = depression(mass_salt,vol_water);
X1 =['Part 2b : depression in freezing point when ',num2str(mass_salt),...
    ' g MgCl2 is dissolved in ',num2str(vol_water),' ml water is ',...
     num2str(delta_T),' degree celcius'];
disp(X1);


% part 2c

mass_salt = 220; % mass of MgCl2 in g 
vol_water= 1000; % vol of water in ml 
delta_T = depression(mass_salt,vol_water);
X2 =['Part 2c : depression in freezing point when ',num2str(mass_salt),...
    ' g MgCl2 is dissolved in ',num2str(vol_water),' ml water is ',...
     num2str(delta_T),' degree celcius'];
disp(X2);

% part 2d

delta_T= 1; % value given in C
i=3; % value given
K=1.86; % value given in C kg/mol
vol_water_L =1:1:100; % Volume range from 1 to 100 L
density_water =1; % water density in g/ml or kg/L
mass_water_kg = vol_water_L*density_water; % mass unit becomes kg
mol_salt = delta_T*mass_water_kg/i/K;  % from rearranging formula
mol_wt_salt= 24.31+35.45+35.45; % mass of 1 Mg and 2 Cl in g/mol
mass_salt_g=mol_salt*mol_wt_salt;
plot(vol_water_L,mass_salt_g); % plotting required graph
xlabel('vol of water in L');
ylabel(' mass of MgCl2 in g');
title('mass of MgCl2 salt required to depress freezing point by 1 degree celcius in water');


% part 2a : defining function to calculate depression in freezing point

function [delta_T]= depression(mass_salt,vol_water)

i=3;   % van't hoff factor
K=1.86;  % depression constant
mol_wt_salt= 24.31+35.45+35.45; % mass of 1 Mg and 2 Cl in g/mol
mol_of_salt=mass_salt/mol_wt_salt;
density_water = 1; % g/ml
mass_water_kg= vol_water*density_water/1000; % mass in kg
molality=mol_of_salt/mass_water_kg;
delta_T=i*K*molality;

end

Related Solutions

This is a Matlab Exercise problem. Please create the Matlab code and figure for the following...
This is a Matlab Exercise problem. Please create the Matlab code and figure for the following problem using problem specifications: Plot x vs y when y=sin(x), y=cos(x), y=sin (2*x), and y=2*sin(x) when x = 1:0.1:10. Use 2 by 2 subplot, sin(x) is in location 1, cos(x) is in location 2, sin(2*x) is in location 3 and 2*sin(x) is in location 4. The plot should have: (1) x label = ‘x value’, y label = ‘y value’, legend ‘y=sin(x)’,’ y=cos(x)’,’ y=sin...
MATLAB ONLY please. Please put the entire code below. 1. you will read a list of...
MATLAB ONLY please. Please put the entire code below. 1. you will read a list of internet logs from a notepad. 2. then you will extract the following. - a host (e.g., '146.204.224.152') - a user_name (e.g., 'feest6811' note: sometimes the username is missing! In this case, use '-' as the value for the username.) - the timme a request was made (e.g., '21/Jun/2019:15:45:24-0700') - the post request type (e.g., 'POST /incentivize HTTP/1.1' note: not everthing is a POST!) Your...
Using newer versions of MATLAB, please write the complete code for: 1. Assume Y is an...
Using newer versions of MATLAB, please write the complete code for: 1. Assume Y is an exponential random variable with rate parameter λ=2. (1) Generate 1000 samples from this exponential distribution using inverse transform method (2) Compare the histogram of your samples with the true density of Y.
(only matlab code please) solve and plot the relation between the position vs time where m1=...
(only matlab code please) solve and plot the relation between the position vs time where m1= 1 kg , m2 = 1.5 kg (Mass) k1= 100 N/m , k2 = 125 N/m (spring) b = 1 (damper) Initial conditions: y1(0) =0.15 m , y ’1(0) =0.05 m/s y2(0) =0.05 m , y ’2(0) =0.03 m/s U1(t) = unit step starting at t (step time) = 0 sec U2 = u (t,5) (t (step time) = 5 sec) t = linspace(0,25)...
(NO CLICKED PHOTOS OR SCREENSHOTS PLEASE, ONLY COMPLETE SOLUTION) The data in the table below presents...
(NO CLICKED PHOTOS OR SCREENSHOTS PLEASE, ONLY COMPLETE SOLUTION) The data in the table below presents the hourly quantity of production for three lines of production processes over the first 4 days in XYZ Company. Answer the questions based on the Excel Output given below. Day Process 1 Process 2 Process 3 1 33 33 28 2 30 35 36 3 28 30 30 4 29 38 34 ANOVA: Single Factor SUMMARY Groups Count Sum Average Variance Process 1 4...
Please complete in only C++, using loops Assignment: For this assignment you’ll be designing a program...
Please complete in only C++, using loops Assignment: For this assignment you’ll be designing a program which can take the input of a decimal number and a numerical base, and convert the decimal number to that base. For example, if given the decimal number seven and the base two, your program should output it as 111, which is how seven is represented in binary. Another example, 8,943 in base 10, is 13,236 in base 9. You’ll need to perform these...
Use Matlab to do the following (please) : 1. Plot the following signals in one figure...
Use Matlab to do the following (please) : 1. Plot the following signals in one figure window using Matlab commands. Given x (n) = {5,2,1,3,1,4,2} plot x(3n) 2. Plot all transformations of a Gaussian signal in one figure window 3. Plot r(-3t-9).
How to design FIR lowpass filter using matlab. Note : Do not write matlab code. Only...
How to design FIR lowpass filter using matlab. Note : Do not write matlab code. Only explain the steps of designing filter
Please only answer if you're 100% on the answer and can fully complete. Thank you. USE...
Please only answer if you're 100% on the answer and can fully complete. Thank you. USE FIRST-IN, FIRST-OUT COSTING Sulu Company produces its finished product in two processing departments--Assembly and Packaging. The following information is available for the month of July: Assembly Department: The beginning work-in-process inventory was $5,755 ($4,815 direct materials and $940 conversion costs) and consisted of 350 units that were 10% complete as to conversion costs. During July, an additional 4,500 units were started into production. A...
Please complete the 2018 federal income tax return for Sarah Hamblin. Be sure to include only...
Please complete the 2018 federal income tax return for Sarah Hamblin. Be sure to include only required tax forms when completing the tax return. For purposes of this assignment, unless instructed otherwise, you do not need to attach Form 8582. Also, ignore the requirement to attach the Form(s) W-2 to the front page of the Form 1040. If required information is missing, use reasonable assumptions to fill in the gaps. Sarah Hamblin and her now ex-husband Kevin were legally divorced...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT