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

  1. 11000 '********************************************************************
  2. 11010 '* SUBROUTINE LORENTZIAN                                            *
  3. 11020 '*                                                                  *
  4. 11030 '* Fills the array fcalc(nobs) with values along a lorentzian of    *
  5. 11040 '* the form:                                                        *
  6. 11050 '*                                                                  *
  7. 11060 '* lor(pos) = H / [(1/W)^2 * (pos - P)^2 + 1]                       *
  8. 11070 '*                                                                  *
  9. 11080 '* where H, W, and P are parameters to be fit.                      *
  10. 11090 '* Assignments: H = p(1)  W = p(2) P = p(3)    pos = vobs(i,1)      *
  11. 11100 '********************************************************************
  12. 11110 '
  13. 11130 WSQ2 = 1# / (P(2) * P(2))
  14. 11160 FOR I = 1 TO NOBS
  15. 11170    FCALC(I) =  P(1) / (WSQ2 * (VOBS(I,1) - P(3))^2 + 1#)
  16. 11230    NEXT I
  17. 11240 RETURN
  18. P(2))
  19. 11160 F