THE PENNSYLVANIA STATE UNIVERSITY
Department of Chemical Engineering
ChE360 problem set 5 (due Tuesday Nov 8, 2016)
c
2012
by S. T. Milner, all rights reserved
October 25, 2016
1
Verifying the Gaussian solution
a) Verify that
2
er /(4Dt)
(r, t)
t3/2
(1)
ChE 360 - Mathematical Methods in Chemical Engineering, Spring 2015
Homework Set 5
Assigned: Saturday, March 19
Due: Thursday, March 26th on-line (at the beginning of the lecture)
Note: Please use the le notation to upload the le on angel, label clearly t
If we run the file HW1_Q1, we get the following output in the command window:
> HW1_Q1
ans =
The liquid/gas nitrogen volume per is 6.796621e-05 and 6.254211e-04 m^3/mol, respectively
part b) In the command window, we call the function written in file HW1_
HW #4:
Part C:
%We want to solve the ODE between t=0 and t=20. Time increments
are 0.1
tf = 100;
dt = .1;
%We define a function equal to dC/dt
A = [
-2.6 0.2 0.3 0.2;
0.8 -0.2 0 0;
0.7 0
-.3 0;
0.5 0
0 -.2];
I = 3;
B = [0.1; 0 ; 0 ; 0];
dC = @(C) A*C+B*I;
ChE 360 - Mathematical Methods in Chemical Engineering, Spring 2015
Homework Set 3
Assigned: Thursday, February 19
Due: Thursday, February 26th on-line (at the beginning of the lecture)
Note: Please use the le notation to upload the le on angel, label cle
ChE 360 - Mathematical Methods in Chemical Engineering, Spring 2015
Homework Set 2
Assigned: Saturday, February 14
Due: Thursday, February 19 (at the beginning of the lecture)
Note: Please include your name in the rst page, label clearly the problems and
ChE 360 - Mathematical Methods in Chemical Engineering, Spring 2015
Homework Set 6
Assigned: Friday, March 27st
Due: Thursday, April 2nd
The temperature prole in a horizontal straight pin n of uniform cross section (Fig. 1) described by the heat
Figure 1:
ChE 360 - Mathematical Methods in Chemical Engineering, Spring 2015
Homework Set 3
Assigned: Thursday, February 19
Due: Thursday, February 26th on-line (at the beginning of the lecture)
Note: Please use the le notation to upload the le on angel, label cle
ChE 360 - Mathematical Methods in Chemical Engineering, Spring 2015
Homework Set 1
Assigned: Friday, January 30
Due: Thursday, February 5th on-line (at the beginning of the lecture)
Note: Please use the le notation to upload the le on angel, label clearly
Homework #5:
Part e)
C(t+dt) = C(t) + dt * f
f is dC/dt which is a nonlinear vector function. We linearize f:
C(t+dt) = C(t) + dt *A*C(t) = (I+dt*A)*C(t)
where I is a 2x2 identity matrix.
C(t + dt) = [
1
0
1
]
()
After N steps we have:
C(t+N*dt) = (I+dt
Problem Set #7
CHE 360
Due: Thursday, 4/16/2015
Consider the 2D Poisson equation on 11 square domain.
2u 2u
50exp(2 x) for 0 x 1 and 0 y 1
x 2 y 2
The boundary conditions are illustrated in the figure below.
y
u( x,1) 1
ux (1, y) 0
ux (0, y) 0
u( x,0) 0
M = 50;
N = 50;
Lx = 1;
Ly = 1;
u0=ones(N,M);
u=fsolve(@hotplate,u0);
%Discretized Variables:
x = linspace(0,Lx,N);
y = linspace(0,Ly,M);
surf(x,y,u)
%This estimates the value of u(.5,.5)
u_m=(u(25,25)+u(26,26)/2;
% ans =
%
% 1.7901
THE PENNSYLVANIA STATE UNIVERSITY
Department of Chemical Engineering
ChE360 problem set 3 (due Thursday October 6, 2016)
c
2012
by S. T. Milner, all rights reserved
September 20, 2016
1
1d Newton method
Write a function newNewton1d[x0 ], which takes as it
THE PENNSYLVANIA STATE UNIVERSITY
Department of Chemical Engineering
ChE360 problem set 2 (due Thursday Sept 29, 2016)
c
2012
by S. T. Milner, all rights reserved
September 19, 2016
1
Linear least-squares fit
(a) Use Mathematica to fit the data set fakeDa
data = Import["/Users/davesahagian/Desktop/fakeData.txt", "Table"];
points = %;
scatter = ListPlot[points, PlotLabel "Linearization of Data.txt"]
Linearization of Data.txt
15
10
5
-3
-2
1
-1
2
3
-5
-10
-15
Making a linear fit using the Fit Comma
"In my lecture notes 4.4.2 I described a 2d scheme for solving time-dependent
diffusion equations,called the alternating direction implicit (ADI)
method,encoded in Eqns.(4.88) and (4.89).In this scheme,the second spatial
derivative in x is treated fully e
THE PENNSYLVANIA STATE UNIVERSITY
Department of Chemical Engineering
ChE360 problem set 5 solutions
c
2012
by S. T. Milner, all rights reserved
March 28, 2012
1
Verifying the Gaussian solution
a) Start with
2
er /(4Dt)
(r, t) =
t3/2
(1)
= (3/2)/t + r2 /(
data = Table[cfw_x, 2 x + 1 + .3 + RandomVariate[NormalDistribution[], cfw_x, 0, 2, .1];
fit = NonlinearModelFit[data, m x + b, cfw_m, b, x]
params = Table[FindFit[data, cfw_m x + b, cfw_m, b, x], cfw_5000]
(*Find FIt Works Just as BestParameter*)
bestp