필터 지우기
필터 지우기

How to avoid multiple Jacobian calls

조회 수: 1 (최근 30일)
Edoardo Melloni
Edoardo Melloni 2014년 5월 19일
편집: Sina 2014년 8월 6일
Hi all,
I have a problem: when solving a stiff differential equation system (with analytical jacobian provided by me), I noticed (using the profile viewer) that, over the total 33 hours needed to solve the system, 30 are dedicated to calculate the Jacobian analytical matrix.
Now, the Jacobian matrix is a 11000x11000 matrix and, to be computed it uses a lot of "if" and "for", for this reason it takes so long to be calculated.
The ode23s calls the function 32 times (so every call need approx. 1 hour to compute the Jacobian matrix).
Is it possible to avoid the calculation of the Jacobian matrix at every call? I was wondering if it wasn't possible to calculate it just one time and then exploit other functions or the global variables...
Thanks for your help
  댓글 수: 1
Sina
Sina 2014년 7월 22일
편집: Sina 2014년 8월 6일
For you question you can avoid it one idea is to make Jacobian matrice as global value and if the input is equal to last input avoid solving it and use the previous global value but if input is not the same you must solve it again ....

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by