Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Create a movie (Using Matlab) of the Lorenz attractor. Modify the animate.m scri

ID: 3576547 • Letter: C

Question

Create a movie (Using Matlab) of the Lorenz attractor. Modify the animate.m script from Lecture 4 to create a movie of the Lorenz attractor similar to the movie embedded on slide 11 of the Lecture 26 notes. To do this, look up the documentation on the MATLAB VideoWriter built-in utility. You should create a movie in either the y1-y2, y2-y3, or y3-y1 planes (your choice, see the embedded movie in the Lecture 26 Notes for inspiration, but note that the example movie labels the axes x,y,z instead of y1, y2, y3 - you do not need to label or show the axes in your movie). Solve the system of equations using a suitable integrator (Lecture 25). For every movie frame, render the past history of the system as a point trace, and the present state marked by a larger dot. Save the movie as an .avi file and upload it on BB. However, to facilitate grading, also include some snapshots of the movie as still images in the Word or PDF document.

You have several choices and complete creative freedom how to implement this. One way would be to pre-compute the solutions as is done e.g. on slide 12 of Lecture 26 and then iterate through the solutions in a loop, capturing video frames from the saved solutions.

Image is the movie embedded on slide 11 of lecture 26, the ball follows the paths:

animate.m is the following code:

clc,clf,clear
g=9.81; theta0=45*pi/180; v0=5;
t(1)=0;x=0;y=0;
plot(x,y,'o','MarkerFaceColor','b','MarkerSize',8)
axis([0 3 0 0.8])
M(1)=getframe;
dt=1/128;
for j = 2:1000
t(j)=t(j-1)+dt;
x=v0*cos(theta0)*t(j);
y=v0*sin(theta0)*t(j)-0.5*g*t(j)^2;
plot(x,y,'o','MarkerFaceColor','b','MarkerSize',8)
axis([0 3 0 0.8])
M(j)=getframe;
if y<=0, break, end
end
pause
movie(M,1)

Butterfly Effect and Chaos Lorenz attractor: 10(y2 -yi); A system of three equations discovered by meteorologist Edward Lorenz in 1961 that isvery sensitive to initial values This discovery is credited with starting chaos theory http://en.wikipedia.org/wiki/ Butterfly effect

Explanation / Answer

Here is the code...

function loren3
clear;clf
g=9.81; theta0=45*pi/180; v0=5;
[t,u] = ode45(@lor2,[0,100],u0);
N = find(t>10); v = u(N,:);
x = v(:,1);
y = v(:,2);
plot(x,y);
view(90,90)
M(1)=getframe;
dt=1/128;
for j = 2:1000
t(j)=t(j-1)+dt;
x=v0*cos(theta0)*t(j);
   y=v0*sin(theta0)*t(j)-0.5*g*t(j)^2;
plot(x*t(j),y*t(j),'o','MarkerFaceColor','b','MarkerSize',8)
M(j)=getframe;
if y<=0, break, end
end
pause
movie(M,1)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote