Archives
978-1107135116 Chapter 1 Part 1
Numerical methods with chemical engineering applications Solutions Manual Kevin D. Dorfman and Prodromos Daoutidis Contents List of illustrations page iv List of tables v 1 Introduction 1 2 Linear equations 43 3 Nonlinear equations 115 4 Initial value problems 208 […]
978-1107135116 Chapter 1 Part 2
Introduction 25 15 for l = 1:n 16 A(k,l) = (k+l)/(k*l); 17 end 18 end 29 output 30 31 function out = transp(A,m,n) 32 %A = original matrix with m rows and n columns. create transpose 33 Atrans = zeros(n,m); […]
978-1107135116 Chapter 2 Part 1
Linear equations 65 (2.8) Cofactor expansion for i=3 has the most zero entries, giving det A=(−1)(−1)(3+1) det 2 1 0 1 −3214 −7234 […]
978-1107135116 Chapter 2 Part 2
Linear equations 85 004 x3 1 which gives x1 x2 = […]
978-1107135116 Chapter 3 Part 1
Linear equations 105 5A = [6, 1; 4, -8]; 6b = [13;0]; 7x solve = A\b; 8 19 saveas(h,‘s12c4p2 solution figure1.eps’,‘psc2’) 20 21 %make the zoom figure 22 small = 0.001; 23 axis([x solve(1)-small,x solve(1)+small,x solve(2)-small,… 24 x solve(2)+small]) 25 […]
978-1107135116 Chapter 3 Part 2
Nonlinear equations 139 The initial guess x(0) = 0.2 0.2 converges to x(∗)= 1 0 […]
978-1107135116 Chapter 3 Part 3
Nonlinear equations 159 65 fprintf(‘Temperature difference at inlet is … \t%8.6f\n’,T1-T1p) 66 fprintf(‘Temperature difference at outlet is … \t%8.6f\n\n’,T2-T2p) 74 fprintf(‘*********************************************\n’) 75 end 76 77 78 h = figure; 79 semilogx(wpscan,T2scan,‘-o’,‘MarkerSize’,8) 80 xlabel(‘$w$ (kg/s)’,‘FontSize’,14) 81 ylabel(‘$T 2$ ($ˆ{\circ}$C)’,‘FontSize’,14) 82 title(‘Solution […]
978-1107135116 Chapter 3 Part 4
Nonlinear equations 179 53 xlabel(‘$x$’,‘FontSize’,14) 54 ylabel(‘$y$’,‘FontSize’,14) 55 title(‘Solution to s13c6p3’,‘FontSize’,14) 56 saveas(g,‘s13c6p123 solution figure3.eps‘) 67 J(1,2) = -y; 68 J(2,1) = P; 69 J(2,2) = -(1-y); 70 out = J; The two output files are: 0 0.2 0.4 0.6 […]
978-1107135116 Chapter 4 Part 1
Nonlinear equations 199 325 %this is a vapor 326 P = vdw(V,T,a,b); 327 else 328 %this is on the horizontal part 339 ylabel(‘$P$ (MPa)’,‘FontSize’,14) 340 top = strcat(‘Isotherm for $T = $’,num2str(T),‘K’); 341 title(top,‘FontSize’,14) 342 out = h; 343 344 […]
978-1107135116 Chapter 4 Part 2
Initial value problems 231 For the third equation, let y3=xso we get d = […]
978-1107135116 Chapter 4 Part 3
Initial value problems 251 51 function out = feval(x,y) 20 title(‘Solution to s11c5p1’,‘FontSize’,14) 21 saveas(h,‘s11c5p1 solution figure.eps’,‘psc2’) 22 23 24 function out = implicit Euler(n steps) 25 %do implicit Euler for the desired number of steps 26 y new = […]
978-1107135116 Chapter 5 Part 1
Initial value problems 271 of equations is dt =k5E with A(0) =0.75, B(0) =1 and C(0)=D(0)=E(0)=F(0) =0. The Matlab file for solving this problem with RK4 is: 1function s14c9p3 2clc 3close all 4set(0,‘defaulttextinterpreter’,‘latex’) 5 6%reaction rates 7krate = [2,1,5,3,1]; 8%initial […]
978-1107135116 Chapter 5 Part 2
Dynamical systems 305 2clc 3close all 4set(0,‘defaulttextinterpreter’,‘latex’) 5 16 17 xlabel(‘$x 1$’,‘FontSize’,14) 18 ylabel(‘$x 2$’,‘FontSize’,14) 19 20 saveas(h,‘s12c9p3 solution figure.eps’,‘psc2’) 21 22 23 function makeplot(x,plotformat) 24 h = 0.01; 25 nsteps = 10ˆ4; 26 x1 = zeros(nsteps+1,1); 27 x2 = […]
978-1107135116 Chapter 5 Part 3
Dynamical systems 325 72 function y = RK4(y0, h, Nt) The phase plane plot is: 0 0.2 0.4 0.6 0.8 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 x s Solution to s13c9p123b ss1 ss2 trajectory […]
978-1107135116 Chapter 6 Part 1
Dynamical systems 345 −0.1 −0.08 −0.06 −0.04 −0.02 0 0.02 0.04 0.06 0.08 0.1 −0.1 −0.08 −0.06 −0.04 −0.02 0 0.02 0.04 0.06 0.08 0.1 x v S ol ut ion t o s11c 7p 1 6Boundary value problems 354 […]
978-1107135116 Chapter 6 Part 2
372 Boundary value problems 57 A(1,1) = 1; b(1) = 1; 58 59 %right BC 60 A(n,n) = 1; b(n) = 0; centered finite differences. (b) The files for this problem are contained in the directory s15c10p2 matlab. 61 62 […]
978-1107135116 Chapter 7 Part 1
392 Boundary value problems 37 k2 = k2 + dk; 38 else 39 fprintf(‘Amazingly got r = 1 to numerical … precision.\n’) 50 n = 101; 51 dx = 1/(n-1); 52 x = linspace(0,1,n); 53 A = zeros(2*n); 54 b […]
978-1107135116 Chapter 7 Part 2
Partial differential equations 423 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 P os i ti on , x C on c e nt r at […]
978-1107135116 Chapter 7 Part 3
Partial differential equations 443 ck+n. The new equations for y=0 are We also need to change the lower corners to no-flux boundary conditions. This leads to cn+1+c2−2c1=0 and c2n+cn−1−2cn=0 The no-flux corner boundary condition is discussed in the last recitation. […]
978-1107135116 Chapter 8 Part 1
Partial differential equations 463 and the ratio is Qr 2 TrZ1 1/2 dθ2 ∂˜y!˜y=L The Matlab script for this problem is: 1function s13c12p3 2clc 3close all 4set(0,‘defaulttextinterpreter’,‘latex’) 5 6%set the problem parameters 7k = 10; %ratio of conductivities k1/k2 8L […]
978-1107135116 Chapter 8 Part 2
(8.11) The files for this problem are contained in the folder s12c7p2 matlab. The Matlab script is: 1function s12c7p2 2clc 3close all 4set(0,‘defaulttextinterpreter’,‘latex’) 5 6%make a plot of the function for my own check 7fplot(@feval,[-1,1]); 8xlabel(‘$x$’,‘FontSize’,16), ylabel(‘$f(x)$’,‘FontSize’,16) 9 10 %compute […]