clear all; close all; clc;

% Determine the connectivity matrix W

W = randn(2)*10^2;
W = [0 -1; -1 0]*6;
display(W);

% Set the parameters of the simulation

dt=10^(-2);
N1 = 10^6;

% Compute the flow of the activity

% Choose four different starting points
x10 = [0.1;0.1];
x20 = [0.9;0.1];
x30 = [0.1;0.9];
x40 = [0.9;0.9];

% Solve the ODEs
x11 = runeq(x10,W,dt,N1);
x21 = runeq(x20,W,dt,N1);
x31 = runeq(x30,W,dt,N1);
x41 = runeq(x40,W,dt,N1);

% Plot trajectory

figure;
hold on;
scatter(x11(1,:),x11(2,:))
scatter(x21(1,:),x21(2,:))
scatter(x31(1,:),x31(2,:))
scatter(x41(1,:),x41(2,:))
axis equal
hold off;
xlim([0 1])
ylim([0 1])