Re: problem with library function



hi
i defined them in main program ,because i want to compute them in do
loop for times .

program lightcurve
Use numerical_libraries
implicit none
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
integer ITMAX, N
real ERRREL
PARAMETER (N=2)

integer K, NOUT
real FNORM, X(N), XGUESS(N)
EXTERNAL FCN ! , NEQNF, UMACH

real u1,u2 ! position of source
real tE ! velocity of source .
real b1 ! impcat parameter
real theta ! the angle between sorce trace and horzintal axis
real t0 !time of nearest ray to lens which centered on
origin .in unit of day
real t ! time of moving source
real A
real pi
pi=3.1428

theta=pi/4
t0=0.2
tE=10
b1=0.5

do t=0,1,0.1

u1=b1*sin(theta)+((t-t0)/tE)*cos(theta)
u2=b1*cos(theta)-((t-t0)/tE)*sin(theta)


data XGUESS/ 4.0, 2.0 / !Set values of initial guess

ERRREL = 0.0001
ITMAX = 100




call UMACH (2, NOUT)
call NEQNF (FCN, ERRREL, N, ITMAX, XGUESS, X, FNORM)


write (*,*),X(1),X(2)

end do ! do of t

end program lightcurve !deghat kon ,baranem inja tamom mishe




!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! User-defined subroutine

subroutine FCN (X, F, N)
integer N
real X(N), F(N)

real u1,u2

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

F(1)=u1-(X(1)-X(1)/(X(1)**2+X(2)**2))
F(2)=u2-(X(2)-X(2)/(X(1)**2+X(2)**2))


return
end subroutine

i want it computes u1 ,u2 for each t ,then solve system of
equations !

.



Relevant Pages

  • problem with NEQNF
    ... integer ITMAX, N ... real ERRREL ... external FCN ... FNORM) ...
    (comp.lang.fortran)
  • Re: problem with NEQNF
    ... integer ITMAX, N ... real ERRREL ... external FCN ... subroutine FCN ...
    (comp.lang.fortran)
  • Re: problem with library function
    ... implicit none ... integer ITMAX, N ... end program lightcurve!deghat kon,baranem inja tamom mishe ... end module umod ...
    (comp.lang.fortran)