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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

sendPlotData ( ” f r e q ” , f r e q ) ; // rpm// sendPlotData (” time ” , t1 ) ;// sendPlotData (” count ” , count ) ;// sendPlotData (” f l a g ” , f l a g ) ;}// f l o a t v o l t a g e = sensorValue ; // ∗ ( 5 . 0 / 1 0 2 3 . 0 ) ; // s c a l e read v a l u e// S e r i a l . p r i n t l n ( v o l t a g e ) ;// sendPlotData (” v o l t a g e ” , v o l t a g e ) ;void sendPlotData ( S t r i n g seriesName , f l o a t data ){S e r i a l . p r i n t ( ”{” ) ;S e r i a l . p r i n t ( seriesName ) ;S e r i a l . p r i n t ( ” ,T, ” ) ;S e r i a l . p r i n t ( data ) ;S e r i a l . p r i n t l n ( ”}” ) ;}Listing 3: ”ODE Simulation”% BLINKING VORTEX FLOW% Simulate the two coupled d i f f e r e n t a l e q u a t i o n s f o r a b l i n k i n g v o r t e x% f l o w%% x ’ = −Ay/( xs ˆ2 + y ˆ2)% y ’ = Axs ˆ2/( xs ˆ2 + y ˆ2)%% xs = {% x − b i f 0 < t < T/2% x + b i f T/2 < t < T%% S o l v i n g Notes : Use ode45 , Solve f o r each l i t t l e i n t e r v a l , use f i n a l% c o n d i t i o n s f o r each next i n i t i a l c o n d i t i o nfunction s e n i o r o d e f u l l a n i m a t i o n ( )% Main Driver Function% I n i t i a l c o n d i t i o n st o t a l t i m e = [ 0 , 2 0 . 5 ] ;i n i t i a l p o s = [ 1 ; 1 ] ;g l o b a l A b ;A = 1 ; b = . 5 ;count = 1 ;f o r i =1:517

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

Saved successfully!

Ooh no, something went wrong!