Chapter 3, Modularity, Objects, and State

Exercise 3.80


I can not test the exercises in this section as MIT scheme is giving an error for forward references: ;Premature reference.

1
2
3
4
5
6
7
8
9
10
11
(define (RLC R L C dt)
  (lambda (vc0 il0)
	(define vc (integral (delay dvc) vc0 dt))
	(define dvc (scale il (/ -1 C)))
	(define il (integral (delay dil) il0 dt))
	(define dil (add-streams
				 (scale-stream vc (/ 1 L))
				 (scale-stream il (/ (- R) L))))
	(cons vc il)))

(define RLC1 ((RLC 1 0.2 1 0.1) 0 10))