Reference no: EM131013088
Function [x] = gaussel(A,b)
% [x] = gaussel(A,b)
%
% This subroutine will perform Gaussian elimination
% and back substitution to solve the system Ax = b.
% INPUT : A - matrix for the left hand side.
% b - vector for the right hand side
%
% OUTPUT : x - the solution vector.
N = max(size(A));
% Perform Gaussian Elimination
for j=2:N,
fori=j:N,
m = A(i,j-1)/A(j-1,j-1);
A(i,:) = A(i,:) - A(j-1,:)*m;
b(i) = b(i) - m*b(j-1);
end
end
% Perform back substitution
x = zeros(N,1);
x(N) = b(N)/A(N,N);
for j=N-1:-1:1,
x(j) = (b(j)-A(j,j+1:N)*x(j+1:N))/A(j,j);
end
% End of function
a) The above programme solves a linear system of equations using naïve Gaussian elimination.
Modify this programme so that it outputs upper and lower triangular matrices of LU factorisation. The header line of the modified function should read [x, L, U] = gaussel(A, b)
Use this function, to solve the system Ax = b, where
b) Use the LU factorisation of A obtained above to solve the system Ax = c, where
You can use the ‘backslash' Matlab operator for solving the systems of equations with L and U.
Determine the stretched length of cd
: A 125lb bowling ball is suspended from point C with rope CE. A second rope (ABC) is tied to point C and wraps around pulley B toward point A. Spring CD is used to hold the position shown. Determine the stretched length of CD if the spring coeffici..
|
What is the velocity in the pipeline
: An 18-inch storm drain (n=0.013 | s=0.025) is designed to discharge 9.75 CFS. The design guidelines state that the velocity can not exceed 10 ft/s in the pipeline. What is the velocity in the pipeline?
|
Find inverse function in given problem
: Suppose that f(x) = 6x + 2 cosx is differentiable and has an inverse and f(π/2) = 3π. Find (f-1)'(3π)
|
Company accounts receivable turnover
: A+ Airplanes normally sells $125,000 of its product on credit each day, and it takes an average of 40 days to collect the credit sales. (a) What is the average accounts receivable that is reported on A+'s balance sheet? (b) What is the company's ..
|
Use backslash matlab operator for solving the systems
: The programme solves a linear system of equations using naïve Gaussian elimination. Modify this programme so that it outputs upper and lower triangular matrices of LU factorisation.
|
Partial derivatives at maturity
: Derive a relation between partialCt(St, K)/partialK and partialPt(St, K)/partialK for t = 0 and t = T. (b) Find the values of these partial derivatives at maturity t = T.
|
Calculate magnitude and direction of the horizontal force
: A 90 degree bend occurs in a 0.3 m horizontal pipe in which the pressure is 276 kPa. Calculate the magnitude and direction of the horizontal force on the bend when 0.28 m^3/s of water flow therein.
|
Inflation and interest rates
: What would you expect the nominal rate of interest to be if the real rate is 3.8 percent and the expected inflation rate is 7.3 percent? The nominal rate of interest would be []%. (Round to Iwo decimal places.)
|
Calculate magnitude and direction of the total force on bend
: A 6-in. horizontal pipe line bends through 90 dgree and while bending changes its diameter to 3 in. The pressure in the 6-in. pipe is 30 psi , and the direction of flow is from larger to smaller. Calculate the magnitude and direction of the total ..
|