Hello,
I am trying to integrate a non-linear differential equation. But I am getting an error I have never gotten before. "Warning: Failure at t = 4.044553e-01. Unable to meet integration tolerances without reducing the step size below the smallest value allowed (8.881784e-16) at time t."
Is there a way for me to reduce the minimum step size allowed for the ode solver (in this case ode45)? The system is the lorenz equations, ( three equations) , and the system is not stiff. I have tried ode15s and a few others and I am getting the same type of warning. The integrator stops within a few very small time clicks. Why is the integrator doing this?
Here's my code
clear
close all
clc
s = 10;
r = 28;
b = 2.5;
n = 2;
en = 3;
N = n * en;
i1 = 1;
i2 = 3;
i3 = 1;
Y0 = [i1;
i2;
i3 ];
Y_actual = repmat(Y0, n,1 );
tMin = 0;
tMax = 100;
tStep = .01;
time = tMin:tStep:tMax-tStep;
df = @(t, y) [s.*(y(2:en:N)- y(1:en:N))
r.*y(1:en:N) - y(2:en:N) - y(1:en:N).*y(3:en:N)
y(1:en:N).*y(2:en:N) - b.*y(3:en:N)];
[T,Y] = ode45(df, time, Y_actual);
figure
plot(T,Y(:,1:en:N),'r', 'LineWidth', 2)
The problem goes away when I reduce the number of cells to 1, but I am learning how to vectorize my matlab scripts so I am really trying to get multiple cells integrated at once.
Thank you, and anything someone could tell my about why the script is doing this would be very helpful. Also, any ways to lower the minimum step size allowed for the ode solver would be great. :)