From: Kevin M. Rosenberg Date: Wed, 14 Jan 2004 11:13:03 +0000 (+0000) Subject: r8525: fix bug in L circuit X-Git-Tag: v0.1.3~6 X-Git-Url: http://git.kpe.io/?p=rlc.git;a=commitdiff_plain;h=a55a2dd7c48c32fb5c53b2246f4ca988ddff375d r8525: fix bug in L circuit --- diff --git a/debian/changelog b/debian/changelog index ae3b66f..e99d2bf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +cl-rlc (0.1.2-1) unstable; urgency=low + + * New upstream + + -- Kevin M. Rosenberg Tue, 13 Jan 2004 23:57:44 -0700 + cl-rlc (0.1.1-1) unstable; urgency=low * Add missing file diff --git a/main.lisp b/main.lisp index 171b518..87fec05 100644 --- a/main.lisp +++ b/main.lisp @@ -12,15 +12,16 @@ (in-package #:rlc) -(defun plot-series-rlc-current (v r l c t-inc t-end &optional (t-start 0)) +(defun plot-series-rlc-current (v r l c t-inc t-end &optional (t-start 0) + (graph-function 'run-xgraph)) (let ((path (make-pathname :directory '(:absolute "tmp") :name (concatenate 'string "rlc-data-" (write-to-string (get-universal-time))) :type "dat"))) - (write-series-rlc-graph path v r l c t-inc t-end t-start) - (run-xgraph path) + (write-series-rlc-current-graph path v r l c t-inc t-end t-start) + (funcall graph-function path) (sleep 2) (delete-file path))) @@ -29,12 +30,16 @@ (defun write-series-rlc-current-graph (path v r l c t-inc t-end &optional (t-start 0)) + (with-open-file (out path :direction :output :if-exists :supersede + :if-does-not-exist :create) + (write-series-rlc-current-graph-stream out v r l c t-inc t-end t-start))) + +(defun write-series-rlc-current-graph-stream (out v r l c t-inc t-end + &optional (t-start 0)) (multiple-value-bind (x y) (series-rlc-current-graph-data v r l c t-inc t-end t-start) - (with-open-file (out path :direction :output :if-exists :supersede - :if-does-not-exist :create) - (dotimes (i (length x)) - (format out "~D ~D~%" (aref x i) (aref y i)))))) + (dotimes (i (length x)) + (format out "~D ~D~%" (aref x i) (aref y i))))) (defun series-rlc-current-graph-data (v r l c t-inc t-end &optional (t-start 0)) (let* ((formula-list (series-rlc-current-formula v r l c)) @@ -88,7 +93,7 @@ 0))) (:l `(lambda (tm) - (* ,(/ v l) t))) + (* ,(/ v l) tm))) (:rl `(lambda (tm) (* ,(/ v r) (- 1 (exp (- (* tm ,(/ r l)))))))) diff --git a/package.lisp b/package.lisp index 039f46c..8c1a557 100644 --- a/package.lisp +++ b/package.lisp @@ -9,6 +9,7 @@ #:plot-series-rlc-current #:series-rlc-current-formula #:series-rlc-current-time + #:write-series-rlc-current-graph-stream ))