Homework 1
1. Write a Matlab function (NOT a script) with two input arguments
o a string, which is the name of a JPEG file containing an image to be
approximated
o an integer, which is the "approximate rank" to be used
and two output arguments
o a string,
33
-74
-58
27
83
1
A.From the posted list of random numbers, calculate the sum of the absolute values of
B.Use the MIN and MAX functions to return the minimum and maximum values in the l
C.Display pi to 10 places past the decimal using the PI function
D.n
Name_Section_
Experiment 3
Empirical Formula of an Oxide
CM1014 Fall 2016
1
The Empirical Formula of an Oxide
Copyright 1996 by David Schmidling
In your text (Chang and Goldsby 7th Ed) :
3.6 Experimental Determination of Empirical Formulas,
3.9 Limiting R
Mass data
Gross
31.747
31.752
31.761
31.742
31.756
Vol data
Tare
29.245
29.245
29.245
29.245
29.245
Net
2.502
2.507
2.516
2.497
2.511
By Name
2.502
2.507
2.516
2.497
2.511
By Array
2.502
2.507
2.516
2.497
2.511
Gross
Tare
Net
By Name
By Array
31.747
29.24
Mass data
Gross
31.747
31.752
31.761
31.742
31.756
Vol data
Tare
29.245
29.245
29.245
29.245
29.245
Net
2.502
2.507
2.516
2.497
2.511
By Name
2.502
2.507
2.516
2.497
2.511
By Array
2.502
2.507
2.516
2.497
2.511
Gross
Tare
Net
By Name
By Array
31.747
29.24
Mass data
gross
31.747
31.752
31.761
31.742
31.756
Vol data
tare
29.245
29.245
29.245
29.245
29.245
net
2.502
2.507
2.516
2.497
2.511
by name
2.502
2.507
2.516
2.497
2.511
by array
2.502
2.507
2.516
2.497
2.511
gross
tare
net
by name
by array
31.747
29.24
SAMPLE GAUSS PROGRAM
% gauss_el.m
Gauss elimination without pivoting
function [Amod,bmod]=gauss_el(A,b,display)
% On entry: A is a square matrix
%
b is a column vector of the same dimension
%
display is 1 if step-by-step display desired, 0 otherwise
% On
function [R, k] = cholDirect(A)
% return Cholesky factor R of a positive definite matrix A
% hopefully easier to understand than version in book
% defined by directly looking at the elements of the matrix
% equation R'*R = A, where R is upper triangular,
Homework 2
1. Write a Matlab function legendpoly to compute the first n Legendre
polynomials evaluated on p equally spaced points on the interval [-1,1],
following the model on p.64 of the text, normalized as at the bottom of p.64
(see also p.53). Include
Homework 3
1. Write a Matlab function house which implements Householder reduction of an
m by n matrix A, returning two matrices V and R, where V stores the vectors
implicitly representing Q (Alg 10.1 in the text). Write another Matlab
function getQ , whi
Homework 4
Verify equation writing lambda instead of x, by differentiating the equation
P(lambda,a) = 0, where a is the vector of given polynomial coefficients.
Which is the most sensitive root of the Wilkinson polynomial p(lambda), and to
which coeffic
The functions log1p and expm1 are defined by log1p(x)=log(1+x) and
expm1(x)=exp(x)-1.
(a) What are the condition numbers of these functions (as a function of x)? For
any x where the formula using the derivative is not defined, use the limit if it
exists.
Homework 6
As we saw in class, MATLAB has a convenient sparse matrix data structure (type
"help sparse") that allows the built-in matrix factorizations LU, QR and Cholesky to
be computed efficiently when the data matrix is sparse. A particularly common ty
Homework 7
Write a MATLAB function to compute the Cholesky factorization of a symmetric
positive definite band matrix A. Instead of working with Algorithm 23.1 in the text
(which is a little hard to understand), you can modify my code cholDirect.m,
presen
Homework 8
Modify my code inv_power.m (BELOW) to implement the Rayleigh quotient iteration
(see Lecture 27). This requires defining the shift mu inside the loop, instead of outside
it, and also solving the system of equations inside the loop, since now th
Homework 9
1. Matlab programming assignment to compute the eigenvalues of a real
symmetric matrix). Collect everything except the plotting commands inside a
single function, say qreig (the "driver" of (c) that calls tridiag once
and qralg m-1 times. This
C, MEX, BLAS, LAPACK, Fortran and Java
Calling C from MATLAB using the MEX interface
C is presently the lingua franca of computing. If you are a C programmer, you should
learn how to call the BLAS from C and how to call C routines from MATLAB using
MEX.
acid
base
Arrhenius
H+ donor
(or H3O+ donor)
OH- donor
Brnsted
proton donor
proton acceptor
Lewis
accepts an electron pair
donates an electron pair
acid
H O H
H
H
N H
H+ +
H+ + OH
acid base
H
base
+
H N H
H
Lewis Acids and Bases
H
+
F B
N H
F
F
H
acid
bas