inputFileName='2process.aut'; fid = fopen( inputFileName,'rt'); if (fid < 0) error('could not open file' + inputFileName); end; line = strrep( fgetl(fid), 'des (', ''); line = strrep( line, ',', ' '); systemSize = sscanf( line, '%d'); % extracting the transition system size display( systemSize); stateNum = systemSize(3); % number of states in the model display(stateNum); Q = sparse( stateNum, stateNum); b = sparse( stateNum, 1); while ~feof(fid) remain = fgetl(fid); display(remain); % extracting the transition information from the file [start,remain] = strtok( remain, ',)( "'); [mcrl_action,remain] = strtok( remain, ',)( "'); [pepa_action,remain] = strtok( remain, ',)( "'); [type,remain] = strtok( remain, ',)( "'); [rate,remain] = strtok( remain, ',)( "'); [finish,remain] = strtok( remain, ',)( "'); dim1 = str2num(start) + 1; dim2 = str2num(finish) + 1; Q( dim1, dim2) = str2double( rate); end; display(Q); rowsSum = sum(Q,2); for i=1:stateNum, Q(i,i)=-rowsSum(i); end; Qt = Q'; % transpose the generator matrix for i=1:stateNum % replace the last equation by the normalisation constant in Qt(stateNum,i) = 1.0; end; b(stateNum) = 1.0; p = Qt\b; % solve to find the steady state distribution display( Qt); display( b); display( p); fclose(fid);