home *** CD-ROM | disk | FTP | other *** search
/ PC-Blue - MS DOS Public Domain Library / PC-Blue MS-DOS Public Domain Library - NYACC.iso / vol030 / func1.bas < prev    next >
Encoding:
BASIC Source File  |  1987-01-11  |  1.1 KB  |  19 lines

  1. 10050 NVAR = 1 : NP = 3
  2. 11000 '********************************************************************
  3. 11010 '* SUBROUTINE GAUSSIAN                                              *
  4. 11020 '*                                                                  *
  5. 11030 '* Fills the array fcalc(nobs) with values along a gaussian         *
  6. 11040 '* of the form:                                                     *
  7. 11050 '*                                                                  *
  8. 11060 '* gauss(pos) = H * exp[-1 * (pos - P)^2 / w^2]                     *
  9. 11070 '*                                                                  *
  10. 11080 '* where H, W, and P are parameters to be fit.                      *
  11. 11090 '* Assignments:  H = p(1)  W = p(2)  P = p(3)  pos = vobs(i,1)      *
  12. 11100 '********************************************************************
  13. 11110 LOCATE 1,1:  'PUT SPURIOUS UNDERFLOW MESSAGES IN INNOCENT LOCATION
  14. 11120 FOR I = 1 TO NOBS
  15. 11130    FCALC(I)  =  P(1) * EXP( -1 * ( (VOBS(I,1) - P(3))^2 / P(2)^2 ) )
  16. 11140    NEXT I
  17. 11150 RETURN
  18.  FOR I = 1 TO NOBS
  19. 11130    FCALC(I)  =  P(1) * EXP( -1 * ( (VOBS(I,1) -