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

hyperbolicjacobian ode15snonlinear femnonlinear transient pdeparabolicPartial Differential Equation Toolboxtangential stiffness matrix

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?

Best Answer

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