Monday, June 21, 2010

ARMAT, Auto-filling of Summary Result Tables of A&R Analysis using MATLAB


After A&R analysis using OFFPIPE software, it’s required to prepare summarized tables from the outputs. These summary tables are usually prepared in Excel. Numbers in each cell of these tables are extracted from output files of OFFPIPE. Considering the fact that the amount of output data is too much, preparation of these tables is very time consuming. Usually, after each A&R analysis, about 50 man-hours work is required to prepare these tables. For this purpose, the OFFPIPE output files distributed between three persons and these three persons prepare the tables in two days continues work, by visual processing. For preventing of involvement of some persons in such time consuming work and visual and manual work, reduction of preparation of these tables, and reduction of possible operator error, a program is prepared which is doing this task automatically. With this program, just one person involves the work and all tables are prepared in less than 15 minutes.

Keywords: OFFPIPE, Abandon and Recovery Analysis (A&R Analysis), MATLAB



This is a professional software suitable for the companies which working on submarine pipeline design and/or installation. 

Sunday, June 06, 2010

2D-graph data import from MATLAB to AutoCAD

2D-graph data import from MATLAB to AutoCAD

This is an early version and very old program which I coded about 10 years ago. According to the attached pictures it's clear how to use it. I deliberately made such an examples to show the efficiently of Mat2CAD function while dealing with Inf and NaN.

function Mat2CAD(x,y,fname)
%MAT2CAD Converting of MATLAB 2D-graph data to AutoCAD script file.
% MAT2CAD(X,Y,FNAME) creates an AutoCAD script file from data vectors
% X and Y. X and Y must be vector arrays with the same length. They may
% contain Inf and/or NaN.
% FNAME is the Output Script File Name, with extension scr.
% This function is using just AutoCAD pline command for plotting.
%
% Numerical Recipes for Solving Engineering Problems using MATLAB
% By: Mehdi Mosafer, Rev. 0.1, 2001.
% http://matlab1st.blogspot.com
L=length(x);
j1=find(isinf(y));
j2=find(isnan(y));
j=[j1(:);j2(:)];

fid=fopen([fname,'.scr'],'wt');
fprintf(fid,'pline\n');
for k=1:L
    if ~isempty(find(k==j))
       fprintf(fid,'\n');
       fprintf(fid,'pline\n');
    else
       fprintf(fid,'%g',x(k));
       fprintf(fid,',');
       fprintf(fid,'%g\n',y(k));
    end
end
fprintf(fid,'\n');
fprintf(fid,'zoom\n');
fprintf(fid,'extents\n');
fprintf(fid,'\n');
fclose(fid);
If there is a smooth and tidy way ahead, passing from the old rocky roads is not recommended. (Weierstrass)