Sie sind auf Seite 1von 4

QUESTION 1A

% NAME: Muhammad Misbahu


% REG. NUMBER: U11CE1112
% COURSE : CHEN 503
% ASSIGNMENT
% QUESTION ONE
function dLF2dt = Assignment(t,X);
% Parameters
A=1; rho=1000; F1=20; x=10;
% Splitting
% Assuming negligible heat input i.e constant Cp
% Since no data was provided for Ah and Cp we cant include it
L=X(1);
F2=X(2);
% THE MODEL
% Total continuity equation
dMdt=(F1-F2);
% Variation of L with time
F2=(x)*sqrt(L);
dLdt=(F1-F2)/(rho*A);
% Variation of F2 with time
dF2dt=(F1-F2)*(x^2)/(2*rho*A*F2);
% Output
dLF2dt=[dLdt;dF2dt];

L0s=2.1;
F02s=x*sqrt(L0s);
tspan=[0:100:1800];
[t,X]=ode45('Assignment',tspan,[L0s;F02s]);
plot(t,X(:,1),'red')
ylabel('L(m)')
xlabel('time(s)')
title('plot of L vs t, for F1=20kg/s when t=1800s')
figure
plot(t,X(:,2))
ylabel('outlet fowrate F2(kg/s)')
xlabel('time, t(s)')
plot of L vs t, for F1=20kg/s when t=1800s
4

3.8

3.6

3.4

3.2
L(m)

2.8

2.6

2.4

2.2

2
0 200 400 600 800 1000 1200 1400 1600 1800
time(s)
title(' Plot of F2 Vs t, for F1=20kg/s when t=1800s')
Plot of F2 Vs t, for F1=20kg/s when t=1800s
20

19
outlet fowrate F2(kg/s)

18

17

16

15

14
0 200 400 600 800 1000 1200 1400 1600 1800
time, t(s)
QUESTION 1B
% NAME: Muhammad Misbahu
% REG. NUMBER: U11CE1112
% COURSE : CHEN 503
% ASSIGNMENT
% QUESTION ONE
function dLF2dt = homecool(t,X);
% Parameters
A=1; rho=1000; F1=8; x=10;
% Splitting
L=X(1);
F2=X(2);
% THE MODEL
% Total continuity equation
dMdt=(F1-F2);
% Variation of L with time
F2=x*sqrt(L);
dLdt=(F1-F2)/rho*A;
% Variation of F2 with time
dF2dt=(F1-F2)*(x^2)/(2*F2*rho*A);
% Output
dLF2dt=[dLdt;dF2dt]

L0s=2.1; % initial liquid height


F02s=x*L0s^0.5; % initial flowrate
tspan=[0:100:1800];
[t,X]=ode45('homecool',tspan,[L0s;F02s]);
plot(t,X(:,1),'green')
ylabel('liquid height(m)')
xlabel('time(s)')
title('plot of L vs t when F1=8kg/s for t=1800')
figure
plot(t,X(:,2))
title('Plot of F2 Vs t, for F1=8kg/s when t=1800')
ylabel('F2(kg/s)')
xlabel('t(s)')
plot of L vs t, for F1=20kg/s when t=1800s
2.2

1.8

1.6
L(m)

1.4

1.2

0.8

0 200 400 600 800 1000 1200 1400 1600 1800


time(s)

Plot of F2 Vs t, for F1=20kg/s when t=1800s


15

14

13
outlet fowrate F2(kg/s)

12

11

10

7
0 200 400 600 800 1000 1200 1400 1600 1800
time, t(s)

Das könnte Ihnen auch gefallen