Question: Can someone help me with the posted code, I know it needs to be a for loop but I can't get my code to run.

 Can someone help me with the posted code, I know it

Can someone help me with the posted code, I know it needs to be a for loop but I can't get my code to run. It is as follows:

V = 50; % Volume of Room in m^3

D = 0.0007; % Diffusion Coeff for Duct Tape in m^2/s

A = 0.002; % Area of exposed surface in m^2

T = 0.005; % Thickness of Duct Tape in m

Vv = 0.1; % Vat Volume in m^3

Co = 12.24; % Initial toxin concentration mol/m^3

Cl = 0.05; % Letal Concentration mol/m^3

C = 0;

format short

time = 0:1:1000;

Cr = [];

n = 1;

for k = 1:length(time);

J(n) = (A.*D.*(Co(n)))./(T.*Vv);%Finding Diffusion Rate

C(k) = (J(n).*T.*V)./(A.*D);

Co = Co - C;

Cr(n) = C(k)

n = n + 1;

end

%CO and J should be different each time.

%ID new concentration in room and in Vat

5. You are trapped in a 50-m laboratory when a large vat of deadly neurotoxin begins leaking. Thinking quickly, you attempt to seal the leak with duct tape. The toxin begins diffusing out. You know that the diffusion coefficient for this particular neurotoxin through the duct tape is 0.0007 m/s, there is 0.002 m of exposed surface to diffuse through, and that duct tape thickness is 0.005 m. The vat's volume is 0.1 m and the initial toxin concentration in the vat is 12.24 mol/m". The neurotoxin becomes lethal at a concentration of 0.05 mol/m. a. Use Matlab to construct a plot of the concentration of the deadly neurotoxin in the room (in 'mol/m") over time (in 's'). b. How long does it take for the concentration to rise to lethal levels? Hint: Look up Fick's law, assume steady-state process; note that the toxin concentration in the vat decreases with time - account for that in your calculations; use an iterative calculation with a small enough time step so that the curve is smooth

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!