Changeset 78801d6381aaaf4f21967582680f26889582db60
 Timestamp:
 04/15/12 10:50:16 (2 years ago)
 Author:
 Raymond Toy <toy.raymond@…>
 Children:
 8c5195a87137fd61952a175a5dae676c70b480ef, 581a0a08f04a985424c09b6a7b3661d2eb58c3e9
 Parents:
 5566bc397937c2e8979ee6847e8f59f279f1f643
 gitcommitter:
 Raymond Toy <toy.raymond@…> (04/15/12 10:50:16)
 Message:

 Add comments for integerbesseljexparc.
 Simplify suman so we stop the sum when the terms no longer
contribute to the sum.
 Change bign. This still needs work.
 Files:

Legend:
 Unmodified
 Added
 Removed

r235ac2

r78801d


180  180  
181  181  
182   ;; 
 182  ;; Not really just for Bessel J for integer orders, but in that case, 
 183  ;; this is all that's needed to compute Bessel J. For other values, 
 184  ;; this is just part of the computation needed. 
 185  ;; 
 186  ;; Compute 
 187  ;; 
 188  ;; 1/(2*%pi) * (exp(%i*v*%pi/2) * I(%i*z, v) + exp(%i*v*%pi/2) * I(%i*z, v)) 
183  189  (defun integerbesseljexparc (v z) 
184  190  (let* ((iz (* #c(0 1) z)) 
… 
… 

258  264  ;; sum(exp(k*z)*a[n](k,v), k, 1, N) 
259  265  ;; 
 266  #+nil 
260  267  (defun suman (bign n v z) 
261  268  (let ((sum 0)) 
… 
… 

265  272  (an n k v)))) 
266  273  sum)) 
 274  
 275  ;; Like above, but we just stop when the terms no longer contribute to 
 276  ;; the sum. 
 277  (defun suman (bign n v z) 
 278  (let ((eps (epsilon (realpart z)))) 
 279  (do* ((k 1 (+ 1 k)) 
 280  (term (* (exp ( (* k z))) 
 281  (an n k v)) 
 282  (* (exp ( (* k z))) 
 283  (an n k v))) 
 284  (sum term (+ sum term))) 
 285  ((or (<= (abs term) (* eps (abs sum))) 
 286  (> k bign)) 
 287  sum)))) 
267  288  
268  289  ;; SUMAB computes the series 
… 
… 

400  421  (t 
401  422  ;; Need to finetune the value of bign. 
402   (let ((bign 100) 
 423  (let ((bign 10) 
403  424  (vpi (* v (floatpi (realpart z))))) 
404  425  (+ (integerbesseljexparc v z) 