Calculation of Jacobian for ode15s in hyperbolic/parabolic-Solver?
조회 수: 6 (최근 30일)
이전 댓글 표시
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?
댓글 수: 0
채택된 답변
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
추가 답변 (1개)
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
참고 항목
카테고리
Help Center 및 File Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!