Hmmmmm soon to revise


-

—————————————————————————————–

99/30/08
9/30/08)

>> y_int=0.1;
>> [t,y]=euler(‘test_example’,[0.1,9.0],y_int,200);
>> y_init=[.9,1,1.1];
>> [t,y]=euler_system(‘lorenz_system’,[0.0,20.0],y_init,1000);
>> [t,y]=euler_system(‘lorenz_system’,[0.0,20.0],y_init,2500);
>> [t,y]=euler_system(‘lorenz_system’,[0.0,20.0],y_init,3000);
>> [t,y]=euler_system(‘lorenz_system’,[0.0,20.0],y_init,500);
>> [t,y]=euler_system(‘lorenz_system’,[0.0,20.0],y_init,800);
>> [t,y]=euler_system(‘lorenz_system’,[0.0,20.0],y_init,700);
>> [t,y]=euler_system(‘lorenz_system’,[0.0,20.0],y_init,750);
>> [t,y]=euler_system(‘lorenz_system’,[0.0,20.0],y_init,799);
>> [t,y]=euler_system(‘lorenz_system’,[0.0,20.0],y_init,800);
>> [t,y]=euler_system(‘lorenz_system’,[0.0,20.0],y_init,850);
>> [t,y]=euler_system(‘lorenz_system’,[0.0,20.0],y_init,830);
>> [t,y]=euler_system(‘lorenz_system’,[0.0,20.0],y_init,810);
>> [t,y]=euler_system(‘lorenz_system’,[0.0,20.0],y_init,805);
>> [t,y]=euler_system(‘lorenz_system’,[0.0,20.0],y_init,1500);
>> plot(t,y)
>> [t,y]=euler_system(‘lorenz_system’,[0.0,20.0],y_init,1500);
>> [t,y]=euler_system(‘lorenz_system’,[0.0,20.0],y_init,1000);
>>————————————————————————————

we created m files

g.m

function xdot = g(t,x)

xdot = zeros(3,1);

sig = 10.0;

rho = 28.0;

bet = 8.0/3.0;

xdot(1) = sig*(x(2)-x(1));

xdot(2) = rho*x(1)-x(2)-x(1)*x(3);

xdot(3) = x(1)*x(2)-bet*x(3);

created lorenze_demo.m

function lorenz_demo(time)

% Usage: lorenz_demo(time)

% time=end point of time interval

% This function integrates the lorenz attractor

% from t=0 to t=time

[t,x] = ode45(‘g’,[0 time],[1;2;3]);

disp(‘press any key to continue…’)

pause

plot3(x(:,1),x(:,2),x(:,3))

print -deps lorenz.eps

code for the lorenz attractor animated

function yprime = lorenz_system ( t, y )

function createfigure(XData1, YData1, ZData1, XData2, YData2, ZData2, XData3, YData3, ZData3)
%CREATEFIGURE(XDATA1,YDATA1,ZDATA1,XDATA2,YDATA2,ZDATA2,XDATA3,YDATA3,ZDATA3)
% XDATA1: line xdata
% YDATA1: line ydata
% ZDATA1: line zdata
% XDATA2: line xdata
% YDATA2: line ydata
% ZDATA2: line zdata
% XDATA3: line xdata
% YDATA3: line ydata
% ZDATA3: line zdata

% Auto-generated by MATLAB on 07-Oct-2008 11:39:34

% Create figure
figure1 = figure(‘NumberTitle’,'off’,'Name’,'Lorenz Attractor’,…
‘Color’,[0.35 0.35 0.35]);

% Create axes
axes1 = axes(‘Parent’,figure1,’ZTick’,zeros(1,0),’ZColor’,[1 1 1],…
‘YTick’,zeros(1,0),…
‘YColor’,[1 1 1],…
‘XTick’,zeros(1,0),…
‘XColor’,[1 1 1],…
‘Position’,[0.05 0.1 0.75 0.95],…
‘ColorOrder’,[1 1 0;1 0 1;0 1 1;1 0 0;0 1 0;0 0 1;0.75 0.75 0.75],…
‘Color’,[0 0 0]);
% Uncomment the following line to preserve the X-limits of the axes
% xlim([0 40]);
% Uncomment the following line to preserve the Y-limits of the axes
% ylim([-35 10]);
% Uncomment the following line to preserve the Z-limits of the axes
% zlim([-10 40]);
view([-37.5 30]);
hold(‘all’);

% Create xlabel
xlabel(‘X’,'Color’,[1 1 1]);

% Create ylabel
ylabel(‘Y’,'Color’,[1 1 1]);

% Create zlabel
zlabel(‘Z’,'Color’,[1 1 1]);

% Create line
line(XData1,YData1,ZData1,’Parent’,axes1,’MarkerSize’,25,’Marker’,’.’,…
‘Color’,[1 0 0]);

% Create line
line(XData2,YData2,ZData2,’Parent’,axes1,’Color’,[1 1 0]);

% Create line
line(XData3,YData3,ZData3,’Parent’,axes1,’Color’,[0 0 1]);

% uicontrol currently does not support code generation, enter ‘doc uicontrol’ for correct input syntax
% In order to generate code for uicontrol, you may use GUIDE. Enter ‘doc guide’ for more information

% uicontrol(…);

% uicontrol currently does not support code generation, enter ‘doc uicontrol’ for correct input syntax
% In order to generate code for uicontrol, you may use GUIDE. Enter ‘doc guide’ for more information

% uicontrol(…);

% uicontrol currently does not support code generation, enter ‘doc uicontrol’ for correct input syntax
% In order to generate code for uicontrol, you may use GUIDE. Enter ‘doc guide’ for more information

% uicontrol(…);

% uicontrol currently does not support code generation, enter ‘doc uicontrol’ for correct input syntax
% In order to generate code for uicontrol, you may use GUIDE. Enter ‘doc guide’ for more information

% uicontrol(…);

% uicontrol currently does not support code generation, enter ‘doc uicontrol’ for correct input syntax
% In order to generate code for uicontrol, you may use GUIDE. Enter ‘doc guide’ for more information

% uicontrol(…);

I have been trying to import our data and our images into a post. First from a page that I have been saving and adding to this entire project – they did not insert into the post – and now they are not in the page either. So, I then tried to add the media from my media library – again just a bunch of code appeared in the post. Hopefully I can figure this out soon. Just in case it takes longer than expected to find the data – I decided to write a short summary – I know that I could probably copy and paste from Matt’s Blog – I was there in class and you answered many questions along the way – but, I really want to try to figure it out on my own first.
I learned a lot from this project. It was a lot of fun and very interesting. I got answers a long the way to my questions … and discovered new questions that I am still looking for the answers to. We started out by following the guide and the example on the class web page.
We decided to start with the Lorenz system. We followed the example that was given. We used Excel to calculate our data using Euler’s method. It was very nice to use the computer because I got to see how different values for Delta affected the graph. Even the excel graphs were noticeably different. The computer just took seconds – so, it was easy to just play with the numbers and see what happens visually very quickly in a colorful way.
We had to work through some glitches with Excel and Matlab – when we tried to enter 8/3 into the cell – it gave us the date – we ended up just using the calculator feature and using 2.66.
Matlab is getting easier for me to navigate – finally :-) We did have some difficulties with things like loosing the command prompt and missing quotations. But, definitely not getting stuck as much.
Once we entered the code we got some really nice pictures of our Lorenz system. Again, I was curious about the different values for Delta and experimented at changing the viewpoint of the graphs too. How the system looked depended also on your viewpoint. A powerful connection to this – I learned later. I enjoyed being able to move the axis’.
I originally thought that we were basically done with the project early – but, I read through the example one more time. And, I noticed that there was one sentence about the system changing when P=99.96 so, I realized we were not finished – we needed to gather more data. The night before I had been doing some reading and researching on-line for a research topic and stumbled upon a research project about knots – that’s when everything seemed to connect and click for me. I had read about knots before – but, had “not” connected that – our system seemed to “Knot” ! I was really confused when we got the plot of (as Matt descibed ) a weird kind of “smooshed hershey kiss” shape. I thought I remembered from the lecture the first day of the project that when you start at a point in the system and follow it through – it doesn’t intersect its previous path – so, when I saw the graph starting and ending at the same point I got confused. And then I laughed when I learned it was the definition of a Knot. When I saw a 3D image of a knot it was very interesting – but it never appeared to intersect. Ha – since it didn’t have a starting and ending point – duh – ending and starting pt. the same!. A very basic simple concept – so, it was quite funny that it seemed like a light switch moment – the 2D connected with the 3D visually for me.
As we have learned that Euler’s method is not very accurate for non-linear systems – a very small error up front can grow to a very large margin of error at the end – kind of like the shape of a cornicopia – small (margin of error) beginning or opening – large(margin of error) ending or opening. I was also able to visually get a better understanding because of this lab. The 3D picture of the Lorenz system knotted – gave a width to the line ( but since 3D – more like a tube). So, I was able to see that we might think that we are really close with the approximation – but, not close enough – not only in 2D, but also in 3D.
So, in conclusion – I got to visually see why it is difficult to get an exact answer to a non-linear equation. And, exactly what all the math is doing and applications to the math that we are learning.

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.