Abbildungen - Kapitel 4

	options = odeset('RelTol',1e-10);
	xx = [pi+0.1  0.1];
	[t,y] = ode45('pendellin_f',[0,2], xx, options);
	plot(t,y(:,1),'k--','linewidth',2); hold on;
	[t,y] = ode45('pendelnl_f',[0,2], xx, options);
	plot(t,y(:,1),'k-','linewidth',2);
	plot([0,max(t)],[pi,pi],'k','linewidth',2,'Color',[0.6 0.6 0.6]);
					
	options = odeset('RelTol',1e-10);
	xx = [pi+0.01  0.1];
	[t,y] = ode45('pendellin_f',[0,2], xx, options);
	plot(t,y(:,1),'k--','linewidth',2); hold on;
	[t,y] = ode45('pendelnl_f',[0,2], xx, options);
	plot(t,y(:,1),'k-','linewidth',2);
	plot([0,max(t)],[pi,pi],'k','linewidth',2,'Color',[0.6 0.6 0.6]);
					
	options = odeset('RelTol',1e-10);
	xx = [pi+0.001  0.1];
	[t,y] = ode45('pendellin_f',[0,2], xx, options);
	plot(t,y(:,1),'k--','linewidth',2); hold on;
	[t,y] = ode45('pendelnl_f',[0,2], xx, options);
	plot(t,y(:,1),'k-','linewidth',2);
	plot([0,max(t)],[pi,pi],'k','linewidth',2,'Color',[0.6 0.6 0.6]);
					
	inivals = [[pi+0.1;  0.1], [pi-0.1; -0.1], [pi+0.0; 0.2], [pi+0.0; -0.2]];
	ttn = [0,10]; ttnm= [0,-10]; ttl = [0,5]; ttlm= [0,-5];
	options = odeset('RelTol',1e-10);
	s = size(inivals);
	figure;	hold on;
	for i=[1:s(2)]
	  xx = inivals(:,i);
	  [t,y] = ode45('pendellin_f',ttl, xx, options);
	  plot(y(:,1),y(:,2),'--','linewidth',2,'Color',[0.6 0.6 0.6]);
	  [t,y] = ode45('pendellin_f',ttlm, xx, options);
	  plot(y(:,1),y(:,2),'--','linewidth',2,'Color',[0.6 0.6 0.6]);
	  [t,y] = ode45('pendelnl_f',ttn, xx, options);
	  plot(y(:,1),y(:,2),'k-','linewidth',1);
	  [t,y] = ode45('pendelnl_f',ttnm, xx, options);
	  plot(y(:,1),y(:,2),'k-','linewidth',1);
	end;
	axis([pi-4 pi+4 -8 8])
					



→ Zurück zur Homepage www.dgl-buch.de

© 2008 Lars Grüne, Oliver Junge