% Script to compare solutions matl = load('matlab.dat'); fora = load('fortrana.dat'); forb = load('fortranb.dat'); c__a = load('C.dat'); math = load('mathematicf.dat'); math = math'; whos %% clear All All(:,:,1) = matl(:,2:5); All(:,:,2) = fora(:,2:5); All(:,:,3) = forb(:,2:5); All(:,:,4) = c__a(:,2:5); All(:,:,5) = math(:,1:4); %% XD = squeeze(All(:,2,:)); figure(5); plot(XD-repmat(mean(XD(:,1:4)')',1,5),'-+'); xlabel('Index')' ; ylabel('dX estimates'); title('Solution differences'); legend('Matlab','FortranA','FortranB','C','Mathematica'); rmsX = std(XD-repmat(mean(XD(:,1:4)')',1,5)); YD = squeeze(All(:,3,:)); figure(6); plot(YD-repmat(mean(YD(:,1:4)')',1,5),'-+'); xlabel('Index')' ; ylabel('dY estimates'); title('Solution differences'); legend('Matlab','FortranA','FortranB','C','Mathematica') rmsY = std(YD-repmat(mean(YD(:,1:4)')',1,5)); ZD = squeeze(All(:,4,:)); figure(7); plot(ZD-repmat(mean(ZD(:,1:4)')',1,5),'-+'); xlabel('Index')' ; ylabel('dZ estimates'); title('Solution differences'); legend('Matlab','FortranA','FortranB','C','Mathematica') rmsZ = std(ZD-repmat(mean(ZD(:,1:4)')',1,5)); %% fprintf('Comparision of solutions\nCMP Matlab FortranA FortranB C Mathematica\n'); fprintf('X %10.5f %10.5f %10.5f %10.5f %10.5f\n',rmsX); fprintf('Y %10.5f %10.5f %10.5f %10.5f %10.5f\n',rmsY); fprintf('Z %10.5f %10.5f %10.5f %10.5f %10.5f\n',rmsZ);