Convergence failure for consistent initial conditions using 'decic' function

3 views (last 30 days)
I have a set of highly non-linear, implicit ODEs and I need to use an implicit solver such as ode15i to integrate the equations. In order to use ode15i, you must acquire consistent initial conditions for the derivatives and dependent variables. MATLAB has a built in function, 'decic', that can calculate the consistent ICs, however, when I execute the function, I get the following error:
"Convergence failure in DECIC."
Now, generally, if your equations are inconsistent, 'decic' will give you a warning asking you to free up some of the variables of Y0. But in my case, I don't think I have inconsistent equations, but I'm not really sure why the convergence failure error is showing up and how to fix it. There isn't a whole lot of documentation online about it. I'm including a self-contained code below with all the necessary values to run it. Since this is a very specific issue, I can't really shorten the code or give a simplified example. Any suggestions/help is appreciated.
function [Y0,YP0] = droplet_momentum_IC(theta,K,G,P,Z0,Y0)
YP0 = [0;0;0;0];
[Y0,YP0] = decic(@momentum,Z0,Y0,[1;1;1;1],YP0,[0;0;0;0]);
function RES = momentum(z,y,yp)
RES = zeros(4,1);
%Entrained Total Velocity
Ve = sin(theta)*(0.5*z*yp(4) + y(4));
%Total Relative Velocity
Urs = sqrt((y(1) - y(4))^2 + (y(2) - Ve*cos(theta))^2 + (y(3))^2);
%Coefficients
PSI = K*Urs/y(1);
PHI = P*Urs/y(1);
%Liquid Axial Velocity
RES(1) = yp(1) - PSI*sign(y(1) - y(4))*(1 + (1/6)*(abs(y(1) - y(4))*G)^(2/3));
%Liquid Radial Velocity
RES(2) = yp(2) - PSI*sign(y(2) - Ve*cos(theta))*(1 + (1/6)*(abs(y(2) - ...
Ve*cos(theta))*G)^(2/3));
%Liquid Tangential Velocity
RES(3) = yp(3) - PSI*sign(y(3))*(1 + (1/6)*(abs(y(3))*G)^(2/3));
%Gaseous Axial Velocity
RES(4) = yp(4) - (1/z/y(4))*((PHI/z)*sign(y(1) - y(4))*(1 + ...
(1/6)*(abs(y(1) - y(4))*G)^(2/3)) + Ve*Ve - y(4)*y(4));
end
end
Where the above function can be called with the following commands:
theta = 0.48;
K = -8.99*10^(-4);
G = 251.6818;
P = 0.1780;
Y0 = [0.7884;0.6145;0.0272;0.0079];
Z0 = 10.4105;
[Y0,YP0] = droplet_momentum_IC(theta,K,G,P,Z0,Y0);
I should note that even if you allow 'decic' to change alter both Y0 and YP0 (essentially giving it free reign to choose arbitrary values that satisfy those equations, you still get the same convergence error).
  1 Comment
Patricia
Patricia on 24 Apr 2014
Hi! I seem to be experiencing the same problem as you and I noticed that you posted this question a while back. Did you ever figure out what the problem was? If so, I would love to hear about it.
Thanks! Patricia

Sign in to comment.

Answers (0)

Categories

Find more on Chemistry in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!