Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
Scientific Computation
Part 1
In this part, you will work with model blood-flow velocity data files. The data provides
an approximate view of blood-flow dynamics in a circular cross section of a blood vessel.
we use polar coordinates (r, θ) with 0 ≤ r ≤ 1 and 0 ≤ θ ≤ 2π. All of the needed data
files for part 1 have been collected in p3data.zip. Unzipping this file will extract two
numpy data files, data1.npz and data2.npz. Code has been provided to load these files
using np.load. If you have any difficulty extracting/loading the data, please contact the
instructor.
1. (3 points) data1.npz contains velocity fields at 450 equispaced points in time. Code
has been provided in part1q1.py to load this data and create numpy arrays contain
ing the fields and the radial positions, angular positions, and times at which the
data is given. Analyze and compare the fields contained in this dataset at r = 0.1
and r = 0.5. As part of your analysis you should carefully examine how the veloc
ity varies with θ and time. Place the code used in your analysis in the function,
part1q1, and add a discussion of your findings along with supporting figures to your
report.
Part 2
1. (4 pts) The function model1d computes numerical solutions to a system of two
nonlinear partial differential equations which are a model for a chemical reaction
between two species with concentrations f(x, t) and g(x, t):
∂f
∂t
= −fg2 + a(1 − f) + d1
∂
2
f
∂x
2
(1)
∂g
∂t
= fg2 − (a + b)g + d2
∂
2
g
∂x2
.
(2)
Here, a, b, d1, and d2 are (positive) model parameters. where f and g are functions
of space and time, f(x, t), g(x, t), and α is a model parameter specified as input.
Initial conditions are generated within the code, and solutions are computed on a
spatial grid with 0 ≤ x ≤ L (see function documentation for more details).
Analyze simulation results for a = 0.028, b = 0.053, d1 = 2e − 5, d2 = 1e − 5,
and L = 5 with bc=0. Typically simulations contain an initial transient as the
system responds to the initial conditions followed by a relatively settled dynamical
state. Discard the transient in your analysis, and focus on fluctuations of f in space
and time (you may vary N t and T as needed). Also consider the global qualita
tive dynamics (e.g. the system is steady (no time-dependence), simple sinusoidal
oscillations in space and/or time, ...). Carefully analyze if/to what degree chaotic
dynamics are present. Qualitative observations should be supported by quantitative
results and well-designed figures. Add the code used in your analysis to the func
tion, part2q1analyze, and add the discussion of your findings along with supporting
figures to your report.