Jump to content

A Few Attractors...


Lee Mac

Recommended Posts

Following with the Mathematical trend to my threads... here is another extremely interesting branch of Mathematics.

 

Relating to my other Chaos Theory thread, here are a few attractors that you can create in ACAD.

 

The attractors are created by solving various Non-Linear Differential Equations numerically, (using Euler's method in this case).

 

I have modelled three attractors for you to experiment with:

 

The Lorenz Attractor:

 

This stems from a simplification of the equations used to model Weather systems, and is the general attractor that most people think of when they think about Chaos Theory... as Edward Lorenz was the pioneer of Chaos theory.

 

 

Lorenz%20Attractor.png

 

 

The Rössler Attractor:

 

Rossler%20Attractor.png

 

 

The Duffing's Attractor:

 

This attractor is obtained when numerically solving the non-linear ordinary differential equation that is Duffing's Equation.

 

The equation models a damped oscillator, such as a weighted non-uniform spring. To solve the equation numerically, I have reduced the second order differential equation to two first order equations, and then used Euler's method to generate the attractor.

 

Duffings%20Attractor%202.png

 

 

 

Various Attractors can be generated by varying the input parameters (a,b and c in the code).

 

(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 . ))
 (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 . ))
 (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 . ))
 (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))

I hope you enjoy this little exploration into this fascinating area of mathematics, and, of course, if you have any questions - please ask.

 

Lee

Link to comment
Share on other sites

  • 6 years later...
  • 4 weeks later...
The 3D one is spectacular!! Man I love seeing what math can do. :)

 

Thanks Tannar! As you can tell, I'm also fascinated by fractal geometry :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...