Add some (commented) tests for 3.79

This needs working out how to load modules from within modules to work properly.
This commit is contained in:
Oliver Payne 2023-02-12 21:10:56 +00:00
parent 663b98cf17
commit 9bc3adade4
1 changed files with 12 additions and 0 deletions

View File

@ -780,6 +780,18 @@
(scale-stream y b))))
y)))
;; (module+ test
;; ;; Test: a=0, b=-1, y0=1, dy0=0: d^2/dx(cos(x)) = -cos(x). Evaluate at pi -> -1
;; ;; a=0, b=-1, y0=0, dy0=1: d^2/dx(sin(x)) = -sin(x). Evaluate at pi -> 0
;; (check (close-to (stream-ref (solve-2nd 0 -1 (/ 3.1415 1000) 1 0) 1000)
;; -1
;; 0.01))
;; (check (close-to (stream-ref (solve-2nd 0 -1 (/ 3.1415 1000) 0 1) 1000)
;; 0
;; 0.01)))
(module+ 3-79
(#%require racket/local)
(define (solve-2nd f dt y0 dy0)