Warning:Unable to meet integration tolerance
2 views (last 30 days)
Show older comments
Hello,
I have a set of coupled differential equations to be solved. The code for the equations is written below.
Wedes=[18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18.3684210526316,18.7368421052632,19.1052631578947,19.4736842105263,19.8421052631579,20.2105263157895,20.5789473684211,20.9473684210526,21.3157894736842,21.6842105263158,22.0526315789474,22.4210526315790,22.7894736842105,23.1578947368421,23.5263157894737,23.8947368421053,24.2631578947368,24.6315789473684,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,24.6315789473684,24.2631578947368,23.8947368421053,23.5263157894737,23.1578947368421,22.7894736842105,22.4210526315790,22.0526315789474,21.6842105263158,21.3157894736842,20.9473684210526,20.5789473684211,20.2105263157895,19.8421052631579,19.4736842105263,19.1052631578947,18.7368421052632,18.3684210526316,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18];
c1=1;
c2=2;
c3=3;
c4=4;
c5=5;
ThA=65;
Bmin=0.82;
n=1;
if(ThA<79.46)
TC=1-cos(1.14459*ThA-1.0600);
else
TC=1;
end
h=280;
Fr=54.43;
Je=0.1454;
DiffEqn=@(t,z)[c1*TC-c2*z(2)*z(1);([(diff(Wedes)/0.01),0]')-((1-Bmin)*abs(((c3*z(1)-c4*z(2)-h*Fr-c5*(z(2).^2))/Je)-([(diff(Wedes)/0.01),0]'))+abs(0.377+0.0011*z(2)+0.000027*z(2).^2)+1)/Bmin];
tsc=linspace(0,30,100);
[T,Z]=ode15s(DiffEqn,tsc,[0;zeros(size(Wedes'))]);
Ma=Z(:,1);
We=Z(:,2);
('Wedes' is 1X100 external input signal.)
But I get the following warning.
Warning: Failure at t=3.770650e-03. Unable to meet integration tolerances without reducing the step size below the
smallest value allowed (6.938894e-18) at time t.
I tried using non-stiff solvers like ode15s, ode23s and ode23tb, but the warning still shows. I also cant see any singularity in the equation, since the denominators are constants. Could anybody shed some light on the possible cause of this problem? It would be greatly appreciated.
Thanks in advance.
0 Comments
Answers (1)
Walter Roberson
on 3 Jul 2017
The equations being integrated need to be continuous to at least two more derivatives than you use in the ode. That does not appear to hold true in your equation, as you use abs() in a couple of places. abs() does not generally have a continuous derivative. For example abs(x) has a derivative of -1 to the left of 0 and +1 to the right.
See Also
Categories
Find more on Ordinary Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!