Another interesting area of Mathematics... thought a few of you may be interested
Lorenz Attractor:Rössler Attractor:Duffing's Attractor(defun c:lorenz (/ iLim i h a b c x0 y0 z0 x y z)
(setq iLim 10000 i -1 h 0.01 a 10. b 28. c (/ 8. 3.) x0 0.1 y0 0. z0 0.)
(entmake '((0 . "POLYLINE") (70 . 8)))
(while (< (setq i (1+ i)) iLim)
(setq x (+ x0 (* h a (- y0 x0)))
y (+ y0 (* h (- (* x0 (- b z0)) y0)))
z (+ z0 (* h (- (* x0 y0) (* c z0)))) x0 x y0 y z0 z)
(entmake (list '(0 . "VERTEX") '(70 . 32) (cons 10 (list x y z)))))
(entmake '((0 . "SEQEND")))
(princ))
(defun c:rossler (/ iLim i h a b c x0 y0 z0 x y z)
(setq iLim 10000 i -1 h 0.01 a 0.2 b 0.2 c 5.7 x0 0.1 y0 0. z0 0.)
(entmake '((0 . "POLYLINE") (70 . 8)))
(while (< (setq i (1+ i)) iLim)
(setq x (+ x0 (* h (- (- y0) z0)))
y (+ y0 (* h (+ x0 (* a y0))))
z (+ z0 (* h (+ b (* z0 (- x0 c))))) x0 x y0 y z0 z)
(entmake (list '(0 . "VERTEX") '(70 . 32) (cons 10 (list x y z)))))
(entmake '((0 . "SEQEND")))
(princ))
(defun c:duffings (/ iLim i h a b x0 y0 z0 x y z)
(setq iLim 10000 i -1 h 0.04 a 0.2 b 0.3 x0 0. y0 0. z0 0.)
(entmake '((0 . "POLYLINE") (70 . 8)))
(while (< (setq i (1+ i)) iLim)
(setq x (+ x0 (* h y0))
y (+ y0 (* h (+ (- x0 (* x0 x0 x0) (* a y0)) (* b (cos z0)))))
z (+ z0 h) x0 x y0 y z0 z)
(entmake (list '(0 . "VERTEX") '(70 . 32) (cons 10 (list x y z)))))
(entmake '((0 . "SEQEND")))
(princ))
{ Various Attractors can be obtained by varying the values of
a,b,c in the above code
}Enjoy!
Lee