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

  The use of decision logic

The use of decision logic is one of the major concepts of computer programming.

  Implement a graphics system that has classes

Implement a graphics System that has classes for various figures: rectangles, squares, triangles and circles. A rectangle has data members height, width, color , and center point. A square has center point and an edge and color

  Program to output value of tenth component of array

Write a C++ statements to perform the following: Set value of fourth component of array alpha to three times  value of eight component minus 57.

  Stores a series of numbers in a binary tree.

Queue Converter, Write a program that stores a series of numbers in a binary tree. Then have the program insert the values into a queue in ascending order. Dequeue the values and display them on the screen to confirm that they were stored in the prop..

  Prepare a program for a retail-mart company

Prepare a program for a company Retail-Mart.

  State private portion of class to model the item

In c++ state the private portion of a class to model the given item: a class Date for dates consisting of a month, day and year. a class PhoneNumber for a telephone numbers consisting of area code, local exchange, and number.

  Develop a class airborne location

develop a class AirborneLocation that represents the location of airplanes with respect to a reference radar location. Each AirborneLocation object should include data member for aircraftID (integer),

  C++ programming uml diagrams

The goal of this lab is to better familiarize you with polymorphism and the factory design pattern, two key components in Assignment

  Create a template class

Create a template class, SVector, that implements a constructor

  Implementation of sorting technique

Implementation of sorting technique

  Represent an instruction supported by simpletron

Implementation contains a Simpletron class and several supporting Instruction classes

  Insert the missing code in the c program

You are to insert the missing code in the C program given for combinational equivalence checking. This program will interface with the CUDD package and will parse netlist files in ISCAS85 circuit format. Next, BDDs will be created for each circuit an..

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