Docsity

Chemical - Computational Methods - Lecture Slides, Slides of Computational Methods

Partial preview of the text

Download Chemical - Computational Methods - Lecture Slides and more Slides Computational Methods in PDF only on Docsity!

Prob 5.47, 5.

Tutorial

Problem 5.47  Chemical Rcn Order

  • 1

st

Order Rate Eqn is Expontnential

( ) [ ( )]

kt mx

C t = C ⋅ e ⇒ y = be

  • By SemiLog Linearization we can “Discover”

parameters [m & b]  [C(0) & −k]

 2

nd

Order Eqn can

be LINEARIZED as (^) ( ) ( ) 0

C

kt

C t

Y = mX + B

  • Thus ANOTHER

Linearizable Fcn

1 y = mx + 1 b

Prob 5.

  • When in Doubt PLOT (use SubPlot)

0 50 100 150 200 250 300

-5.

-5.

-5.

-4.

-4.

t

1st Ord => ln(C)

0 50 100 150 200 250 300

100

150

200

250

300

t

2nd Ord =>1/C

 Some

CURVATURE

 Straight

  • Better Model
  • t X
  • 1/C Y

Linear Xform of 2

nd

Order Reaction

  • Now that the plot has

identified the Rcn as 2

nd

Order, Make Linear

Xform

  • The 2

nd

Order Eqn

( ) ( ) 0

C

kt

C t

Y = mX + B

 Use polyfit of

order-1 to generate

fitting parameters

contained in vector

k_1overC

 That is: k_1overC

= [m, B

]; or

  • k_1overC0(1)

= m = k

  • k_1overC0(2)

= B 2 = 1/C(0)

P 5.47 Answer

  • k_1overC0 = [m B

] = [k 1/C0] = [5.4445e-

001 9.9605e+001]

  • k = 5.4445e-
    • k = 0.
  • C0 =

1/9.9605e+

  • 1.0040e- 002
    • C(0) = 0.

0 50 100 150 200 250 300

80

100

120

140

160

180

200

220

240

260

280

t

2nd Ord =>1/C

1/C = 0.5445*t + 99.

data Line PolyFit data Pts

P5.57 Geometry

x

y

r2r
r1 dy
dx
dx
Point at (x,y)
x-0.
x-(-0.3) = x+0.

 = +

2

2

1

1

0

4

1

r

q

r

q V

πε

 E-Field Governing

Equation

The MeshGrid Plot

% Bruce Mayer, PE * 04Nov % ENGR % file = Prob5_57_Point_Charges_meshgrid_Plot_0611.m % Surface Plot eField from two Point Charges % % CLEAR out any previous runs clear % The Constant Parameters q1 = 2e-10; q2 = 4e-10; % in Coulombs epsilon = 8.854e-12; % in Farad/m % % Note the distances, r1 & r2, to any point(x,y) in the field by pythagorus % * r1 = sqrt((x-0.3)^2 + y^2) % * r2 = sqrt((x+0.3)^2 + y^2) % % Construct a 25x25 mesh [X Y] = meshgrid(-0.25:0.010:0.25); % % find r1 & r2 by pythagorus and array-ops r1 = sqrt((X-0.3).^2 +Y.^2); % note dots used with array operation r2 = sqrt((X-(-0.3)).^2 +Y.^2); % note dots used with array operation % use vectors r1 & r2, and array ops to find V V = (1/(4piepsilon))(q1./r1 + q2./r2); % % use %-Comment to toggle between SURF & MESHC plots % surf(X,Y,V), xlabel('X-distance'), ylabel('Y-distance'),... zlabel('Elect. Potential (V)'), title('2 Point-Charges Electical Field'),... grid on meshc(X,Y,V), , xlabel('X-distance'), ylabel('Y-distance'),... zlabel('Elect. Potential (V)'), title('2 Point-Charges Electical Field'),... grid on*

Meshc Plot MeshGrid

-0.

-0.

0

-0.

-0.

0

0

20

40

60

80

X-distance

2 Point-Charges Electical Field

Y-distance

Elect. Potential (V)

The Loop Plot

% Bruce Mayer, PE * 04Nov06 * ENGR % file = Prob5_57_Point_Charges_Loop_Plot_0611.m % Surface Plot eField from two Point Charges Clear % CLEAR out any previous runs % The Constant Parameters q1 = 2e-10; q2 = 4e-10; % in Coulombs epsilon = 8.854e-12; % in Farad/m % Note the distances, r1 & r2, to any point(x,y) in the field by pythagorus % * r1 = sqrt((x-0.3)^2 + y^2) % * r2 = sqrt((x+0.3)^2 + y^2) % Build up From Square XY Plane %% r1 goes to q1 at (0.3,0) %% r2 goes to q2 at (-0.3,0) x = linspace(-.25, .25, 50); %50 pts over x-range y = linspace(-.25, .25, 50); %50 pts over y-range for k = 1:length(x) for m = 1:length(y) % calc r1 & r2 using pythagorus r1 = sqrt((x(k)-0.3)^2 + y(m)^2); r2 = sqrt((x(k)-(-0.3))^2 + y(m)^2); % Find V based on r1 and r V(k,m) = (1/(4piepsilon))(q1/r1 +q2/r2); % Note that V is a 2D array using the x & y indices end end X = x; Y = y; % use %-Comment to toggle between SURF & MESHC plots surf(X,Y,V), xlabel('X-distance'), ylabel('Y-distance'),... zlabel('Elect. Potential (V)'), title('2 Point-Charges Electical Field'),... grid on %meshc(X,Y,V), , xlabel('X-distance'), ylabel('Y-distance'),... zlabel('Elect. Potential (V)'), title('2 Point-Charges Electical Field'),... grid on*

meshc Plot by Loop

-0.

-0.

0

-0.

-0.

0

10

20

30

40

50

60

70

80

X-distance

2 Point-Charges Electical Field

Y-distance

Elect. Potential (V)

Note that plot

is TURNED