Mathcad programming question
Originally Posted by PrimoGen,Feb 11 2008, 02:57 PM
you have your i's and j's transposed:
i := 1
j := 1
while (i ≤ m and j ≤ n) do
Find pivot in column j, starting in row i:
maxi := i
for k := i+1 to m do
if abs(A[k,j]) > abs(A[maxi,j]) then
maxi := k
end if
end for
if A[maxi,j] ≠ 0 then
swap rows i and maxi, but do not change the value of i
Now A[i,j] will contain the old value of A[maxi,j].
divide each entry in row i by A[i,j]
Now A[i,j] will have the value 1.
for u := i+1 to m do
subtract A[u,j] * row i from row u
Now A[u,j] will be 0, since A[u,j] - A[i,j] * A[u,j] = A[u,j] - 1 * A[u,j] = 0.
end for
i := i + 1
end if
j := j + 1
end while
with out the value of u, you cannot even start the matrix root search
jeez you noob.....
JK I dont even have the slightest clue of what I even pasted in. just some garbage from wikipeedonyou.
i := 1
j := 1
while (i ≤ m and j ≤ n) do
Find pivot in column j, starting in row i:
maxi := i
for k := i+1 to m do
if abs(A[k,j]) > abs(A[maxi,j]) then
maxi := k
end if
end for
if A[maxi,j] ≠ 0 then
swap rows i and maxi, but do not change the value of i
Now A[i,j] will contain the old value of A[maxi,j].
divide each entry in row i by A[i,j]
Now A[i,j] will have the value 1.
for u := i+1 to m do
subtract A[u,j] * row i from row u
Now A[u,j] will be 0, since A[u,j] - A[i,j] * A[u,j] = A[u,j] - 1 * A[u,j] = 0.
end for
i := i + 1
end if
j := j + 1
end while
with out the value of u, you cannot even start the matrix root search
jeez you noob.....
JK I dont even have the slightest clue of what I even pasted in. just some garbage from wikipeedonyou.
and hitting enter only exits the currently selected section of code.
GAUSS(A,b) n ← rows(b) the given problem
s
−Ai,k
Ak,k
←
Ai, j← Ai, j + s⋅Ak,j
for j∈1..n
bi ← bi + s⋅bk
for i∈k+1.. n
for k∈1..n−1
xn
bn
An,n
←
sumi ← 0
sumi ← sumi + Ai, j⋅xj
for j∈n..i+1
xi
bi − sumi
Ai,i
←
for i∈n−1.. 1
x
wow, copy paste from mathcad doesnt translate into html very well...oh well.








