Professional Documents
Culture Documents
Guass Elimination in Wxmaxima
Guass Elimination in Wxmaxima
(
matS:matrix_size(mat)[1],
tempMat1:copy(mat),
tempMat2:ident(matS),
for i:1 thru matS do
{
divisor: tempMat1[i,i],
for j:1 thru matS do
{
tempMat1[i,j]:ratsimp(tempMat1[i,j]/divisor),
tempMat2[i,j]:ratsimp(tempMat2[i,j]/divisor)
},
for j:1 thru matS do
{
if i#j then
{
multiplier:tempMat1[j,i],
for k:1 thru matS do
{
tempMat1[j,k]:ratsimp(tempMat1[j,k]-
tempMat1[i,k]*multiplier),
tempMat2[j,k]:ratsimp(tempMat2[j,k]-
tempMat2[i,k]*multiplier)
}
}
}
},
tempMat2
)$