POV-Ray : Newsgroups : povray.advanced-users : Solution of Ax=b Server Time
1 Nov 2024 05:23:59 EDT (-0400)
  Solution of Ax=b (Message 1 to 2 of 2)  
From: Reusser
Subject: Solution of Ax=b
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

From: Reusser
Subject: Re: Solution of Ax=b
Date: 10 Nov 2002 13:25:20
Message: <101120021224558494%reu1000@chorus.net>
In article <091120022309334327%reu### [at] chorusnet>, Reusser
<reu### [at] chorusnet> wrote:

> 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?

NEVERMIND!  I found the answer, I forgot I have to take the gradient
once I find the pressure.  Stupid question, wasted time, etc...

-Ricky


Post a reply to this message

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