Prev: MATCONT
Next: How to choose tspan?
From: Aneesh on 17 Mar 2010 14:01 I have written a code in matlab for my thesis. I need to find out the results for 100x100 and 1000x 1000 panels. In the program i form a 100x100 matrix and i need to inverse it and multiply with a 100x1 matrix. Currently my virtual mermory is 4096 mb. Can you please suggest me how to overcome this problem.
From: Walter Roberson on 17 Mar 2010 14:51 Aneesh wrote: > I have written a code in matlab for my thesis. I need to find out the > results for 100x100 and 1000x 1000 panels. In the program i form a > 100x100 matrix and i need to inverse it and multiply with a 100x1 > matrix. Currently my virtual mermory is 4096 mb. > Can you please suggest me how to overcome this problem. On my system, those sizes are no problem at all. They should not be a problem on your machine either, as a 1000 x 1000 matrix is at most 8 Mb (16 Mb if it is complex numbers.) On the other hand, it has been said many times here that taking the inverse of a matrix and multiplying it by something is almost always the wrong thing to do. If your matrix is M and your vector is V, then instead of taking inv(M) * V use M \ V as that will be more numerically stable.
From: Matt J on 17 Mar 2010 14:52 "Aneesh " <agoly(a)fau.edu> wrote in message <hnr5d2$dt1$1(a)fred.mathworks.com>... > I have written a code in matlab for my thesis. I need to find out the results for 100x100 and 1000x 1000 panels. In the program i form a 100x100 matrix and i need to inverse it and multiply with a 100x1 matrix. Currently my virtual mermory is 4096 mb. > Can you please suggest me how to overcome this problem. ============= No doubt you were about to send us the critical information needed to diagnose the problem, e.g. the code you use to generate your matrices. In the meantime, however, (1) Given that the matrix is only 100x100, it's doubtful that the actual matrix inversion causes the memory error. Probably it's in the code used to create the matrix. (2) You should not be inverting the matrix. You should be doing y=A\b
From: Aneesh on 17 Mar 2010 15:43 For inverse i used M\V. i have set of equations to calculate M. then i do the inverse of that Walter Roberson <roberson(a)hushmail.com> wrote in message <hnr8cc$5rt$1(a)canopus.cc.umanitoba.ca>... > Aneesh wrote: > > I have written a code in matlab for my thesis. I need to find out the > > results for 100x100 and 1000x 1000 panels. In the program i form a > > 100x100 matrix and i need to inverse it and multiply with a 100x1 > > matrix. Currently my virtual mermory is 4096 mb. > > Can you please suggest me how to overcome this problem. > > On my system, those sizes are no problem at all. They should not be a problem > on your machine either, as a 1000 x 1000 matrix is at most 8 Mb (16 Mb if it > is complex numbers.) > > On the other hand, it has been said many times here that taking the inverse of > a matrix and multiplying it by something is almost always the wrong thing to > do. If your matrix is M and your vector is V, then instead of taking > > inv(M) * V > > use > > M \ V > > as that will be more numerically stable.
From: Aneesh on 17 Mar 2010 15:45
Hi Matt, I have used the A\b only for the inverse. Still i get the same error. I am only able to get the results till 80x80. "Matt J " <mattjacREMOVE(a)THISieee.spam> wrote in message <hnr8co$70d$1(a)fred.mathworks.com>... > "Aneesh " <agoly(a)fau.edu> wrote in message <hnr5d2$dt1$1(a)fred.mathworks.com>... > > I have written a code in matlab for my thesis. I need to find out the results for 100x100 and 1000x 1000 panels. In the program i form a 100x100 matrix and i need to inverse it and multiply with a 100x1 matrix. Currently my virtual mermory is 4096 mb. > > Can you please suggest me how to overcome this problem. > ============= > > No doubt you were about to send us the critical information needed to diagnose the problem, e.g. the code you use to generate your matrices. > > In the meantime, however, > > (1) Given that the matrix is only 100x100, it's doubtful that the actual matrix inversion causes the memory error. Probably it's in the code used to create the matrix. > > (2) You should not be inverting the matrix. You should be doing y=A\b |