algebra help
Jun. 23rd, 2005 01:37 pm![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Okay, so I have this equation:
(1/deltaT - (sigma2/(4*(deltaV^2)))*D2 - (g/(4*deltaV))*D1*V + (g/(4*deltaV))*D1*Veq) * p_(j+1) = (1/deltaT + (sigma2/(4*(deltaV^2)))*D2 + (g/(4*deltaV))*D1*V - (g/(4*deltaV))*D1*Veq) * p_j [Equation 1]
I know that's really hard to read, sorry. V, D1, and D2 are matrices. D1 and D2 are tridiagonal, and V is diagonal. Veq is a scalar, so are deltaT, deltaV, sigma2, and g. The p's are vectors.
If we collect terms into matrices, we can say
(A1 + (g/(4*deltaV))*D1*Veq) * p_(j+1) = (B1 - (g/(4*deltaV))*D1*Veq) * p_j [Equation 2]
and
p_(j+1) = inv(A1 + (g/(4*deltaV))*D1*Veq) * (B1 - (g/(4*deltaV))*D1*Veq) * p_j [Equation 3]
Now, if I multiply both sides of [Equation 1] by ((4*deltaV)/g)*inv(D1), nothing should change, right? If I do this, I get:
(((4*deltaV)/(g*deltaT))*inv(D1) - (sigma2/(g*deltaV))*inv(D1)*D2 - I*V + I*Veq) * p_(j+1) = (((4*deltaV)/(g*deltaT))*inv(D1) + (sigma2/(g*deltaV))*inv(D1)*D2 + I*V - I*Veq) * p_j [Equation 4]
Now let's let A2 and B2 be matrices st the equation becomes:
(A2 + I*Veq)*p_(j+1) = (B2 - I*Veq)*p_j [Equation 5]
then I can say
p_(j+1) = inv(A2 + I*Veq) * (B2 - I*Veq) * p_j [Equation 6]
right?
Now, the question: is there ANY reason that Equations 3 and 6 should NOT give me the same value of p_(j+1)? If I am getting different answers from these two equations in Matlab, is it because I made a typo somewhere, or is it actually a problem with my math?
If that's not clear enough, I can try to LaTeX it and convert it to an image to post instead. Thanks!!