Numerical Solution to Friedmann Equation

Given an expanding universe with associated parameters that dictate how it expands, it is expected that we attempt to discuss the age of the universe and its ultimate destiny. Such calculations are unbelievably complex even for the world's largest supercomputers unless we impose all kinds of approximations and symmetries. The cosmological principle - the assumption that the universe is homogenous and isotropic at a large enough scale - needs to be employed to make the calculation tenable. Here we will take a shot at doing that. In order to discuss the possible destiny of the universe as well as its age, we need to solve the Friedmann differential equation that we derived in the last section.  While it looks like we could write it as a first order differential equation by just taking a square root, that method has problems. The main problem is that we must allow dR/dt to be either positive or negative - corresponding to either expansion or contraction of the universe - and that information is lost in taking the root.  Rather than do that, we will rearrange the equation by the following steps:

The terms are called density parameters. Specifically the term is the matter density and is the cosmological constant which is referred to as the vacuum density today.  Current estimates of the two densities are that the matter density is 0.31-0.33 and the vacuum density is 0.70-0.72.  The numbers add up to almost exactly 1.0.  Lately data has been tending toward a sum of 1.02.  You can see in the interactive graphic below, that the current best value of 1.02 implies that the universe is never going to contract.  The data indicates that the universe is a one-time event.  We are quite fortunate to be a part of it! The equation as derived above is a second order differential equation not too unlike ones we've solved before such as the quantum harmonic oscillator. To solve this equation numerically, we will feed it into GeoGebra as a pair of first order equations just as we did for the Schrödinger equation. The process in GeoGebra is:
    1. Define the necessary constants 2. Define the two first order equations 3. Solve the pair of equations while providing boundary conditions.

The Code

You know how to define constants.  There are only the two densities to be defined.  The two equations are: and  One important consideration is that we must solve the equations forward and backward from today to predict the future state of the universe and its past - all the way to its beginning. We did much the same thing for the QHO where we solved for the wave function to the right of zero and to the left of zero separately.  For the Friedmann equation we solve it starting at the present since those are conditions we know.  I used R=1 and dR/dt=1 which are correct by definition. You will notice a slider named It controls how far into the past the solution goes.  The equations will diverge when R=0, so if the curve disappears (indicating such divergence), make the slider value larger until it reappears.  If this parameter has a value of 0.34, for instance, it means that the universe actually had its beginning at 1-0.34=0.66 times the assumed current age. Therefore when astronomers mention the age of the universe it is contingent on the matter density and vacuum density - and in fact on the form of the term in the Friedmann equation that accounts for the vacuum density. Don't forget the assumptions of homogeneity and isotropy.  Furthermore, one must certainly ask the question: In whose reference frame is the age being measured? That conversation can get long and complex so I will not go into it. Some interesting scenarios to try out in the model below are the following pairs of values for the densities  
    [1,0] which represents the present total density but with no vacuum density contribution [0.6, 0] which represents 60% of the present total density and no vacuum density [0, 1] which represents no matter density and only vacuum density [0.95, 0.05] which represents 95% of the current matter density and a small vacuum density [0.30,0.70] which is approximately the measured actual values [x,y] whatever combination you wish to play around with in a what-if scenario.
A GeoGebra model of the Friedmann equation is below. Try out some of the parameter choices listed above. 

Numerical Solution of Friedmann Equation

Where is Inflation?

If you're paying attention, you probably noticed that Friedmann's equations don't include or model the concept of inflation. Inflation does not come from laws of physics, but is instead a product of the need for an explanation. It bothers physicists and cosmologists that the universe has a near uniform temperature throughout - as if those parts had once been in contact. Thus inflation was hypothesized. Another option which dives right into the present discussions among leading theoreticians is that perhaps there was no inflation. Perhaps instead, we have an incorrect sense of locality. We see evidence that nature on a small scale is nonlocal. Particles fill all space and in certain cases things seem to happen at rates that exceed light speed and instead are instantaneous action at a distance. Do an internet search on nonlocality or entanglement to read more. In any case, perhaps nonlocality does not only exist on the smallest scales but also on the largest. If true, we would need to more carefully understand the concept of spatial separation. No question that such understanding would lead to another scientific revolution perhaps in excess of the one that came with quantum theory and relativity at the onset of the 20th century.