%script to run simulation of NV model
clear all
tic
ML = 0;
delete(gcp('nocreate'))
parpool('local',4);
spmd
    rng(0,'combRecursive');
end

path = '../data/simulationdata/NV';
if exist(path)==0
   mkdir(path) ;
end

c=[0.0005,0.001,0.0014,0.002, 0.0025];
d=[0.007,0.008,0.009,0.010125,0.011];

if ML ==1 % run maximum likelihood value
c=c(3);
d=d(4);
end

e=1;
L2=0.9;
Lapse=0;

run=0;
for i= 1:length(c)
    answer2D= robModelNoVel2D(c(i), L2,Lapse ,3);
    for j=1:length(d)
    answer3D= robModelNoVel3D(c(i),d(j), L2,Lapse ,3);
    C=c(i);
    D=d(j);
    save([path,'/fitNV_',num2str(run),'.mat'])
    disp(run)
    run=run+1;
    end
end
toc

