function [E, A, B, C] = getrail(k)

%% function [E, A, B, C] = getrail(k) reads in data for the rail example
% reimplemented in FENICS. See the Oberwolfach Model Reduction Benchmark Collection
% for the original data and 
%    
%    https://gitlab.mpi-magdeburg.mpg.de/models/fenicsrail
%
% for the sources of this model.
%
% Input:
%   k       number of instance 
%           k=1 ODE_371
%           k=2 ODE_1357
%           k=3 ODE_5177 
%           k=4 ODE_20209
%           k=5 ODE_79841
%           k=6 ODE_317377
%           k=7 ODE_1265537
% Output:
%   E       Sparse Matrix
%   A       Sparse Matrix
%   B       Dense Matrix
%   C       Dense Matrix

%% set path
switch k
    case 1
        example = 'ODE_371';
    case 2
        example = 'ODE_1357';
    case 3
        example = 'ODE_5177';
    case 4  
        example = 'ODE_20209';
    case 5
        example = 'ODE_79841';
    case 6
        example = 'ODE_317377';
    case 7
        example = 'ODE_1265537';
        
    otherwise
        error('MESS:error_arguments','k has to be 1,...,7\n');
end

%% check path
path = strcat('./',example);

%% read matrices
%example file DEMOS/Data_Rail/rail_1357/rail_1357_c60.A
A = mmread(strcat(path,'_S.mtx'));
M = mmread(strcat(path,'_M_GAMMA.mtx'));
A =-(A+M);

E = mmread(strcat(path,'_M.mtx'));
B = mmread(strcat(path,'_B.mtx'));

C                      = zeros(6, size(eqn.A_, 1));
C(1, [4, 22, 60])      = [-1, -1, 3];
C(2, [2, 3, 63])       = [-1, -1, 2];
C(3, [43, 51])         = [-1, 1];
C(4, [47, 55])         = [-1, 1];
C(5, [9, 16, 92])      = [-1, -1, 2];
C(6, [10, 15, 34, 83]) = [-1, -1, -1, 3];


%% convert B and C to dense matrices
B = full(B);






