Thursday 1 September 2016

Simulation with Excel Series: Final Lab Funtime!

Title: Simulate the path (Random Walk) of a drunkard.

Basic Theory:
In this lab, we try to simulate the motion of a drunkard in two dimensions, which depicts Random Walk. A drunkard can move in any direction without proper thought and we try to simulate this process using a random function which determines the next step of the drunkard. It is an example of Markov Chain because the prior motion of the drunkard does not influence its current motion.  

Procedure:
For simulation of drunkard’s random walk, we first specify an initial position with randomly distributed values of motion in X and Y directions (dx and dy). These will characterize that the drunkard moves randomly in a two-dimensional space. This can be described using a random function in Excel as,

dx =1-2*RAND()
dx =1-2*RAND()

The next values of X and Y are calculated as
Xi = Xi-1 + dxi
Yi = Yi-1 + dyi

This formula shows that the points will be plotted with respect to their last values, and the values prior to that do not make direct contributions. Hence, we can observe the Markov property in Brownian motion.

After that, we generate a Scatter plot of the X and Y values and see the drunkard’s motion. We can experiment with values of dx and dy to see the changes in the behavior of particle motion.

Thus, we were able to visualize a drunkard’s random walk using random distribution and assuming Markov property.

Sample Data:
Table1: Sample Data for drunkard’s motion is
dx
dy
X
Y
0.838546
-0.32853
0
0
0.673706
-0.94962
0.673706
-0.94962
-0.59668
0.811554
0.077027
-0.13807
-0.59386
0.346488
-0.51683
0.208419
0.78065
0.295288
0.26382
0.503707
-0.16151
0.428357
0.102307
0.932064
-0.11278
0.908384
-0.01047
1.840448
-0.17453
0.235414
-0.18501
2.075862
-0.76316
-0.10395
-0.94817
1.971913
-0.44464
-0.53974
-1.3928
1.432171

Output:

Below are the graph plots for drunkard’s motion up to 300 steps:


Conclusion:
Hence, we could see that the Drunkard’s motion was consistent with the random values of dx and dy. The more the values of dx and dy deviate in each new step of the drunkard, the obtained curve gets more zig-zag.

12 comments:

  1. Nice information and keep going more
    Sanjary Kids is one of the best play school and preschool in Hyderabad,India. Give your child the best preschool experience by choosing the best playschool of Hyderabad in Abids. we provide programs like Play group,Nursery,Junior KG,Senior KG,and provides Teacher Training Program.
    early childhood teacher training course in hyderabad

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. This comment has been removed by the author.

    ReplyDelete
  5. This comment has been removed by the author.

    ReplyDelete
  6. Good blog posts information I liked it

    Sanjary Academy is the best Piping Design institute in Hyderabad, Telangana. It is the best Piping design Course in India and we have offer professional Engineering Courses like Piping design Course, QA/QC Course, document controller course, Pressure Vessel Design Course, Welding Inspector Course, Quality Management Course and Safety Officer Course.
    Piping Design Course
    Piping Design Course in Hyderabad ­
    Piping Design Course in India­

    ReplyDelete
  7. Excellent explained the topic clearly and understandable

    Sanjary Academy provide pressure vessel design, quality management system course piping design course, qa/qc course and document controller course.
    Welding Inspector Course
    Safety officer course
    Quality Management Course
    Quality Management Course in India

    ReplyDelete
  8. DU BCOM TimeTable 2020
    MU BCOM TimeTable 2020
    MDSU BCOM TimeTable 2020
    I think you did an awesome job explaining it. Sure beats having to research it on my own. Thanks

    ReplyDelete
  9. Here is the site(bcomexamresult.in) where you get all Bcom Exam Results. This site helps to clear your all query.
    BA 3rd year Result 2020
    ju BCOM 3rd Year Result 2020

    ReplyDelete
  10. I think you did an rajasthan university bcom final year result awesome job explaining it. Sure beats having to research it uniraj ba 3rd year result on my own. Thanks

    ReplyDelete
  11. Post is really impressive... Thanks for the data update and waiting for your new updates.
    Need of Android
    Importance of Android

    ReplyDelete

Was this post helpful? Ask any questions you have, I will try to answer them for you.