13.07.2015 Views

Project paper - The Department of Physics and Astronomy

Project paper - The Department of Physics and Astronomy

Project paper - The Department of Physics and Astronomy

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

% S o l v e f i r s t s e t [ Function f ( t ) = x ( t ) , y ( t ) ][ t , f ]=ode45 ( @vortex1 , t o t a l t i m e , i n i t i a l p o s ) ;f o r j =1: s i z e ( f , 1 )p l o t ( f ( j , 1 ) , f ( j , 2 ) , ’ o ’ ) ;hold a l l ;M( count ) = getframe ;count = count +1;endf i n a l p o s =[ f ( end , 1 ) , f ( end , 2 ) ] ;% S t a r t second s e t with f i r s t i n i t i a l c o n d i t i o n s[ t , f ]=ode45 ( @vortex2 , t o t a l t i m e , f i n a l p o s ) ;endf o r k=1: s i z e ( f , 1 )p l o t ( f ( k , 1 ) , f ( k , 2 ) , ’ o ’ ) ;hold a l l ;M( count ) = getframe ;count = count +1;endi n i t i a l p o s = [ f ( end , 1 ) , f ( end , 2 ) ] ;endmovie (M, 1 , 1 0 0 ) ;function dydt=v o r t e x 1 ( t , y )% Vortex 1 ( r i g h t )% y (1) = x , y (2) = yg l o b a l A b ;dydt =[(A∗(−y ( 2 ) ) ) / ( ( y (1)−b )ˆ2 + y ( 2 ) ˆ 2 ) ; (A∗( y (1)−b ) ) / ( y (2)ˆ2+( y (1)−b ) ˆ 2 ) ] ;endfunction dydt=v o r t e x 2 ( t , y )% Vortex 2 ( l e f t )% y (1) = x , y (2) = yg l o b a l A b ;dydt =[(A∗(−y ( 2 ) ) ) / ( ( y (1)+b )ˆ2 + y ( 2 ) ˆ 2 ) ; (A∗( y (1)+b ) ) / ( y (2)ˆ2+( y (1)+b ) ˆ 2 ) ] ;end18

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!