CoCalc Public Filestmp / Project 1 Solution.sagews
sphere()

3D rendering not yet implemented
2+3

5
Art Kazmierczak

Math 337 Project 1

Modelling Oil Production

Spring 2014

In this project we will model US and world crude oil production using a logistic model, where the carrying capacity represents the

total possible recoverable crude oil.

Some of our parameter values will come from the data presented in Figure 1 below. The values in the table are in millions of barrels.

Year | US Oil | World Oil | Texas Oil

1920-24 | 2.9 | 4.3

1925-29 | 4.2 | 6.2

1930-34 | 4.3 | 7.0

1935-39 | 5.8 | 9.6

1940-44 | 7.5 | 11.3

1945-49 | 9.2 | 15.2

1950-54 | 11.2 | 22.4

1955-59 | 12.7 | 31.9

1960-64 | 13.4 | 44.6

1965-69 | 15.8 | 65.4

1970-74 | 17.0 | 93.9

1975-79 | 15.3 | 107

1980-84 | 15.8 | 101 | .009874

1985-89 | 15.2 | 104 | .010606

1990-94 | 12.9 | 110 | .008821

1995-99 | 11.5 | 118 | .007102

2000-04 | 10.4 | 122.2 | .005656

2005-09 | 9.4 | 130.7 | .005426

The first order of business is finding the parameter values for a logistic differential equation that fits the crude oil production data for the US. That data comes from column two of table 1. While we are here, we also will need parameter values for a logistic differential equation that fits the crude oil production data for the world. That data will come from column three of table 1.

For our differential equation, we will use the equation for logistic growth from the textbook. This equation is: $dP/dt = kP(1-P/N)$ where $N$ is the recoverable crude oil.

Before rushing to a solution, lets do some paper and pencil to determine k. We assume that dP/dt is the change between the first and second line of Table 1 for US Oil. $P$ will be taken as the population in line two of the table for US Oil. The equation then reads $4.2 - 2.9 = kP(1-P/N)$. Solving this for $k$, we get: $k = (4.2 - 2.9)/((4.9)(1.0-4.9/200.0))$. Using this equation yields for $k$, $k = 0.26764$.

Let's see what happens when we try to solve the differential equation.

k = 0.26764
N = 200
P, t = var('P,t')
P = function ('P', t)
de = diff(P, t) == k*(1 - P/N)*P
h = desolve(de, P)
show(h)

$\displaystyle -\frac{25000}{6691} \, \log\left(P\left(t\right) - 200\right) + \frac{25000}{6691} \, \log\left(P\left(t\right)\right) = C + t$
k = 0.26764
N = 200
P, t = var('P,t')
P = function ('P', t)
de = diff(P, t) == k*(1 - P/N)*P
desolve_rk4(de, P ,ics=[0,2.9],ivar=t,output='slope_field',end_points=[0,100],thickness=3)



t=var('t')
plot( (200) / (29*exp(-.26764*t) + 1), (t,0,50))

%md The graphs are the same, the only difference being the upper limit, now 300 as opposed to 200.<br>

%md Now we generate the same set of graphs except using 300 billion barrla as the amount of recoverable crude.

k = 0.26764
N = 300
P, t = var('P,t')
P = function ('P', t)
de = diff(P, t) == k*(1 - P/N)*P
h = desolve(de, P)
show(h)

%md Part 2
k = 0.26764
N = 300
P, t = var('P,t')
P = function ('P', t)
de = diff(P, t) == k*(1 - P/N)*P
desolve_rk4(de, P ,ics=[0,2.9],ivar=t,output='slope_field',end_points=[0,100],thickness=3)

%md part 3

t=var('t')
plot( (300) / (29*exp(-.26764*t) + 1), (t,0,50))

%md We once again run the same equation, this time using 400 barrels of recoverable crude
%md Part 1

k = 0.26764
N = 400
P, t = var('P,t')
P = function ('P', t)
de = diff(P, t) == k*(1 - P/N)*P
h = desolve(de, P)
show(h)

%md Part 2
k = 0.26764
N = 400
P, t = var('P,t')
P = function ('P', t)
de = diff(P, t) == k*(1 - P/N)*P
desolve_rk4(de, P ,ics=[0,2.9],ivar=t,output='slope_field',end_points=[0,100],thickness=3)

%md part 3

t=var('t')
plot( (400) / (29*exp(-.26764*t) + 1), (t,0,50))

%md <h3>Moving on to the world oil supply</h3>

%md The next stage of the report is to repeat the analysis for the World Oil supply. The model is exactly the same, we need only change  the values for
%md the amount of recoverable crude oil.  The first analysis will use 2,1 trillion barrels. We will repeat the analysis  for 3 trillion barrels.<br>
%md First order of business though is to determine $k$ for the world oil supply. Using the numbers from
%md the first two rows of the table for world oil, using them exactly as we did for analylizing the US supply.<br>
%md The equation we use is $(6.2 - 4.3)=(k*6.2*(1-6.2/2.1))$. Solving for $k$ yields $k = (6.2 - 4.3)/(6.2*(1-6.2/2.1))$. This yields
%md $k = .15696$<br>

%md Now we are ready to run the equations.

k = 0.15696
N = 2.1
P, t = var('P,t')
P = function ('P', t)
de = diff(P, t) == k*(1 - P/N)*P
h = desolve(de, P)
show(h)


The graphs are the same, the only difference being the upper limit, now 300 as opposed to 200.

Now we generate the same set of graphs except using 300 billion barrla as the amount of recoverable crude.

$-\frac{25000}{6691} \, \log\left(P\left(t\right) - 300\right) + \frac{25000}{6691} \, \log\left(P\left(t\right)\right) = C + t$

Part 2

part 3

We once again run the same equation, this time using 400 barrels of recoverable crude

Part 1

$-\frac{25000}{6691} \, \log\left(P\left(t\right) - 400\right) + \frac{25000}{6691} \, \log\left(P\left(t\right)\right) = C + t$

Part 2

part 3

### Moving on to the world oil supply

The next stage of the report is to repeat the analysis for the World Oil supply. The model is exactly the same, we need only change the values for

the amount of recoverable crude oil. The first analysis will use 2,1 trillion barrels. We will repeat the analysis for 3 trillion barrels.

First order of business though is to determine $k$ for the world oil supply. Using the numbers from

the first two rows of the table for world oil, using them exactly as we did for analylizing the US supply.

The equation we use is $(6.2 - 4.3)=(k*6.2*(1-6.2/2.1))$. Solving for $k$ yields $k = (6.2 - 4.3)/(6.2*(1-6.2/2.1))$. This yields

$k = .15696$

Now we are ready to run the equations.

$-\frac{6250}{981} \, \log\left(10 \, P\left(t\right) - 21\right) + \frac{6250}{981} \, \log\left(P\left(t\right)\right) = C + t$

Repeating the analysis for 3 billion barrels of world recoverable crude oil.

t=var('t')
plot( (2100) / (30.55*exp(-.15696*t) + 1), (t,0,50))






And repeating the graph for 3.1 billion barrels of reoverable crude



t=var('t')
plot( (3000) / (30.55*exp(-.15696*t) + 1), (t,0,50))





The first of each set was run using the Sage generated solution. The second set of graphs was run using the solution

we found by hand.

t=var('t')
plot( (3000) / (30.55*exp(-.15696*t) + 1), (t,0,75))



Okay. In the above graph, we tried to predict when production would reach a maximum. The graph shows production should reach maximum

in very near 50 years.

Error in lines 2-2 Traceback (most recent call last): File "/projects/8299fe74-5b6d-4e77-8c1c-ddea36380da7/.sagemathcloud/sage_server.py", line 873, in execute exec compile(block+'\n', '', 'single') in namespace, locals File "<string>", line 1 Moving on to Texas oil supply ^ SyntaxError: invalid syntax
%md The above error code is baffling!  I cannot even find where the code is, let alone correct it. Sage has great potential
%md but problems likethis should never happen!

%md Now we will generate a graph using the solution found by hand


The above error code is baffling! I cannot even find where the code is, let alone correct it. Sage has great potential

but problems likethis should never happen!

Now we will generate a graph using the solution found by hand

### Texas Oil production

Now we need to try to determine when Texas oil production will reach maximum.

t=var('t')
plot( (75.37) / (32.223*exp(-.10001*t) + 1), (t,0,100))


From the looks of the above graph, Texas oil prodection will reach maximum in about 80 years,

Considering the change in costs, it is the opinion of this author that production will likely be directly proportional to

cost. If we use $C$ to represent cost, then $C*(k*(1 - P/N)*P)$ should represent future production numbers.