Mandelbrot Set Matlab: Exploring & Zooming Around Points

In summary, the conversation discusses the definition and properties of the Mandelbrot set, as well as the creation of a function and script to display it in color. The function "converge" takes in a complex vector and returns the number of iterations before the sequence diverges, while the script "affiche_mandelbrot" generates a grid and calculates the Mandelbrot set, allowing for user input to zoom in on specific points. Through adjusting the zoom level and maximum number of iterations, the general shape of the set can be observed.
  • #1
gausshi
1
0
Hi!

The Mandelbrot set is defined as a fractal set of points c of the plan for which the sequence defined recursively by:
Zn+1 = Zn.^2c

with z 0 = 0

does not tend towards infinity (in module).

useful property
If there exists an integer N such that | zN |> 2, then the sequence diverges.
graphical representation
In practice we set a maximum number M of iterations. If the module does not exceed the value
2 after M iterations, we consider that the sequence converges and that c belongs to
the Mandelbrot set.
For purely aesthetic reasons, the Mandelbrot set is often represented with
of colors. Color (black in the example above) is assigned to points belonging
to all. Then, the color depends on the number of iterations needed for the following
be considered divergent (In practice, this is the number of iterations required for the
module exceeds z 2).1) Create the function converges, which takes as input a complex vector c and the integer M
representing the maximum number of iterations to be tested.
This function returns an output vector containing for each element of the vector c
the number of iterations before which later was determined divergent.
It is conceivable that the vector contains a particular number in cases where more has not been determined divergent (we assume when it is convergent).function V=converge(c,M)

l=length©;

for j=1:l
k=0;
for i=1:(M)
z(1)=0;
z(i+1)=z(i)^2+c(1,j);

abs(z(i+1));

if(abs(z(i+1))<=2)
k=k+1;
else
V(1,j)=k;
break
end
V(1,j)=k;
end
end2) Create the script affiche_mandelbrot makes the display (in color) of the full Mandelbrot set
(do some research to find the appropriate limits of the axes).
Find a color palette, a number M and a satisfactory resolution so that the general shape is visible
but the display is not too long. Try several values ​​of M to see the differences.
How do you explain?

I need help !

4) Modify the script affiche_mandelbrot so it asks the user a point and it zooms around this point
(the intensity of the zoom can also be set by the user).
To do this, you can use the input of Octave / Matlab.
 
Physics news on Phys.org
  • #2
% Ask for user inputprompt = 'Enter the point (x,y): ';point = input(prompt);% Ask for zoom levelprompt = 'Enter the zoom level: ';zoom = input(prompt);% Calculate the new x and y rangesxmin = point(1) - zoom;xmax = point(1) + zoom;ymin = point(2) - zoom;ymax = point(2) + zoom;% Generate the grid[X,Y] = meshgrid(xmin:xmax,ymin:ymax);% Compute Mandelbrot setc = X + i*Y;V=converge(c,M);% Plot the Mandelbrot setimagesc(xmin:xmax,ymin:ymax,V);colormap(jet(256));
 

1. What is the Mandelbrot Set?

The Mandelbrot Set is a mathematical set of complex numbers that when plotted on a coordinate plane, form a beautiful and infinite fractal pattern. It was discovered by mathematician Benoit Mandelbrot in the 1970s and has since become a popular subject for exploration and artistic expression.

2. How is the Mandelbrot Set explored using Matlab?

Matlab is a powerful software program commonly used for scientific and mathematical purposes. With its built-in functions for complex numbers and graphing, it is an ideal tool for exploring the Mandelbrot Set. By using loops and conditional statements, Matlab can iterate through a large number of complex numbers and determine whether they belong to the set or not, allowing for the creation of detailed and interactive visualizations.

3. What does it mean to "zoom around points" in the Mandelbrot Set using Matlab?

One of the most fascinating aspects of the Mandelbrot Set is its infinite detail. As you zoom in on any point of the set, you will continue to see intricate patterns and shapes. Using Matlab, you can specify a region of the Mandelbrot Set to zoom in on and the program will generate a more detailed image of that specific area, allowing for a closer examination of the patterns and structures within the set.

4. Can the Mandelbrot Set be explored in other programming languages?

Yes, the Mandelbrot Set can be explored in many different programming languages, including Python, Java, and C++. Each language has its own set of functions and syntax for working with complex numbers and plotting graphs, but the basic principles for exploring the Mandelbrot Set remain the same.

5. What are some potential applications of the Mandelbrot Set?

Aside from its aesthetic appeal, the Mandelbrot Set has been used in various fields of science and technology. It has been used to study chaos theory, fractal geometry, and even the behavior of stock market prices. It has also inspired the development of new compression algorithms and encryption methods. Ultimately, the Mandelbrot Set serves as a captivating example of the complex and beautiful patterns that can arise from simple mathematical principles.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
566
  • Engineering and Comp Sci Homework Help
Replies
1
Views
954
  • Engineering and Comp Sci Homework Help
Replies
20
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
950
  • Engineering and Comp Sci Homework Help
Replies
6
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
7
Views
724
Replies
20
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
7
Views
886
Back
Top