CHE 541
Homework 2 Solution
Problem 1
Single and double precision mantissas have 23 and 52 bits, respectively. Ignoring exponents, compute the decimal machine precision
as the dierence between 1.0 and the number closest to 1.0.
That is, 1.0 - 0.F, where F
CHE 541Homework 8 Solution
Problem 1
1
In class we found the criteria d = t/x2 2 for the FTCS solution of the the 1-D heat equation:
ft = fxx . Find the condition for the 2D (ft = fxx + fyy ), and 3D versions. Assume x = y = z .
Is this encouraging, or di
% sample problem for KMC
clear all
% A->B
% s: 1-A, 2-B
% r: 1- A->B, k1=1
% Mw of A = B 100;
s(1,1)=1000;
s(2,1)=0;
mw=[100;100];
k(1)=1;
%VNA= number /molecular weight
VNA = sum (s(:,1)./mw);
r=rate_expression(s,k,VNA);
time_point=1;
time(time_point)=0;
CHE 541Homework 3
Problem -1 (not required/graded)
I encourage you to read and understand the attached Matlab script lufact2 that adds scaling and pivoting to
the LU decomposition function.
Problem 1
Part A
Write functions to solve Ax = b by the Jacobi, G
CHE 541Homework 7 Solution
Problem 1
The temperature prole of a nonpremixed ame can be approximated by
2T
T
+ S ( ).
=
t
2 2
Here, S is a reactive source term. The left boundary corresponds to pure air, and the right boundary corresponds to pure fuel. Th
CHE 541Homework 6Solution
Problem 1
Nuclear reactors generate heat by ssion in tubes. The following second order ODE describes the temperature
distribution in a cylinder with internal heat generation:
1 dT
d2 T
+
+ (1 + r2 ) = 0,
dr2
r dr
dT
=0
at r=0,
dr
CHE 541 WinterHomework 5
Problem 1
Solve the following ODE using the explicit Euler, implicit Euler, and modied midpoint methods. Use a
stepsize of dt=0.2, 0.4, 0.8, and 1.6. Compare the results graphically with the exact solution. Make four
plots (one fo
CHE 541Homework 4
Problem 1
Solve chp 3 problem 53 of Homan (p. 184) using the multi-dimensional Newtons method with the starting
guess x = 1, y = 2. Report the number of iterations required to reduce the relative RMS error in your roots
to below a value
CHE 541Homework 3
Problem -1 (not required/graded)
I encourage you to read and understand the attached Matlab script lufact2 that adds scaling and pivoting to
the LU decomposition function.
Problem 1
Part A
Write functions to solve Ax = b by the Jacobi, G
CHE 541
Homework 1Basic Programming
Problem 1
Write a Matlab program to compute the solutions to the quadratic equation. The program should
prompt the user for the coecients a b c of ax2 + bx + c = 0. The quadratic solution should be
performed in a single
CHE 541 Winter 2011Homework 9 SolutionDue 4/4/11
Problem 1
The 1-D convection equation is written as:
u
u
+c
= 0.
t
x
(1)
Here, c is the wave speed. You will solve this PDE on the domain from x = 0 to x = 13 with periodic
boundary conditions. Solve the pr