(MATLAB) Fractals from the Lorenz Equations Determine the fractal that arises from using Newton's method to compute the

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

(MATLAB) Fractals from the Lorenz Equations Determine the fractal that arises from using Newton's method to compute the

Post by answerhappygod »

(MATLAB) Fractals from the Lorenz Equations
Determine the fractal that arises from using Newton'smethod to compute the fixed-point solutions of the Lorenzequations. Use the parameter values r = 28, = 10, = 8/3. Initialvalues are taken on a grid in the x-z plane with always y0 = 3 2.For assessment purposes, the computational grid and the graphicscode will be given in the Learner Template. To pass the assessment,evert pixel in your figure needs to be coloredcorrectlly.
(Hint: Some gird points may require as many as 33 Newtoniterations to converge while others may require as few as three.Unfortunately, if you uniformly use 33 newton iterations at everygrid point, the MATLAB grader may time out. YOu can accelerate yourcode by using a while loop instead of a for loop.)
Matlab Fractals From The Lorenz Equations Determine The Fractal That Arises From Using Newton S Method To Compute The 1
Matlab Fractals From The Lorenz Equations Determine The Fractal That Arises From Using Newton S Method To Compute The 1 (38.32 KiB) Viewed 61 times
Matlab Fractals From The Lorenz Equations Determine The Fractal That Arises From Using Newton S Method To Compute The 2
Matlab Fractals From The Lorenz Equations Determine The Fractal That Arises From Using Newton S Method To Compute The 2 (145.22 KiB) Viewed 61 times
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) 32 Assessment: Test red pixel values Test green pixel values Test blue pixel values ▶ Run Script Submit
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, o = 10 and ß = 8/3. Initial values (x,zo) 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] Save My Solutions > Reset MATLAB Documentation
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply