!----------------------------------
real*8 function ufct(t)
use work

implicit real*8 (a-h,o-z)
common C10,C20,C1,C2,C11,C21,da,ust

	if(zeta.ne.0) goto 200

!raspuns neam. liber sau fortat
ufct0 = C20*dcos(omega*t) +C10*dsin(omega*t)
if(omp.eq.0.) then
ufct =ufct0
return

else
ufct = ufct0 + ust*DA*(dsin(omp*t) -omp/omega*dsin(omega*t))
endif

return

!raspuns liber am. cu zeta<=> 1
200	if(zeta ==1) then
ufct =dexp(-omega*t)*(C1*t +C2)
	return

else if(zeta <1) then
ufct =dexp(-zeta*omega*t)*( C1*dsin(oma*t) +C2*dcos(oma*t))

else
ufct =dexp(-zeta*omega*t)*( C11*dexp(-oma*t) +C21*dexp(oma*t))
endif

return
end

!----------------------------
real*8 function vfct(t)
use work

implicit real*8 (a-h,o-z)
common C10,C20,C1,C2,C11,C21,da,ust

if(zeta.ne.0) goto 200

!raspuns neam. liber sau fortat
! ufct0= C20*dcos(omega*t) +C10*dsin(omega*t)
vfct0 = -C20*omega*dsin(omega*t) +C10*omega*dcos(omega*t)

if(omp.eq.0.) then
vfct=vfct0

else
!ufct= ufct0 + ust*DA*(dsin(omp*t) -omp/omega*dsin(omega*t))
vfct = vfct0 + ust*DA*omp*(dcos(omp*t) -dcos(omega*t))
endif

RETURN

!raspuns liber am. cu zeta<=> 1
200	if(zeta ==1) then
!fct=dexp(-omega*t)*(C1*t +C2)
vfct =dexp(-omega*t)*C1 -omega*dexp(-omega*t)*(C1*t +C2)

else if(zeta <1) then
ufct =dexp(-zeta*omega*t)*( C1*dsin(oma*t) +C2*dcos(oma*t))
!
vfct =-zeta*omega*ufct +dexp(-zeta*omega*t)*( C1*oma*dcos(oma*t) -C2*oma*dsin(oma*t))

else
ufct =dexp(-zeta*omega*t)*( C11*dexp(-oma*t) +C21*dexp(oma*t))
!
vfct =-zeta*omega*ufct +dexp(-zeta*omega*t)*( -oma*C11*dexp(-oma*t) +oma*C21*dexp(oma*t))
endif

return
end
