Fractals from the Lorenz Equations Determine the fractal that arises from using Newton's method to compute the fixed-point solutions of the Lorenz equations. Use the parameter values r = 28, = 10 and B=8/3. Initial values (x) are taken on a grid in the x-z plane with always yo = 3√2. For assessment purposes, the computational grid and the graphics code will be given in the Learner Template. To pass the assessment, every pixel in your figure needs to be colored correctly. (Hint: Some grid points may require as many as 33 Newton iterations to converge while others may require as few as three. Unfortunately, if you uniformly use 33 Newton iterations at every grid point, the MATLAB Grader may time out. You can accelerate your code by using a while loop instead of a for loop.) Script 1r-28; sigma-10; beta=8/3; 2 x1=0; y1=0; z1-0; 3 x2=sqrt(beta*(r-1)); y2=sqrt(beta* (r-1)); z2=r-1; 4 x3=-sqrt(beta* (r-1)); y3=-sqrt(beta* (r-1)); z3=r-1; 5 nx-500; nz-500; 6 xmin=-40; xmax=40; zmin=-40; zmax=40; 7 x_grid=linspace(xmin, xmax, nx); z_grid=linspace(zmin, zmax, nz); 8 [X, Z]=meshgrid(x_grid,z_grid); 9 10 % Write Newton's method using every grid point as the initial condition 11 % Perform enough iterations that every initial condition converges to a root 12 % Save the x-values of the converged roots in the matrix X 13 % To pass the assessment, every pixel in the figure must be correctly colored 14 15 % !!!!!!!!! Set initial value y=3*sqrt(2) for all values (x,z) on the grid !!!!!!!!!! 16 17 18 19 20 21 22 eps-1.e-03; 23 X1 = abs(X-x1) < eps; X2 = abs(X-x2) < eps; X3 = abs(X-x3) < eps; 24 X4=~(X1+X2+X3); 25 figure; 26 map = [1 0 0; 0 1 0; 0 0 1; 0 0 0]; colormap (map); %[red; green;blue; black] 27 X=(x1+2*X2+3*X3+4*X4); 28 image ([xmin xmax], [zmin zmax], X); set(gca, 'YDir', 'normal'); 29 xlabel('$x$', 'Interpreter', 'latex', 'FontSize', 14); 30 ylabel('$z$', 'Interpreter', 'latex', 'FontSize', 14); 31 title('Fractal from the Lorenz Equations', 'Interpreter', 'latex', 'FontSize', 16) Save My Solutions > C Reset MATLAB Documentation

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Determine the fractal that arises from using Newton's method to compute the fixed-point solutions of the Lorenz equations. 
Matlab code

Fractals from the Lorenz Equations
Determine the fractal that arises from using Newton's method to compute the fixed-point solutions of the Lorenz equations. Use the parameter values r=28, = 10 and
B = 8/3. Initial values (x,z₁) are taken on a grid in the x-z plane with always yo = 3√2. For assessment purposes, the computational grid and the graphics code will be given in
the Learner Template. To pass the assessment, every pixel in your figure needs to be colored correctly.
(Hint: Some grid points may require as many as 33 Newton iterations to converge while others may require as few as three. Unfortunately, if you uniformly use 33 Newton
iterations at every grid point, the MATLAB Grader may time out. You can accelerate your code by using a while loop instead of a for loop.)
Script>
1 r=28; sigma-10; beta=8/3;
2 x1=0; y1=0; z1=0;
3 x2=sqrt(beta* (r-1)); y2=sqrt(beta* (r-1)); z2=r-1;
4 x3=-sqrt(beta* (r-1)); y3=-sqrt(beta* (r-1)); z3=r-1;
5 nx=500; nz=500;
6 xmin=-40; xmax=40; zmin=-40; zmax=40;
7 x_grid=linspace(xmin, xmax, nx); z_grid=linspace(zmin, zmax, nz);
8 [X, Z]=meshgrid(x_grid,z_grid);
9
10 % Write Newton's method using every grid point as the initial condition
11 % Perform enough iterations that every initial condition converges to a root
12 % Save the x-values of the converged roots in the matrix X
13 % To pass the assessment, every pixel in the figure must be correctly colored
14
15 %!!!!!!!!! Set initial value y=3*sqrt(2) for all values (x,z) on the grid !!!!!!!!!!
16
17
18
19
20
21
22 eps=1.e-03;
23 X1 = abs(X-x1) < eps; X2 = abs(X-x2) < eps; X3 = abs(X-x3) < eps;
24 X4 = ~(X1+X2+X3);
25 figure;
26 map = [1 0 0; 0 1 0; 0 0 1; 0 0 0]; colormap (map); %[red; green;blue; black]
27 X=(x1+2*X2+3*X3+4*X4);
28 image ([xmin xmax], [zmin zmax], X);
29 xlabel('$x$', 'Interpreter', 'latex',
set(gca, 'YDir', 'normal');
'FontSize', 14);
30 ylabel('$z$', 'Interpreter', 'latex', 'FontSize', 14);
31 title('Fractal from the Lorenz Equations', 'Interpreter', 'latex', 'FontSize', 16)
My Solutions >
Save
C Reset
MATLAB Documentation
Transcribed Image Text:Fractals from the Lorenz Equations Determine the fractal that arises from using Newton's method to compute the fixed-point solutions of the Lorenz equations. Use the parameter values r=28, = 10 and B = 8/3. Initial values (x,z₁) are taken on a grid in the x-z plane with always yo = 3√2. For assessment purposes, the computational grid and the graphics code will be given in the Learner Template. To pass the assessment, every pixel in your figure needs to be colored correctly. (Hint: Some grid points may require as many as 33 Newton iterations to converge while others may require as few as three. Unfortunately, if you uniformly use 33 Newton iterations at every grid point, the MATLAB Grader may time out. You can accelerate your code by using a while loop instead of a for loop.) Script> 1 r=28; sigma-10; beta=8/3; 2 x1=0; y1=0; z1=0; 3 x2=sqrt(beta* (r-1)); y2=sqrt(beta* (r-1)); z2=r-1; 4 x3=-sqrt(beta* (r-1)); y3=-sqrt(beta* (r-1)); z3=r-1; 5 nx=500; nz=500; 6 xmin=-40; xmax=40; zmin=-40; zmax=40; 7 x_grid=linspace(xmin, xmax, nx); z_grid=linspace(zmin, zmax, nz); 8 [X, Z]=meshgrid(x_grid,z_grid); 9 10 % Write Newton's method using every grid point as the initial condition 11 % Perform enough iterations that every initial condition converges to a root 12 % Save the x-values of the converged roots in the matrix X 13 % To pass the assessment, every pixel in the figure must be correctly colored 14 15 %!!!!!!!!! Set initial value y=3*sqrt(2) for all values (x,z) on the grid !!!!!!!!!! 16 17 18 19 20 21 22 eps=1.e-03; 23 X1 = abs(X-x1) < eps; X2 = abs(X-x2) < eps; X3 = abs(X-x3) < eps; 24 X4 = ~(X1+X2+X3); 25 figure; 26 map = [1 0 0; 0 1 0; 0 0 1; 0 0 0]; colormap (map); %[red; green;blue; black] 27 X=(x1+2*X2+3*X3+4*X4); 28 image ([xmin xmax], [zmin zmax], X); 29 xlabel('$x$', 'Interpreter', 'latex', set(gca, 'YDir', 'normal'); 'FontSize', 14); 30 ylabel('$z$', 'Interpreter', 'latex', 'FontSize', 14); 31 title('Fractal from the Lorenz Equations', 'Interpreter', 'latex', 'FontSize', 16) My Solutions > Save C Reset MATLAB Documentation
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 4 images

Blurred answer
Knowledge Booster
Time complexity
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education