All these disappear in the scaled version of the problem if we start the motion from rest. We then multiply the length of the time interval considered by the population size to obtain the total number of new individuals, btN. The first step is to derive a formula for increasing the investment at a time.
Nevertheless, with a large number of atoms, N, one can view the process as deterministic and calculate the average behavior of the decay. A basic model assumption is that the conversion of the atoms of the original type in a small time interval is proportional to N, so that. If each atom survives independently of the others, and the probability of survival is the same for each atom, we do not have a Bernoulli trial, known as a binomial experiment from probability theory.
The probability P .N /that N out of the N0atoms survived at time is then given by the well-known binomial distribution. Our important finding here is that the ODE model captures the average behavior of the underlying stochastic model. In a small time interval, some of the molecules of type A are converted into molecules of B.
A Biochemical Reaction
Spreading of Diseases
A fraction of these, ˇtSI, will actually be encountered and the infected will succeed in infecting susceptibles, where ˇ is a parameter to be estimated empirically. It follows from section 4.5.4 that parameter 1 is interpreted as the average waiting time to leave category I, i.e., the average length of the illness. Typical diseases that can be simulated by the SIR model and its variants are measles, smallpox, influenza, plague, and HIV.
Predator-Prey Models in Ecology
To model how many people are infected in a small time interval, we reason as with reactions in Sect.4.6. The rise is proportional to H and the constant of proportionality is proportional tot because doubling the interval will double the rise. All prey and predators can form LH pairs in total (assuming all individuals meet by chance).
A small fraction of such encounters, over a period of time, end with the predator eating the prey. The amount of prey eaten is btLH, but only a fractiondtLH of this amount contributes to the growth of the predator population.
Decay of Atmospheric Pressure with Altitude .1 The General Model
Multiple Atmospheric Layers
Simplifications
Compaction of Sediments
If we assume that the volume of sediment remains constant throughout time, we have the initial volume,RL1;0. L11dz, where is the depth of the bottom of the sediment in the current configuration. After solving for1 as a function of z, we can then find the original thicknessL1;0 of the sediment from the equation.
In hydrocarbon exploration it is important to know 1;0 and the compaction history of the different layers of sediments.
Vertical Motion of a Body in a Viscous Fluid
- Overview of Forces
- Equation of Motion
- Terminal Velocity
- A Crank–Nicolson Scheme
- Physical Data
- Verification
- Scaling
Newton's second law of motion applied to the body states that the sum of these forces must be equal to the mass of the body times its acceleration in the vertical direction. From kinematics in physics we know that the acceleration is the time derivative of the velocity:a Ddv=dt. A small rewriting of this equation is useful: We express mas%bV, where%b is the density of the body, and we divide by the mass to get.
An interesting aspect of (4.42) and (4.45) is whether it will approach a final constant value, the so-called terminal velocityevT, as t. Both governing equations, the Stokes drag model (4.42) and the quadratic drag model (4.45), can be easily solved by the Forward Euler scheme. 2.jvnC1jvnC1C jvnjvn/Cb : (4.46) The first term on the right side of (4.46) is the arithmetic mean ejvjv estimated at the time levelsandnC1.
1Ct anC12jvnj: (4.48) Using a geometric mean instead of an arithmetic mean in the Crank–Nicolson scheme is an attractive method for avoiding a nonlinear algebraic equation when discretizing a nonlinear ODE. For significant vertical displacements in the atmosphere it should be taken into account that air density varies with height, see section 4.9. To calculate the density entering bnC12 we must also calculate the vertical position z.t /of the body.
To verify the program, one can assume a heavy body in the air, so that the force Fb can be neglected, and further assume a small speed, so that the air resistance Fd. The motion then leads to velocityv.t /Dv0gt, which is linear int and should therefore be rendered to machine precision (eg tolerance1015) by any implementation based on the Crank–Nicolson or Forward Euler schemes. Another verification, but not as powerful as the one above, can be based on calculating the terminal velocity and comparing with the exact expressions.
As always, the method of constructed solutions can be used to test the implementation of all the terms in the governing equation, but then the solution generally has no physical meaning. Using scaling, as described in Section 4.1, will reduce the need to estimate values for seven parameters for the linear case down to choosing a single value of a single dimensionless parameter.
Viscoelastic Materials
Decay ODEs from Solving a PDE by Fourier Expansions Suppose we have a partial differential equation
By introducing u for " and treating .t / as a given function, we can write the Kelvin–Voigt model in our standard form. These ODE problems are independent of each other so that we can solve one problem at a time Remark Since we depend on and the stability of the Forward Euler scheme requires 1, we get that ˛1L22k2 for this scheme.
Normally quite large values of k are required to accurately represent the given functions I and f, so that t in the Forward Euler scheme must be very small for these large values of k. Therefore, the Crank-Nicolson and Backward Euler schemes, which allow for larger t without any growth in the solutions, are more popular choices when creating time-stepping partial differential equation algorithms of the type considered in this example.
Exercises
Radioactive decay of Carbon-14
Derive schemes for Newton’s law of cooling
Implement schemes for Newton’s law of cooling
Find time of murder from body temperature
Simulate an oscillating cooling process
Simulate stochastic radioactive decay
Radioactive decay of two substances
Simulate a simple chemical reaction
Simulate an n -th order chemical reaction
Use these properties in the function in b) to do a partial verification of the solution at each time step. d) Simulate a case with T D8,˛D1:5andˇD1, and two values: 0.9 and 0.1.
Simulate spreading of a disease
Simulate predator-prey interaction
Using the initial population H.0/DH0 of H has scale for H and L, and let the time scale be 1=.bH0/. b) Implement the scale model from a). An alternative scale is to make the ODEs as simple as possible by introducing separate scales Hc and Lc for H and L respectively. FitHc, Lc, and the time scale are such that there are as few dimensionless parameters as possible in the ODEs.
Simulate the pressure drop in the atmosphere
Make a program for vertical motion in a fluid
A solution that is linear int will also be an exact solution of the discrete equations in many problems. Show that this is true for linear feature (by adding a source term that depends on ) but not for quadratic feature because of the geometric mean approximation. Use the method of manufactured solutions to add a source term in the discrete quadratic feature equations so that a linear function is often a solution.
Add a test function to check that the linear function is reproduced to machine precision in the case of both linear and quadratic drag. The driving force is the driving force here, but the resistance will be considerable and the other forces balance out after a short time. If you choose functions, create a function solver that takes all the input data in the problem as arguments and returns the velocity (as a mesh function) and the time mesh.
In the case of a class-based implementation, introduce a problem class with the physical data and a solver class with the numerical data and a solver method that stores the velocity and the mesh in the class. Allow for a time-dependent area and drag coefficient in the formula for the drag force. Fit a source term, as in the method of manufactured solutions, such that a linear function of t is a solution of the discrete equations.
Make a test function to check if the convergence rate is correct. e) Calculate the drag force, gravitational force and buoyancy force as a function of time. Tip You can create a function forces(v, t, plot=None) that returns the forces (as grid functions) int and displays the plot on the screen and also saves it to a file with the name stored in vplotifplotis notNone or can extend the solver class by calculating the forces and include force drawing in the visualization class. f) Calculate the speed of the parachute in free fall before the parachute opens. At time tp, the parachute opens and the drag coefficient and cross-sectional area change dramatically.
The drag coefficient for an open parachute can be taken as 1.8, but set using the known value of the typical termination velocity reached before landing: 5.3 m=s. One can take the drag coefficient as a piecewise constant function with an abrupt change attp.
Formulate vertical motion in the atmosphere
Use the fabricated solutions method in combination with the computational convergence rate to verify the code. Air density decreases with altitude, but can be considered constant, 1 kg = m3, for altitudes relevant to skydiving (0–4000 m). The next task is to simulate a skydiver during free fall and after the parachute opens.
Hint Following Meade and Struthers [11], you can set the cross-sectional area perpendicular to the motion to 44 m2 when the parachute is open. Assume that it takes 8 s to increase the area linearly from the original value to the final value. The parachute is usually released after tpD60s, but larger values can often be used to make the plots more illustrative.
From the principle that velocity is the derivative of position, we have this. Explain in detail how the governing equations can be discretized using Forward Euler and Crank–Nicolson methods.
Simulate vertical motion in the atmosphere
Simulate fortune growth with random interest rate
Plot the mean curve along with the mean plus one standard deviation and the mean minus one standard deviation. The mean and standard deviation of the fortune are calculated most efficiently by using two accumulation arrays, sum_u andsum_u2, and performingsum_u += u andsum_u2 += u**2after each experiment.
Simulate a population in a changing environment
Experiment with these and other parameters to illustrate the interplay between growth and decay in such a problem.
Simulate logistic growth
Simulate the deformation of a viscoelastic material