Brownian motion is a physical phenomenon

Assignment Help C/C++ Programming
Reference no: EM13161728

Brownian motion is a physical phenomenon which can be observed, for instance, when a small particle is immersed in a liquid. One method for describing this motion (in one -dimension) involves modelling the particles as "jumping" once per microsecond a random distance. The Brownian model predicts how far the particle moves after waiting a certain amount of time. Because the model is based onrandom numbers , we are interested in the average distance the particle moves. Write a program that will simulate Brownian motion by doing ALL of the following: 1) Ask the user how many trials to run. 2) Run the requested number of trials. For each trial you will si mulate the Brownian motion of one particle over 10 microseconds (10 jumps). The particle should jump up to 1 nanometer to the left or right with each jump . 3) Calculate the average absolute value of the distance that the particle has moved. 4) Print the average absolute value of the distance to the screen. Hints: 1) You will need rand() from to generate random numbers to simulate the jum ping. Note that rand() generates random integers, but for Brownian motion the jumps must be floating point values. 2) The code is easiest if you consider negative numbers as movement to the left and positive numbers as movement to the right. Then you can simulate a jump by generating a random number between- 1 and 1. The position of the particle is simply the sum of all the jumps. 3) You can use abs() from to take the absolute value of the final distance. Do not take the absolute value of each jump or you will lose the left/right information. 4 ) You will probably need two loops. One to loop thr ough each trial, and one to loop through each of the 10 jumps. 5 ) Because we are taking the absolute value of the final distance, the average displacement of the particles after 10 jumps should not be 0. 6 ) Because the code is based on a random number generator, you should get a slightly different answer each time you run the code. 

Reference no: EM13161728

Questions Cloud

In psuedocode, design an application : In psuedocode, design an application that has an array of at least 20 integers. It should call a module that uses the sequential search algorithm to locate one of the values
Least number of comparisons needed : What is the least number of comparisons needed to sort an array of 6 numbers, in the worst case, using any sorting algorithm that sorts with binary comparisons? Explain
20 integers saved in a file called "data.txt" : There are 20 integers saved in a file called "data.txt" (just a random txt file with some numbers) All integers are in the range from 1 to 10
All the new strings generated : Explain why, if on some round, all the new strings generated for any syntactic category are longer than s, and s has not already been generated for L(), then s cannot ever be put in L(). Hint: Use Exercise 11.3.5.
Brownian motion is a physical phenomenon : Brownian motion is a physical phenomenon which can be observed, for instance, when a small particle is immersed in a liquid.
Write a program code to compute and build a table of reynold : Write a program code to compute and build a table of Reynolds numbers at flow velocities varying from 100 to 1000 ft/sec (at increments of 100)
Method called printpowersof2 that accepts a maximum number : Write a method called printPowersOf2 that accepts a maximum number as an argument and prints each power of 2 from 20 (1) up to that maximum power, inclusive. For example, consider the following calls: printPowersOf2(3); printPowersOf2(10)
Create a class named gamer that has a field for name : Create a class named Gamer that has a field for name(string) and a field for points(int).
Federal government regulates labels : The federal government regulates labels, warranties, and consumer products. Without government regulation, what abuses are likely to occur?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd