Question

In: Advanced Math

Example #2: Write the following set of four linear equations with 4 unknowns x1, x2, x3,...

Example #2: Write the following set of four linear equations with 4 unknowns x1, x2, x3, and x4 in the matrix form. Solve the equations using MATLAB.

0.1 x1+ 2.3 x2 + 3x3 + 4x4 =1

x1+ 3x2 -7x3 +5x4 =2

3x1+2x2+7x3 =3

x1 +2x2 +x3 +10x4=0

(b)Roots of Polynomials:

In order to obtain the roots of a polynomial with the coefficients a1,a2,a3 ,... (where a1 is the coefficient of the highest power, and so on in a descending order) using MATLAB, organize the coefficients of the equation using the following format: p=[a1, a2, a3, a4]

Then the roots (all the roots - real and complex) can be obtain by the following command: r=roots(p)

Solutions

Expert Solution

%Matlab code for solving
clear all
close all

%finding coefficients for Matrix
A=[0.1 2.3 3 4; 1 3 -7 5; 3 2 7 0;1 2 1 10];
fprintf('Coefficient Matrix is\n')
disp(A)
%b vector is
b=[1;2;3;0];
fprintf('b vector is \n')
disp(b)

%Hence unknowns are
x=A\b;
fprintf('The unknowns are x1=%f, x2=%f, x3=%f, x4=%f\n',x(1),x(2),x(3),x(4))

%roots of polynomial
a=[4 3 2 1];
fprintf('\nHere a1=%f; a2=%f; a3=%f; a4=%f\n',a(1),a(2),a(3),a(4))
fprintf('\n\tRoots for a1x^3+a2x^2+a3*x+a4=\n')
p=roots(a);
disp(p)

%%%%%%%%%%%%%%%% End of Code %%%%%%%%%%%%%%


Related Solutions

Let X1, X2, X3 be independent having N(0,1). Let Y1=(X1-X2)/√2, Y2=(X1+X2-2*X3)/√6, Y3=(X1+X2+X3)/√3. Find the joint pdf...
Let X1, X2, X3 be independent having N(0,1). Let Y1=(X1-X2)/√2, Y2=(X1+X2-2*X3)/√6, Y3=(X1+X2+X3)/√3. Find the joint pdf of Y1, Y2, Y3, and the marginal pdfs.
Does the input requirement set V (y) = {(x1, x2, x3) | x1 + min {x2,...
Does the input requirement set V (y) = {(x1, x2, x3) | x1 + min {x2, x3} ≥ 3y, xi ≥ 0 ∀ i = 1, 2, 3} corresponds to a regular (closed and non-empty) input requirement set? Does the technology satisfies free disposal? Is the technology convex?
4.Maximize: Z = 2X1+ X2-3X3 Subject to: 2X1+ X2= 14 X1+ X2+ X3≥6 X1, X2, X3≥0...
4.Maximize: Z = 2X1+ X2-3X3 Subject to: 2X1+ X2= 14 X1+ X2+ X3≥6 X1, X2, X3≥0 Solve the problem by using the M-technique.
Let X1, X2, X3 be continuous random variables with joint pdf f(X1, X2, X3)= 2 if...
Let X1, X2, X3 be continuous random variables with joint pdf f(X1, X2, X3)= 2 if 1<X1<2 -1<X2<0 -X2-1<X3<0                         0 otherwise Find Cov(X2, X3)
Give an example of a linear system of three equations with three unknowns that has the...
Give an example of a linear system of three equations with three unknowns that has the general solution with one parameter.
Using Matlab 1. Solve the following equations set f1 (x1,x2) = sin (sin (x1)) +x2 f2...
Using Matlab 1. Solve the following equations set f1 (x1,x2) = sin (sin (x1)) +x2 f2 (x1,x2) = x1+ e^(x2) a) Can this equation set be solved by the fixed - point method with the following expressions? And why? Show your analysis with a 2D graph. g1 (x1,x2) = -e^(x2) g2 (x1,x2) = -sin⁡(x1) b) Use Newton Raphson Method with initial values x1 = -2, x2 = 1.5. (8 significant figures. Please submit the code and results.)
Consider the problem   maximize   Z = 5 x1 + 3 x2 + 2 x3 + 4...
Consider the problem   maximize   Z = 5 x1 + 3 x2 + 2 x3 + 4 x4        subject to                       5 x1 + x2 + x3 + 8 x4 = 10                       2 x1 + 4 x2 + 3 x3 + 2 x4 = 10                                     X j > 0, j=1,2,3,4 (a) Make the necessary row reductions to have the tableau ready for iteration 0. On this tableau identify the corresponding initial (artificial) basic feasible solution. Also, identify the initial entering and...
(1) z=ln(x^2+y^2), y=e^x. find ∂z/∂x and dz/dx. (2) f(x1, x2, x3) = x1^2*x2+3sqrt(x3), x1 = sqrt(x3),...
(1) z=ln(x^2+y^2), y=e^x. find ∂z/∂x and dz/dx. (2) f(x1, x2, x3) = x1^2*x2+3sqrt(x3), x1 = sqrt(x3), x2 = lnx3. find ∂f/∂x3, and df/dx3.
Consider the linear system of equations 2x1 − 6x2 − x3 = −38 −3x1 − x2...
Consider the linear system of equations 2x1 − 6x2 − x3 = −38 −3x1 − x2 + 7x3 = −34 −8x1 + x2 − 2x3 = −20 With an initial guess x (0) = [0, 0, 0]T solve the system using Gauss-Seidel method.
Consider the linear system of equations below 3x1 − x2 + x3 = 1 3x1 +...
Consider the linear system of equations below 3x1 − x2 + x3 = 1 3x1 + 6x2 + 2x3 = 0 3x1 + 3x2 + 7x3 = 4 i. Use the Gauss-Jacobi iterative technique with x (0) = 0 to find approximate solution to the system above up to the third step ii. Use the Gauss-Seidel iterative technique with x (0) = 0 to find approximate solution to the third step
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT