Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.



matrices of coefficients to equations to matrix form
Posted:
May 21, 2012 11:47 AM


Hi everyone, I am writing a cfd code, and I have created a matrix for each coefficient (aP, aE, aW, aS, aN) of the governing equation (aPuP = aEuE + aWuW + aSuS + aNuN + b), where each entry in the coefficient matrices represents a cell to be solved i.e one equation per cell... as well as column vector for the known values[b] and the force vector [U]. I now have to compile the equations, and then take these equations and put them into matrix form [A][x]=[b]
I have spent a great deal of time on it and gone nowhere... would the solution work best by creating a symbolic matrix (not sure how to do that) for u, noting that P means the velocity in question (i,j), E is the velocity to the east etc... so uP=(i,j), uE=(i,j1), uW=(i,j+1), uN=(i+1,j) and uS=(i1,j), then using aP.*uP  aE.*uE  aW.*uW  aS.*uS  aN.*uN = b , will give me a matrix of equations, and then try and get these into the format of [A][x]=[b]... it is important that i have [A] with no zero terms along the diagonal and the matrix be square, so that i can solve using the gaussseidel method, NOT the built in linsolve or A\b in Matlab...
I'd really appreciate any advice.



