Python Developing work
10/4/22, 1:52 PM ChE_5321_Project_1_Final_Draft_Fall_2022
localhost:8888/nbconvert/html/OneDrive - Texas Tech University/Documents/Varun Potdar/Digital Computation/Digital Computation/Projects/New … 1/6
ChE 5323 Digital Computation, Fall 2022
Project 1
Due date: Friday, Oct 10th , 9:00 am CST
Maximum Score: 120 points
Exam Instructions Each student is required to take this exam and submit their work as an individual. This is not a group project. Email enquiries to the instructor or TA on questions given in the exam is prohibited during the exam period. Consulting with a colleague or working together on the exam is prohibited. The exam should be submitted as a jupyter notebook as well as a pdf on the Teams Assignment portal. Late submissions of exam will lead to a deduction of 50% of the points scored in the exam. Evidence of plagiarism or cheating will lead to an automatic score of zero on the exam, pending enquiry and resolution by TTU’s Office of Academic Integrity. If a student is ill during the exam period, please inform the instructor asap.
Part 1: System of linear equations: Flow of a liquid film down on an inclined surface [60 points]
Problem Statement: Consider the case of a liquid film flowing down a surface which is oriented at an angle relative to vertical. The film thickness
is assumed to be constant, making it possible to have fully developed flow. We wish to calculate the resulting velocity profile. The fluid is water, with density = , viscosity = . You are required to use the finite difference equations, which can be expressed in the matrix format , to solve for this question.
We have broken down this problem into three parts.
α = π 4
H = 100mm
ρ 103 kg
m3 μ Pa. s10−3
Ax = B
10/4/22, 1:52 PM ChE_5321_Project_1_Final_Draft_Fall_2022
localhost:8888/nbconvert/html/OneDrive - Texas Tech University/Documents/Varun Potdar/Digital Computation/Digital Computation/Projects/New … 2/6
In [21]:
) You will first create a function that takes the number of grid points as an input, and returns the corresponding coefficient matrix [10 points]. A
A
In [ ]:
#Write the function here.
In [14]:
#Run the function and display the output for 3 gridpoints.
) Create a function that returns the matrix [10 points].B B
In [ ]:
#Write the function here.
In [15]:
#Run the function and display the B values for 5 gridpoints
) Solve the system of equations to output a velocity matrix, where each value represents the velocity value of the fluid at its respective grid point. Also plot the velocity profile for grid points in the fluid domain [10 points].
C
5
In [8]:
#Solve for the velocity matrix here.
10/4/22, 1:52 PM ChE_5321_Project_1_Final_Draft_Fall_2022
localhost:8888/nbconvert/html/OneDrive - Texas Tech University/Documents/Varun Potdar/Digital Computation/Digital Computation/Projects/New … 3/6
In [20]:
) Perform the velocity profile analysis for and grid points in the fluid domain by graphing the velocity profiles on the same plot. What do you observe for the velocity profile with increasing grid points ? What is the reason for this difference, if any [15 points]?
D 10 50
In [11]:
#Plot for the profile for 10 & 50 gridpoints.
The analytical solution for this problem is given below. Generate the velocity profile from the finite difference method using 100 grid points, and overlay the result with the analytical solution [15 points].
Equation for analytical solution:
E)
v = ρg cos αH 2
2μ [1 − ( ]
y
H )2
In [12]:
#Plot for the profile of 100 gridpoints & the exact solution.
Part 2: Data visualization: Effect of drug concentration on activity. (60 points)
C. elegans
10/4/22, 1:52 PM ChE_5321_Project_1_Final_Draft_Fall_2022
localhost:8888/nbconvert/html/OneDrive - Texas Tech University/Documents/Varun Potdar/Digital Computation/Digital Computation/Projects/New … 4/6
are millimeter-scale worms that live for 3 weeks and are used as a model organism for aging research. In this experiment the animals are exposed to different concentrations of the anti- diabetic drug metformin. The effect of these drug concentrations are measured in terms of locomotory activity. The activity scores range from 0 to 1, with 1 being highly active animals.
My graduate student Hunter Edwards conducted experiments with 3 drug concentrations of metformin and measured the activity score of animals at age day 15. For each of these days, she measured the activity at 3 different time points TP1, TP2 and TP3. She conducted these experiments in triplicates, i.e. three biological trials.
The goal of this problem statement is to use her experimental data set and perform data visualization to understand whether metformin improved the worm activity in aged animals, and if so at what drug doses.
For parts A to C, use Dataset 1 and for part D use Dataset 2.
C. elegans
Create a new data frames corresponding to each drug concentration where each data frame has all the activity scores (i.e. 3 trials and 3 time points). (10 points)
A)
In [28]:
Out[28]:
<matplotlib.image.AxesImage at 0x1b316bc9550>
<Figure size 432x288 with 0 Axes>
10/4/22, 1:52 PM ChE_5321_Project_1_Final_Draft_Fall_2022
localhost:8888/nbconvert/html/OneDrive - Texas Tech University/Documents/Varun Potdar/Digital Computation/Digital Computation/Projects/New … 5/6
In [ ]:
) We will use the data set to explore the effect of drug concentration on the level of activity. Make a figure panel of 3 plots showing activity scores for each drug condition at each timepoint. Discuss the trends observed for the different drug concentrations at each timepoint. (15 points)
B
In [ ]:
# Plot TP's for each condition vs activity for day 15 dataset
Pool the data from all three trials and time points and visualize the data set to understand how different are the activity scores at the three drug concentrations. Discuss the trends observed in the distribution (i.e. Shape, central tendency, and variability) for each drug concentration. (15 points)
C)
In [ ]:
Use dataset 2, which shows the activity data for animals of ages day 11, day 15 and day 19. Reproduce the plot below that shows the distribution of activity scores for each age group. Discuss the trends observed. (20 points)
D)
Out[ ]:
[Text(0.5, 1.0, '100 uM')]
10/4/22, 1:52 PM ChE_5321_Project_1_Final_Draft_Fall_2022
localhost:8888/nbconvert/html/OneDrive - Texas Tech University/Documents/Varun Potdar/Digital Computation/Digital Computation/Projects/New … 6/6
In [31]:
In [ ]:
Out[31]:
<matplotlib.image.AxesImage at 0x1b316c655b0>
<Figure size 432x288 with 0 Axes>