Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

NAME:BHASKAR RAO

Roll no. : 13021A2535

Expt. no: 3b
Date:

TWO TANK LIQUID LEVEL INTERACTING SYSTEM


(USING EULERS METHOD)
PROBLEM STATEMENT:
Solve the set of differential equations that describe the two tank liquid level interacting
system.
d h1
h h
=qq1 w h ere q 1= 1 2
dt
r1
d h2
h
=q1q 2 w h ere q2 = 2
dt
r2
are q=10ft3/min,

The parameter values


r1=1ft/cfm, r2=1ft/cfm

Fig: Interacting System

MATLAB CODE:
SCRIPT FILE1:
function h1dot=interactingeuler1(t,h1,h2)
q=10;
r1=1;
r2=1;
q1=((h1-h2)/r1);
q2=h2/r2;
dh1dt=q-q1;
h1dot=[dh1dt]
SCRIPT FILE2:
function h2dot=interactingeuler2(t,h1,h2)
q=10;
r1=1;
r2=1;
q1=((h1-h2)/r1);
q2=h2/r2;
dh2dt=q1-q2;

NAME:BHASKAR RAO
h2dot=[dh2dt]

Roll no. : 13021A2535

NAME:BHASKAR RAO

Roll no. : 13021A2535

SCRIPT FILE3:
clc;
clear;
t(1)=0;
h1(1)=2.2;
h2(1)=1;
h=0.5;
sc=5;
n=(sc/h);
for i=1:n
t(i+1)=t(i)+h;
h1(i+1)=h1(i)+(h*interactingeuler1(t(i),h1(i),h2(i)));
h2(i+1)=h2(i)+(h*interactingeuler2(t(i),h1(i),h2(i)));
end
subplot(2,1,1),plot(t,h(:,1)),xlabel(time(min)),ylabel(h1(ft));
title({TWO TANK LIQUID LEVEL INTERACTING SYSTEM (USING EULERS
METHOD);h1 vs t});
subplot(2,1,2),plot(t,h(:,2)), xlabel(time(min)),ylabel(h2(ft));
title(h2 vs t);

NAME:BHASKAR RAO

Roll no. : 13021A2535

OUTPUT:
S.No
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39

Time(min)
0.0
0.5
1.0
1.5
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
6.0
6.5
7.0
7.5
8.0
8.5
9.0
9.5
10.0
10.5
11.0
11.5
12.0
12.5
13.0
13.5
14.0
14.5
15.0
15.5
16.0
16.5
17.0
17.5
18.0
18.5
19.0

h1(ft)
2.2000
6.6000
8.8500
11.0750
12.7500
14.1438
15.2594
16.1656
16.8977
17.4902
17.9695
18.3573
18.6710
18.9249
19.1302
19.2963
19.4307
19.5394
19.6274
19.6986
19.7569
19.8207
19.8404
19.8709
19.8955
19.9155
19.9316
19.9447
19.9552
19.9638
19.9707
19.9763
19.9808
19.9845
19.9875
19.9898
19.9918
19.9934
19.9946

h2(ft)
1.0000
1.1000
3.3000
4.4250
5.5375
6.3750
7.0719
7.6297
8.0828
8.4488
8.7451
8.9848
9.1787
9.3355
9.4624
9.5651
9.6482
9.7154
9.7697
9.8137
9.8493
9.8781
9.9013
9.9202
9.9354
9.9478
9.9577
9.9658
9.9723
9.9776
9.9819
9.9854
9.9882
9.9904
9.9922
9.9937
9.9949
9.9959
9.9967

NAME:BHASKAR RAO
40
41

Roll no. : 13021A2535


19.5
20

19.9957
19.9965

9.9973
9.9976

NAME:BHASKAR RAO

Roll no. : 13021A2535

MANUAL CALCULATIONS:
S.No
1
2
3
4
5
6

PLOTS:

Time(min)
0.0
0.5
1.0
1.5
2.0
2.5

h1(ft)
2.2000
6.6000
9.9500
12.4625
14.3469
15.7602

h2(ft)
1.0000
3.3000
4.9750
6.2313
7.1735
7.8801

You might also like