subroutine jfcn(t, y, jf)
use work
! Calculeaza jacobianul lui f_BDF
implicit real(8) (a-h,o-z)
real(8) y(n), jf(n,n)

! Ecuatia Van der Pol:
! x'' -lambda(1-x**2)*x'+x=A*cos(omega*t)
! 1st order: x & u
! x' = u		; x(0) =1
! u' = lambda*(1-x**2)*u -x + A*cos(omega*t)	; u(0)=0

!ff(1) =y(2)
!ff(2) =lambda*(1-y(1)**2)*y(2) -y(1) + A*dcos(omega*t)

! jff:
! (1,1): 0;	(1,2): 1
! (2,1): -2*lambda*y(1)*y(2); (2,2): lambda*(1-y(1)**2)

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


jf(1,1) =c(0);	jf(1,2) =c(0) +1;
jf(2,1) =c(0)-2*lambda*y(1)*y(2);	jf(2,2) =c(0) +lambda*(1-y(1)**2);

END subroutine jfcn

