                          6.001 PS4 ADDENDUM


    Additional note for problem set 4.  In order to make it easier for
you to interpret the data structures which represent circuits we have
added a "documentation field" to the representations of each of the
primitive electrical elements in PS4-IMP.SCM.  This does not change
the behavior of the programs which manipulate the circuits, but it
makes the printouts easier to read.




;;; Primitive electrical elements.
;;;  Data structure is:
;;;	(<type> (<parameter name> <value>) <procedure>)

(define (make-resistor resistance)
  (let ((r (make-complex resistance 0)))
    (attach-type 'resistor
		 (list (list 'resistance resistance)	;for documentation
		       (lambda (s) r)))))

(define (resistance-resistor resistor)
  (cadr (contents resistor)))

(define (conductance-resistor resistor)
  (lambda (s) (recip ((cadr (contents resistor)) s))))



(define (make-capacitor capacitance)
  (let ((c (make-complex capacitance 0)))
    (attach-type 'resistor
		 (list (list 'capacitance capacitance)
		       (lambda (s)
			 (recip (*c c s)))))))

(define (make-inductor inductance)
  (let ((l (make-complex inductance 0)))
    (attach-type 'resistor
		 (list (list 'inductance inductance)
		       (lambda (s) (*c l s))))))

