solve large sparse jacobian matrix (with an example)
3 次查看(过去 30 天)
显示 更早的评论
Hello Community,
do you have a good suggestion if an iterative solver would be faster.
This jacobian J with ( N = 32 ) took me around 1s of solving this equation x=J\y. The matrix is saved as sparse, and the density is around 3%.
( For N=64 the density ia about 1,6% and solving that matrix cost me about 50s. So the scaling is really bad)
The Dimensions of this matrix J are scaling with (3*(N+1)^2+(N-1)^2,3*(N+1)^2+(N-1)^2).
my desired N will be in the order of 128- 192.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/481713/image.png)
1 个评论
J. Alex Lee
2021-1-8
maybe you can invoke more specific solvers to specify properties of the matrix, though i'm not too knowledgeable in the area.
another comment which may or may not be relevant is that i wonder if your matrix can be permuted a priori into a structure that's more amenable to solvers (again not terrible knowledgeable in the area...)
采纳的回答
Doddy Kastanya
2021-1-12
I assume that the Jacobian matrix is needed as a part of implementing Newton's method to solve system of non-linear equations. For the problem with N=192, the Jacobian matrix size is close to 150k by 150k - So, it might not be advisable to simply use "\" to get the answer - knowing that the matrix is highly sparse. It might be more advantageous to use preconditioned Krylov methods to solve the system of equations. You will have an opportunity to develop an appropriate preconditioner to solve the system of equation faster (by taking advantage of the sparse matrix structure). Another thing that you might want to consider is to implement "Jacobian Free Newton Krylov" method where you don't even have to build the Jacobian matrix (which could be costly as well). I hope this helps. Good luck.
0 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!