Difference between revisions of "Matlab: Simulating Brownian motion"

From Course Wiki
Jump to: navigation, search
(Created page with '{{Template:20.309}} =Introduction= This exercise shows how to simulate the motion of single and multiple particles in one and two dimensions using Matlab. You will discover some…')
 
 
(2 intermediate revisions by one user not shown)
Line 1: Line 1:
 +
<!--
 
{{Template:20.309}}
 
{{Template:20.309}}
=Introduction=
 
This exercise shows how to simulate the motion of single and multiple particles in one and two dimensions using Matlab.  You will discover some useful ways to visualize and analyze particle motion data, as well as learn the Matlab code to accomplish these tasks.  Once you understand the simulations, you can tweak the code to simulate the actual experimental conditions you choose for your study of Brownian motion of synthetic beads.  These simulations will generate the predictions you can test in your experiment. 
 
 
In each section, Matlab code shown in the box to the left is used to generate the plot or analysis shown on the right.  '''To use the code, copy it from the box on the left, launch the Matlab application,  and paste the code into the Matlab Command Window.''' If you are new to Matlab, check out the [[Intro to Matlab]] page to help you get started.
 
 
 
=Simulating Single Particle Trajectories=
 
=Simulating Single Particle Trajectories=
  
This exercise shows how to simulate the motion of a single particle in one and two dimensions .
+
This exercise shows how to simulate the motion of a single particle in one and two dimensions.
  
 
==One Dimensional Brownian Motion==
 
==One Dimensional Brownian Motion==
Line 17: Line 13:
 
The first step in simulating this process is to generate a vector of random displacements. The commands to do this are shown below. N is the number of samples to generate.
 
The first step in simulating this process is to generate a vector of random displacements. The commands to do this are shown below. N is the number of samples to generate.
  
<pre>
+
<code>
 
N = 1000;
 
N = 1000;
 
displacement = randn(1,N);
 
displacement = randn(1,N);
 
plot(displacement);
 
plot(displacement);
</pre>
+
</code>
  
 
==Distribution of Displacements==     
 
==Distribution of Displacements==     
Line 566: Line 562:
 
</pre>
 
</pre>
 
{{Template:20.309 Bottom}}
 
{{Template:20.309 Bottom}}
 +
-->

Latest revision as of 21:28, 4 June 2015