subroutine fcn(t, y, f_bdf)
use work
! Calculeaza functia din BDF
implicit real(8) (a-h,o-z)
real(8) y(n), f_bdf(n), ff(n)

! y =xa(1,:)
! Membrii 2:
ff(1) =y(2)
ff(2) =-100*y(1) -101*y(2)

!f_bdf(:) = c(5,0)*y(:) +c(5,1)*xa(0,:) +c(5,2)*xa(-1,:) +c(5,3)*xa(-2,:) +c(5,4)*xa(-3,:) +c(5,5)*xa(-4,:) -h*ff(:)
f_bdf =-h*ff(:) +c(k,0)*y(:)

do i =1, k
f_bdf =f_bdf +c(k, i)*xa(-i+1,:)
enddo


END subroutine fcn

