Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Consider the system of equations: {x_1 + (2.3)x_2 - x_3 + 5x_4 =1 4x_1 + 5x_2 +

ID: 3572184 • Letter: C

Question

Consider the system of equations: {x_1 + (2.3)x_2 - x_3 + 5x_4 =1 4x_1 + 5x_2 + 6x_3 - (2.2)x_4 = 2 (3.1)x_1 + (2.2)x_2 + x_3 + 2x_4 = 3 x_1 + x_2 + x_3 + x_4 = 4. Solve it using the Matlab symbolic function solve. Consider the equation: x^5 - 2 * x^3 - x^2 + 0.25 = 0 Solve it using the solve function. Use also zero to solve it numerically with three different initial guesses: 2, 0. and 2 (recall from PA11 that you need to: 1) define a function related to the above equation, 2) pass the function handle to f zero). Compare with the symbolic solver.

Explanation / Answer

solving using matlab

x = inv(A)*B

inv = inverse function in matlab

a)

>> A=[1 2.3 -1 5;4 5 6 -2.2;3.1 2.2 1 2;1 1 1 1;]

A =

    1.0000    2.3000   -1.0000    5.0000
    4.0000    5.0000    6.0000   -2.2000
    3.1000    2.2000    1.0000    2.0000
    1.0000    1.0000    1.0000    1.0000

>> B = [1;2;3;4;]

B =

     1
     2
     3
     4

>> x = inv(A)*B

x =

    0.5980
   -4.4459
    4.7686
    3.0793

>>