clear all;

a = 1;
b = 4;
c = 4;
L = 10;
q=(L-c)/(2*c);

f = @(t,x)([x(2);x(3)*sqrt(1 + x(2)^2);0;sqrt(1+x(2)^2)]);
g = @(x0 , xm)( [x0(1)-a ; xm(1)-b ; x0(4) ; xm(4)-L ] ); 


t = 0:0.2:4;

% Alkuarvaus ( by. Timo)

U(1,:)=a+(b-a)*t/c+q*t.*(t-c);                     
U(2,:)=(b-a)/c-q*c+2*q*t;                        
U(3,:)=2*q*ones(1,length(t));                    
U(4,:)=L*t/c;    


x = bvp_solve(f ,g, U,t);