Question


media%2F20f%2F20f8abf5-2f11-4a01-9c23-c3
0 0
Add a comment Improve this question Transcribed image text
Answer #1

녀ven : Fluidi 5 fid 2 2 Ly0O 3 R. 140,540 kPa 1Go. 16 kPa 2.3

MATLAB Script:

clear
clc

%Densities
rho = [800 1000 1400];
%Depth from surface of liquid to each interface
heights = [5 7 10];

h = 0:0.1:heights(end);

%Atmospheric Pressure in Pa
Patm = 1.013e5;

%Acceleration due to gravity in m/s^2
g = 9.81;

for i = 1:length(h)
if h(i) <= heights(1)
P(i) = Patm + (rho(1)*g*h(i));
pos1 = i;
elseif h(i) > heights(1) && h(i) <= heights(2)
P(i) = P(pos1) + (rho(2)*g*(h(i)-h(pos1)));
pos2 = i;
elseif h(i) > heights(2)
P(i) = P(pos2) + (rho(3)*g*(h(i)-h(pos2)));
  
end
end

plot(h(1:pos1),P(1:pos1)/1000,'linewidth', 1.25)
hold on
plot(h(pos1:pos2),P(pos1:pos2)/1000,'linewidth', 1.25)
hold on
plot(h(pos2:end),P(pos2:end)/1000,'linewidth', 1.25)

xlabel 'Y (m)'
ylabel 'Pressure (KPa)'

legend Liquid1 Liquid2 Liquid3
grid on

Depth = [0 heights]';
Pressure = [Patm P(pos1) P(pos2) P(end)]'/1000;
Density = [NaN 800 1000 1400]';
T = table(Depth,Pressure,Density);
T.Properties.VariableNames = {'Depth_in_m' 'Pressure_in_KPa' 'Density'}

  

Output of above script:

4x3 table Depth inm Pressure in KPa n kP Density 101.3 140.54 160.16 201.36 NaN 800 1000 1400 10

Graph of Pressure against depth from the surface

220 Liquid1 Liquid2 Liquid3 200 180 160 140 120 100 0 12 3 456789 10 Y (m)

Add a comment
Know the answer?
Add Answer to:
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT