Exercise 3.80

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
(define (RLC R L C dt)
  (lambda (vc0 il0)
    (cons (vc-stream vc0 C dt)
          (il-stream il0 R L dt))))

(define (vc-stream vc0 C dt)
  (define vc (integral (delay dvc) vc0 dt))
  (define dvc (scale-stream (delay il-stream) (/ -1.0 C)))
  vc)

(define (il-stream il0 R L dt)
  (define il (integral (delay dil) il0 dt))
  (define dil (add-streams (scale-stream vc-stream (/ 1.0 L))
                           (scale-stream il (* (- R) (/ 1.0 L)))))
  il)
Creative Commons License
This work, unless otherwise expressly stated, is licensed under a Creative Commons Attribution 2.0 UK: England & Wales License.

Tags: ,

Leave a Reply

CAPTCHA Image

Powered by WP Hashcash

Please wrap all source codes with [code][/code] tags.