% Краевая задача, пример 1
% dy1/dt= y2, dy2/dt=-y1, y1(0)=1, y2(pi)=-1
rp= @(t,y) [y(2);-y(1)];
bc= @(ya,yb) [ya(1)-1;yb(1)+1];
xinit= 0:pi/60:pi;
guess= @(x)[1-2*x./pi;-1];
solinit = bvpinit(xinit,guess);
sol= bvp4c(rp,bc,solinit)

