You are on page 1of 7

AE617 Assignment #1

Pawan Singh Negi (174010003)


due on Aug 10 , 2017
Instructions to run the files

1. Open the zip file in a folder

2. make sure to keep all the files in same folder

3. run the python file using python <filename >

1
Problem 1: t + (2 /2)x = 0, in the domain [-2,2], with initial conditions:

(x, 0) = 1, |x| < 1/3


(x, 0) = 0, |x| > 1/3
Plot versus x obtained numerically at t = 2/3 and t = 4/3 and compare
with analytical solution for validation.

Plot at t = 2/3
1.0 Flux Splitting
Analytical

0.8

0.6
rho

0.4

0.2

0.0
2.0 1.5 1.0 0.5 0.0 0.5 1.0 1.5 2.0
x

Figure 1: Comparsion of analytical and numerical data

In Figure1 orange denotes the analytical / exact solution of the problem given
and blue is the numerical solution by implementing flux splitting scheme. the
total time for running simulation is 2/3 sec.

2
Plot at t = 4/3
1.0 Flux Splitting
Analytical

0.8

0.6
rho

0.4

0.2

0.0
2.0 1.5 1.0 0.5 0.0 0.5 1.0 1.5 2.0
x

Figure 2: Comparsion of analytical and numerical data

In Figure2 orange denotes the analytical / exact solution of the prob-


lem given and blue is the numerical solution by implementing flux splitting
scheme. the total time for running simulation is 4/3 sec.

3
Problem 2: Consider the traffic equation t + (Umax [1])x = 0 , 0 <
< 1 , Umax = 1.0
a ) Solve with initial conditions (x, 0) = 0.25 + 0.75exp(0.25x2 ), domain
[30, 30]. Plot (x, 25).

Plot at t = 25
0.60

0.55

0.50

0.45
rho

0.40

0.35

0.30

0.25
30 20 10 0 10 20 30
x

Figure 3: Result using previuosly validated solver

the solution is very much distorted due to number of grid points taken as
100.

4
b) Solve with initial discontinuous data l = 0.25, r = 1.0, jump at x = 0.0,
domain [40, 10]. Plot (x, 36).

Plot at t = 36
1.0
0.9
0.8
0.7
rho

0.6
0.5
0.4
0.3

40 30 20 10 0 10
x

Figure 4: Result using previuosly validated solver

5
b) Solve with initial discontinuous data l = 1.0, r = 0.0, jump at x = 0.0,
domain [30, 20]. Plot (x, 18).

Plot at t = 18
1.0

0.8

0.6
rho

0.4

0.2

0.0
30 20 10 0 10 20
x

Figure 5: Result using previuosly validated solver

You might also like