Matrix equation: Ax=b; can A coefficients be negative? Or could this be error?

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 3K views
bzz77
Messages
33
Reaction score
0
Hello all:

I'm using a code for solving partial differential equations that describe transient advection and diffusion.

I'm more of a chemistry person, so I'm a bit lost on some of the basics of the calculation method.

A general question:

As my calculation progresses, I see that some of the A coefficient values (in the equation Ax = b) go negative. This seems weird because all of the values used in the problem represent measurements that I carried out in my lab (positive).

So I'm trying to figure out whether there is some mathematical reason (like error? Something else I haven't thought of?) why these negative values may be arising or whether there is a bug in the code. I'm not sure if I have provided enough information for anyone to speculate, but I'd be interested in hearing any suggestions. Thanks a lot!
 
Physics news on Phys.org
Assuming you are using some sort of finite difference solution, the coefficients representing a second derivative will form a pattern that looks like -1, 2, -1.

So negative coefficients in the matrix are prefectly normal, and they won't cause any numerical problems.