Mech 3010 numerical methods and programming - use cramers


PROBLEM #1:

Problem 1: Use Cramer's Rule to solve for x Check answer using backslash operator

Coefficient Matrix

A = (12 4 11 9;
7 3 1 18;
6 24 21 8;
8 13 10 1);
%Right hand side vector

b=(8;
20;
42;
25];

Cramer's Rule

determinant

disp('Solving by Cramers Rule')

D=det(A);
Al-A;

A1(:,1)=b; %replace first column of 'Al' by 'b' x1 = det(A1)/D
A2 A; 'b'
A2(:,2) = b; %
x2 = det(A2)/D replace second column of 'A2' by 'b'
A3 = A;
A3(:,3) = b; %
x3 = det(A3)/D replace first column of 'A3' by 'b'
A4 = A;
A4(:,4) = b; % replace first column of 'A4' by 'b'
x4 = det(A4)/D

Solving by Cramers Rule
x1 = 0.3787
x2 = 2.4795
x3 = -1.0874
x4 0.6110
> >

PROBLEM #2:

a) Use Cholesky decomposition to find upper triangular matrix U

b) Use U to solve for the stresses in the material for 3 different experiments

E = 750; %Modulus of Elasticity--->Gpa

v = 0.4; %Poisson's Ratio

% Coefficient Matrix
A = (1 -v -v;
-v 1 -17:
-v -v 1);
U = a chol(A)

%Coefficient Matrix
A = (1 -v -v;
- v 1 -v;
- v -v 1);
el = 0.001;
e2 = 0.003:
e3 = 0.020;

%Eight hand side vector

b = (el e2 e3)
U = chol(A)
x = (b*E)/U

%coefficient Matrix
A a (1 -v -v;
- v 1 -v;
- v -v 1):
el = 0.004;
e2 = 0.006:
e3 = 0.006;

%Right hand side vector b = (el e2 e3);
U = chol(A);
x = (b*E)/U

%Coefficient Matrix
A = (1 -v -v;
-v 1 -v:
-v -v 11:
e1 = 0.050:
e2 = 0.070:
e3 = 0.010:

%Right hand side vector

b = [e1 e2 e3]:

U = chol(A):|
x = (b*E)/U
3.0000 7.855e 15.3709

> >

Solution Preview :

Prepared by a verified Expert
MATLAB Programming: Mech 3010 numerical methods and programming - use cramers
Reference No:- TGS01632199

Now Priced at $50 (50% Discount)

Recommended (97%)

Rated (4.9/5)