The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: matrices of coefficients to equations to matrix form
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
Michael Moor

Posts: 2
Registered: 5/21/12
matrices of coefficients to equations to matrix form
Posted: May 21, 2012 11:47 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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,j-1), uW=(i,j+1), uN=(i+1,j) and uS=(i-1,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 gauss-seidel method, NOT the built in linsolve or A\b in Matlab...

I'd really appreciate any advice.

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2017. All Rights Reserved.