this code fails to simulate traffic flow using the gipps model with the following equation █(&v_n (t+τ)=min{v_n (t)+2.5a_n τ(1-v_n (t)/V_n ) (0.025+v_n (t)/V_n )^(1/2),┤@&├ b_n τ+√(b_n^2 τ^2-b_n [2[x_(n-1) (t)-s_(n-1)-x_n (t)]-v_n (t)τ-v_(n-1) (t)^2/b ̂ ] )}@&) the problem is logical in the sense that the position x seems to explode to -inf can you please try to fix it by either changing the inital conditions or checking the equations for updating position 
% Define simulation parameters
dt = 0.01; % Time interval
T = 30; % Total simulation time
time = 0:dt:T; % Time vector

% Define initial conditions
N_cars = 10; % Number of cars
v0 = 120 / 3.6; % Desired speed in m/s
s0 = 2; % Minimum gap between cars in m
T = 1.5; % Safe time headway
a_max = 0.3; % Maximum acceleration in m/s^2
b_max = 2; % Comfortable braking deceleration in m/s^2
L = [4.5, 5, 4.5, 5, 4.5, 5, 4.5, 5, 4.5, 5]; % Car length vector
W = [2, 2.2, 2, 2.2, 2, 2.2, 2, 2.2, 2, 2.2]; % Car width vector
x = cumsum([0, 10*ones(1,N_cars-1)]); % Car positions
v = v0*ones(1,N_cars); % Car speeds
acc = zeros(1,N_cars); % Car accelerations
dist = zeros(1,N_cars); % Car distances
colors=hsv(N_cars);

% Run simulation
for i = 2:length(time)
    % Store previous positions for plotting
    x_prev = x;
    
    % Update positions
    x = x + v*dt + 0.5*acc*dt^2;

    % Update speeds and accelerations
    for j = 1:N_cars
        % Calculate distance to lead car
        if j < N_cars
            dist(j) = x(j+1) - x(j) - L(j) - L(j+1);
        else
            dist(j) = 1e10; % Assume no car ahead of last car
        end

        % Calculate acceleration based on the Gipps model
        s_desired = s0 + T*v(j);
        if j > 1
            v_lead = v(j-1);
        else
            v_lead = 0; % Set speed to zero if no lead car exists
        end
        
        % Only consider lead car if it exists
        if j < N_cars
            d = dist(j) - L(j) - L(j+1);
        else
            d = dist(j) - L(j);
        end

        a_desired = a_max * (1 - (v(j)/v0)^4 - ((s_desired - d)/v(j))^2);
        a_safety = b_max * ((v_lead/v(j))^2 - 1) * (1 - s_desired/d) / sqrt(a_max*b_max);
        acc(j) = min(a_desired, a_safety);
    end

    % Update speeds
    v = v + acc*dt;

    % Animate results
    clf;
    hold on;

    for j = 1:N_cars
        rectangle('Position',[x_prev(j)-L(j)/2,(j-1)*2,L(j),2],'FaceColor',colors(j,:),'Curvature',j/N_cars);
    end
    
    xlim([0, max(x)+50]);
    ylim([0, sum(W)]);
    xlabel('Distance (m)');
    ylabel('Lane width (m)');
    title(sprintf('Time = %0.1f s', time(i)));
    drawnow;
end