POV-Ray : Newsgroups : povray.advanced-users : Solution of Ax=b : Solution of Ax=b Server Time
29 Jul 2024 06:13:40 EDT (-0400)
  Solution of Ax=b  
From: Reusser
Date: 10 Nov 2002 00:09:47
Message: <091120022309334327%reu1000@chorus.net>
Please don't respond with x=b/A. :)  I've been looking at and thinking
about the "Visual Simulation of Smoke" paper (you can search for it on
google) for quite some time, and I have it coded except for one part.  
If no one can suggest an answer, than can anyone recommend me to a site
or newsgroup where I could find the answer?

THIS NEXT PART IS IRRELEVANT UNLESS YOU CARE ABOUT WHY I'M TRYING TO DO
THIS.

  You can skip past this part
/


| notation.)  u* is the velocity and p is pressure.  
| Then, as it appears on the paper, I'm having trouble
| with solving for the pressure gradient:
| 

|
| For simplification, the 1-d discretized version looks like:
| 

| 

|
V

Assuming you've understood any of this so far, you know that it has to
be set up in matrix form: Ax=b.  It's far too complex to do A^-1*A*x =
A^-1*b and it has a sparse, symmetric matrix, so it has to be solved
with Jacobi's algorithm or the conjugate gradient method.  Calling x'
the transpose of x, the cg method is as follows:

x = initial guess for inv(A)*b  - matrix containing zeros?
r = b - A*x   ... residual, to be made small
p = r         ... initial "search direction"
repeat
  v = A*p
  a = ( r'*r ) / ( p'*v )
  x = x + a*p
  new_r = new_r - a*v
  g = ( new_r'*new_r ) / ( r'*r )
  p = new_r + g*p
  r = new_r
until ( new_r'*new_r small enough )

Unless I'm wrong, x, b, r, p, new_r, and v are n x 1 matricies,
containing float values.  A is a n x n matrix, and a and g are float
values.

Here's the problem:  I haven't tried it out yet because I don't think
it will work.  I have plenty of macros for matrix operations on arrays,
and based on what I would put into it, I would only get a matrix, x, of
float values.  That wouldn't be equal to the pressure gradient.  Does
anyone have the faintest idea what I'm doing wrong?

Thanks in advance...

 - Ricky


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.