Write a Maple Gaussian elimination routine to solve a system

Write a Maple Gaussian elimination routine to solve a system Ax = b.

Solution

# Using Maple linalg package to solve # a linear system: with(linalg): A := matrix([[ 3, -13, 9, 3, -19], [-6, 4, 1, -18, -34], [ 6, -2, 2, 4, 16], [12, -8, 6, 10, 26]]); L := gausselim(A); x := backsub(L); # Using Maple LinearAlgebra to solve # the same system as equations with(LinearAlgebra): Eqns := [ 3*x1 -13*x2 + 9*x3 + 3*x4 = -19, [-6*x1 + 4*x2 + x3 -18*x4 = -34, [ 6*x1 - 2*x2 + 2*x3 + 4*x4 = 16, [12*x1 - 8*x2 + 6*x3 +10*x4 = 26]; Vars := [x1, x2, x3, x4]; Ab := GenerateMatrix(Eqns, Vars, augmented=true); LinearSolve(Ab, method=solve);
Write a Maple Gaussian elimination routine to solve a system Ax = b.Solution # Using Maple linalg package to solve # a linear system: with(linalg): A := matrix(

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site