Calculation of Jacobian for ode15s in hyperbolic​/parabolic​-Solver?

조회 수: 6 (최근 30일)
Lena
Lena 2014년 2월 22일
댓글: Lena 2014년 2월 26일
I have implemented my own time integration method for a dynamic FEM-Simulation. I proceeded as in the hyperbolic.m, and now have to pass the Jacobian to my ode-solver. My PDE-Coefficient c depends on u. So like in pdehypdf.m, Line 37
if pdehyp.vc
pdehyp.K = K
end
and Line 25
[K,M]=assema(...,uFull,...)
I passed the u -dependent stiffness-matrix K .
My Question is now, if this is really the correct Jacobian?! I wonder whether this is that simple, because actually we have to calculate
d(K(u)u)/du .
But K(u) is only an approximation of this in Nonlinear FEM called "tangential stiffness matrix" d(K(u)u)/du , isn't it?
This is the reason, why an extra nonlinear solver pdenonlin.m exists for the steady nonlinear problem K(u)u=F, but I cannot find an analogon for the transient case?

채택된 답변

Bill Greene
Bill Greene 2014년 2월 22일
Hi Lena,
Yes, you are correct that the Jacobian calculated in parabolic/hyperbolic is only approximate. However, in my experience, ode15s performs very robustly with this approximate Jacobian. In general, ode15s prefers to cut the step size rather than request a new Jacobian. If the problem is well-posed, I have not encountered a case where ode15s was not able to complete a solution in hyperbolic and parabolic. And, of course, the Jacobian is simply used as a predictor-- it doesn't affect the actual solution.
Yes, pdenonlin does have some additional methods for calculating approximate Jacobians but they are all slower than the approach used in parabolic and hyperbolic.
In fact, there is some commented out code in parabolic that you can experiment with if you like. If you change the line
doJacFinitDiff=false;
to
doJacFinitDiff=true;
ode15s will use the numjac routine to calculate an approximate Jacobian numerically. In my experiments, this is much slower than the currently-implemented approach in parabolic. The solutions are the same, of course. One of the main strengths of ode15s is that it will terminate if it can't calculate a solution to the user-requested accuracy at any time step.
Bill
  댓글 수: 2
Lena
Lena 2014년 2월 22일
Thank you again for your competent and fast help, Bill!!!
Lena
Lena 2014년 2월 22일
편집: Lena 2014년 2월 22일
Hi Bill,
I have one question remaining: What do you mean by "Jacobian is simply used as a predictor"?
Does ode15s calculate a new Jacobian, although pdehypdf.m has been passed as the 'Jacobian' in odeset in hyperbolic.m ? Thank you very much!

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

추가 답변 (1개)

Bill Greene
Bill Greene 2014년 2월 26일
If the Jacobian is a function of the dependent variables (or time), ode15s will typically call pdehypdf many times during a complete analysis. The number of times ode15s calculates and factors a new Jacobian is, by default, printed to the MATLAB command window when ode15s completes.
Bill
  댓글 수: 1
Lena
Lena 2014년 2월 26일
But ode15s doesn't try to improve the (approximated) Jacobian itself, does it? If I get the Stats for ode15s / hyperbolic , e.g.
152 successful steps
31 failed attempts
251 function evaluations
1 partial derivatives
67 LU decompositions
250 solutions of linear Systems
the numbers 251 (or 250) give me the number of calls of pdehypdf and the number of calculations of a new Jacobian, is that correct? Thank you!

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

카테고리

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