Creative Programming In Processing | Set 2 (Lorenz Attractor)
Creative Programming In Processing | Set 1 (Random Walker)
The Lorenz system is a system of ordinary differential equations first studied by Edward Norton Lorenz, an American mathematician and meteorologist around 1963. It is notable for having chaotic solutions for certain parameter values and initial conditions. It was derived from a simplified model of convection in the earth’s atmosphere. It also arises naturally in models of lasers and dynamos. The Lorenz attractor is a set of chaotic solutions of the Lorenz system which, when plotted, resemble a butterfly or figure eight. The following image appeared in the Nature journal 31 August 2000, pp 949 as part of an article titled The Lorenz Attractor Exists, written by Ian Stewart.
The Lorenz attractor system is most commonly expressed as 3 coupled non-linear differential equations-
In the above set of equations, ‘a’ is sometimes known as the Prandtl number and ‘b’ the Rayleigh number. One commonly used set of constants is a = 10, b = 28, c = 8 / 3. Another is a = 28, b = 46.92, c = 4.
Sample implementation of the differential equations in java:-
We will try to implement the above logic in Processing Java visually. Since we will be plotting the points in 3d, we need use a 3d renderer. We will be using the OPENGL renderer in the following implementation but a P3D renderer can also be used. We also need to use an external Processing library called PeasyCam which helps us to create an interactive camera object for 3d environment workflow. PeasyCam can be downloaded using the Processing IDE from tools ->Add Tool -> Libraries.
We will also be using the following functions to represent the Lorenz Attractor structure-
beginShape()– begins recording vertices for a shape.
endShape()– stops recording vertices for a shape.
vertex()– this function is used to specify the vertex coordinates for points, lines, triangles, quads, and polygons. It is used exclusively within the
Implementation of Lorenz Attractor in Processing java:-
Source Materials –
This article is contributed by Soumik Rakshit. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.