Running 'fit_and_plot.R' [1s]
  Running 'fit_and_plot_from_Np.R' [169s]
  Running 'fit_and_plot_from_Np_with_buildup.R' [1s]
  Running 'fit_and_plot_from_Np_with_curtailment.R' [1s]
  Running 'fit_and_plot_from_interval.R' [1s]
  Running 'fit_and_plot_from_interval_with_buildup.R' [1s]
  Running 'fit_and_plot_from_interval_with_curtailment.R' [173s]
  Running 'fit_and_plot_with_buildup.R' [158s]
  Running 'fit_and_plot_with_curtailment.R' [167s]
Running the tests in 'tests/fit_and_plot_from_Np.R' failed.
Complete output:
  > # aRpsDCA
  > # Copyright (C) 2016 dwt | terminus data science, LLC
  > # <dwt [at] terminusdatascience.com>
  > 
  > # This library is free software; you can redistribute it and/or
  > # modify it under the terms of the GNU Lesser General Public
  > # License as published by the Free Software Foundation; either
  > # version 2.1 of the License, or (at your option) any later version.
  > 
  > # This library is distributed in the hope that it will be useful,
  > # but WITHOUT ANY WARRANTY; without even the implied warranty of
  > # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  > # Lesser General Public License for more details.
  > 
  > # You should have received a copy of the GNU Lesser General Public
  > # License along with this library; if not, write to the Free Software
  > # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301
  > # USA
  > 
  > library(aRpsDCA)
  > 
  > fitme.exponential.t <- seq(0, 5, 1 / 12) # 5 years
  > fitme.exponential.Np <- exponential.Np(
  +     1000, # Bbl/d
  +     as.nominal(0.70), # / year
  +     fitme.exponential.t
  + )
  > 
  > exponential.fit <- best.exponential.from.Np(fitme.exponential.Np, fitme.exponential.t)
  > cat(paste("SSE:", exponential.fit$sse))
  SSE: 9.01396353260357e-15> dev.new()
  dev.new(): using pdf(file="Rplots4.pdf")
  > plot(fitme.exponential.Np ~ fitme.exponential.t, main="Exponential Fit",
  +      col="blue", xlab="Time", ylab="Cumulative Production")
  > lines(arps.Np(exponential.fit$decline, fitme.exponential.t) ~ fitme.exponential.t,
  +       col="red")
  > legend("topright", pch=c(1, NA), lty=c(NA, 1), col=c("blue", "red"), legend=c("Actual", "Fit"))
  > 
  > fitme.hyperbolic.t <- seq(0, 5, 1 / 12) # 5 years
  > fitme.hyperbolic.Np <- hyperbolic.Np(
  +     1000, # Bbl/d
  +     as.nominal(0.70), # / year
  +     1.9,
  +     fitme.hyperbolic.t
  + )
  > 
  > hyperbolic.fit <- best.hyperbolic.from.Np(fitme.hyperbolic.Np, fitme.hyperbolic.t)
  > cat(paste("SSE:", hyperbolic.fit$sse))
  SSE: 5.59695874594112e-15> dev.new()
  dev.new(): using pdf(file="Rplots5.pdf")
  > plot(fitme.hyperbolic.Np ~ fitme.hyperbolic.t, main="Hyperbolic Fit",
  +      col="blue", xlab="Time", ylab="Cumulative Production")
  > lines(arps.Np(hyperbolic.fit$decline, fitme.hyperbolic.t) ~ fitme.hyperbolic.t,
  +       col="red")
  > legend("topright", pch=c(1, NA), lty=c(NA, 1), col=c("blue", "red"), legend=c("Actual", "Fit"))
  > 
  > fitme.hyp2exp.t <- seq(0, 5, 1 / 12) # 5 years
  > fitme.hyp2exp.Np <- hyp2exp.Np(
  +     1000, # Bbl/d
  +     as.nominal(0.70), # / year
  +     1.9,
  +     as.nominal(0.15), # / year
  +     fitme.hyp2exp.t
  + )
  > 
  > hyp2exp.fit <- best.hyp2exp.from.Np(fitme.hyp2exp.Np, fitme.hyp2exp.t)
  > cat(paste("SSE:", hyp2exp.fit$sse))
  SSE: 331.283072104596> dev.new()
  dev.new(): using pdf(file="Rplots6.pdf")
  > plot(fitme.hyp2exp.Np ~ fitme.hyp2exp.t, main="Hyperbolic-to-Exponential Fit",
  +      col="blue", xlab="Time", ylab="Cumulative Production")
  > lines(arps.Np(hyp2exp.fit$decline, fitme.hyp2exp.t) ~ fitme.hyp2exp.t,
  +       col="red")
  > legend("topright", pch=c(1, NA), lty=c(NA, 1), col=c("blue", "red"), legend=c("Actual", "Fit"))
  > 
  > overall.best <- best.fit.from.Np(fitme.hyp2exp.Np, fitme.hyp2exp.t)
  > cat(paste("SSE:", overall.best$sse))
  SSE: 211.095248425438> dev.new()
  dev.new(): using pdf(file="Rplots7.pdf")
  > plot(fitme.hyp2exp.Np ~ fitme.hyp2exp.t, main="Overall Best Fit (h2e Data)",
  +      col="blue", xlab="Time", ylab="Rate")
  > lines(arps.Np(overall.best$decline, fitme.hyp2exp.t) ~ fitme.hyp2exp.t,
  +       col="red")
  > legend("topright", pch=c(1, NA), lty=c(NA, 1), col=c("blue", "red"), legend=c("Actual", "Fit"))
  > 
  > 
  > 
  > proc.time()
     user  system elapsed 
     0.42    0.15    0.56 
Running the tests in 'tests/fit_and_plot_from_interval_with_curtailment.R' failed.
Complete output:
  > # aRpsDCA
  > # Copyright (C) 2016 dwt | terminus data science, LLC
  > # <dwt [at] terminusdatascience.com>
  > 
  > # This library is free software; you can redistribute it and/or
  > # modify it under the terms of the GNU Lesser General Public
  > # License as published by the Free Software Foundation; either
  > # version 2.1 of the License, or (at your option) any later version.
  > 
  > # This library is distributed in the hope that it will be useful,
  > # but WITHOUT ANY WARRANTY; without even the implied warranty of
  > # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  > # Lesser General Public License for more details.
  > 
  > # You should have received a copy of the GNU Lesser General Public
  > # License along with this library; if not, write to the Free Software
  > # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301
  > # USA
  > 
  > library(aRpsDCA)
  > 
  > fitme.exponential.t <- seq(0, 5, 1 / 12) # 5 years
  > fitme.exponential.Np <- curtailed.Np(arps.decline(
  +     1000, # Bbl/d
  +     as.nominal(0.70)), # / year
  +     5 / 12,
  +     fitme.exponential.t
  + )
  > 
  > exponential.fit <- best.exponential.from.interval.with.buildup(
  +   diff(fitme.exponential.Np), fitme.exponential.t[2:length(fitme.exponential.t)])
  > cat(paste("SSE:", exponential.fit$sse))
  SSE: 332.138599468287> dev.new()
  dev.new(): using pdf(file="Rplots24.pdf")
  > plot(fitme.exponential.Np ~ fitme.exponential.t, main="Exponential Fit",
  +      col="blue", xlab="Time", ylab="Cumulative Production")
  > lines(arps.Np(exponential.fit$decline, fitme.exponential.t) ~ fitme.exponential.t,
  +       col="red")
  > legend("topright", pch=c(1, NA), lty=c(NA, 1), col=c("blue", "red"), legend=c("Actual", "Fit"))
  > 
  > fitme.hyperbolic.t <- seq(0, 5, 1 / 12) # 5 years
  > fitme.hyperbolic.Np <- curtailed.Np(arps.decline(
  +     1000, # Bbl/d
  +     as.nominal(0.70), # / year
  +     1.9),
  +     5 / 12,
  +     fitme.hyperbolic.t
  + )
  > 
  > hyperbolic.fit <- best.hyperbolic.from.interval.with.buildup(
  +   diff(fitme.hyperbolic.Np), fitme.hyperbolic.t[2:length(fitme.hyperbolic.t)])
  > cat(paste("SSE:", hyperbolic.fit$sse))
  SSE: 156.388861199454> dev.new()
  dev.new(): using pdf(file="Rplots25.pdf")
  > plot(fitme.hyperbolic.Np ~ fitme.hyperbolic.t, main="Hyperbolic Fit",
  +      col="blue", xlab="Time", ylab="Cumulative Production")
  > lines(arps.Np(hyperbolic.fit$decline, fitme.hyperbolic.t) ~ fitme.hyperbolic.t,
  +       col="red")
  > legend("topright", pch=c(1, NA), lty=c(NA, 1), col=c("blue", "red"), legend=c("Actual", "Fit"))
  > 
  > fitme.hyp2exp.t <- seq(0, 5, 1 / 12) # 5 years
  > fitme.hyp2exp.Np <- curtailed.Np(arps.decline(
  +     1000, # Bbl/d
  +     as.nominal(0.70), # / year
  +     1.9,
  +     as.nominal(0.15)), # / year
  +     5 / 12,
  +     fitme.hyp2exp.t
  + )
  > 
  > hyp2exp.fit <- best.hyp2exp.from.interval.with.buildup(
  +   diff(fitme.hyp2exp.Np), fitme.hyp2exp.t[2:length(fitme.hyp2exp.t)])
  > cat(paste("SSE:", hyp2exp.fit$sse))
  SSE: 143.897742531685> dev.new()
  dev.new(): using pdf(file="Rplots26.pdf")
  > plot(fitme.hyp2exp.Np ~ fitme.hyp2exp.t, main="Hyperbolic-to-Exponential Fit",
  +      col="blue", xlab="Time", ylab="Cumulative Production")
  > lines(arps.Np(hyp2exp.fit$decline, fitme.hyp2exp.t) ~ fitme.hyp2exp.t,
  +       col="red")
  > legend("topright", pch=c(1, NA), lty=c(NA, 1), col=c("blue", "red"), legend=c("Actual", "Fit"))
  > 
  > overall.best <- best.fit.from.interval.with.buildup(
  +   diff(fitme.hyp2exp.Np), fitme.hyp2exp.t[2:length(fitme.hyp2exp.t)])
  > cat(paste("SSE:", overall.best$sse))
  SSE: 143.897742531685> dev.new()
  dev.new(): using pdf(file="Rplots27.pdf")
  > plot(fitme.hyp2exp.Np ~ fitme.hyp2exp.t, main="Overall Best Fit (h2e Data)",
  +      col="blue", xlab="Time", ylab="Rate")
  > lines(arps.Np(overall.best$decline, fitme.hyp2exp.t) ~ fitme.hyp2exp.t,
  +       col="red")
  > legend("topright", pch=c(1, NA), lty=c(NA, 1), col=c("blue", "red"), legend=c("Actual", "Fit"))
  > 
  > 
  > 
  > proc.time()
     user  system elapsed 
     0.35    0.26    0.56 
Running the tests in 'tests/fit_and_plot_with_buildup.R' failed.
Complete output:
  > # aRpsDCA
  > # Copyright (C) 2016 dwt | terminus data science, LLC
  > # <dwt [at] terminusdatascience.com>
  > 
  > # This library is free software; you can redistribute it and/or
  > # modify it under the terms of the GNU Lesser General Public
  > # License as published by the Free Software Foundation; either
  > # version 2.1 of the License, or (at your option) any later version.
  > 
  > # This library is distributed in the hope that it will be useful,
  > # but WITHOUT ANY WARRANTY; without even the implied warranty of
  > # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  > # Lesser General Public License for more details.
  > 
  > # You should have received a copy of the GNU Lesser General Public
  > # License along with this library; if not, write to the Free Software
  > # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301
  > # USA
  > 
  > library(aRpsDCA)
  > 
  > fitme.exponential.t <- seq(0, 5, 1 / 12) # 5 years
  > fitme.exponential.q <- arps.q(arps.with.buildup(arps.decline(
  +     1000, # Bbl/d
  +     as.nominal(0.70) # / year
  +     ), 250, 1.5 / 12),
  +     fitme.exponential.t
  + ) * rnorm(n=length(fitme.exponential.t), mean=1, sd=0.1) # perturb
  > 
  > exponential.fit <- best.exponential.with.buildup(fitme.exponential.q, fitme.exponential.t)
  > cat(paste("SSE:", exponential.fit$sse))
  SSE: 36677.811753432> dev.new()
  dev.new(): using pdf(file="Rplots28.pdf")
  > plot(fitme.exponential.q ~ fitme.exponential.t, main="Exponential Fit",
  +      col="blue", log="y", xlab="Time", ylab="Rate")
  > lines(arps.q(exponential.fit$decline, fitme.exponential.t) ~ fitme.exponential.t,
  +       col="red")
  > legend("topright", pch=c(1, NA), lty=c(NA, 1), col=c("blue", "red"), legend=c("Actual", "Fit"))
  > 
  > fitme.hyperbolic.t <- seq(0, 5, 1 / 12) # 5 years
  > fitme.hyperbolic.q <- arps.q(arps.with.buildup(arps.decline(
  +     1000, # Bbl/d
  +     as.nominal(0.70), # / year
  +     1.9
  +     ), 250, 1.5 / 12),
  +     fitme.hyperbolic.t
  + ) * rnorm(n=length(fitme.hyperbolic.t), mean=1, sd=0.1) # perturb
  > 
  > hyperbolic.fit <- best.hyperbolic.with.buildup(fitme.hyperbolic.q, fitme.hyperbolic.t)
  > cat(paste("SSE:", hyperbolic.fit$sse))
  SSE: 166902.733982567> dev.new()
  dev.new(): using pdf(file="Rplots29.pdf")
  > plot(fitme.hyperbolic.q ~ fitme.hyperbolic.t, main="Hyperbolic Fit",
  +      col="blue", log="y", xlab="Time", ylab="Rate")
  > lines(arps.q(hyperbolic.fit$decline, fitme.hyperbolic.t) ~ fitme.hyperbolic.t,
  +       col="red")
  > legend("topright", pch=c(1, NA), lty=c(NA, 1), col=c("blue", "red"), legend=c("Actual", "Fit"))
  > 
  > fitme.hyp2exp.t <- seq(0, 5, 1 / 12) # 5 years
  > fitme.hyp2exp.q <- arps.q(arps.with.buildup(arps.decline(
  +     1000, # Bbl/d
  +     as.nominal(0.70), # / year
  +     1.9,
  +     as.nominal(0.15) # / year
  +     ), 250, 1.5 / 12),
  +     fitme.hyp2exp.t
  + ) * rnorm(n=length(fitme.hyp2exp.t), mean=1, sd=0.1) # perturb
  > 
  > hyp2exp.fit <- best.hyp2exp.with.buildup(fitme.hyp2exp.q, fitme.hyp2exp.t)
  > cat(paste("SSE:", hyp2exp.fit$sse))
  SSE: 152917.750502214> dev.new()
  dev.new(): using pdf(file="Rplots30.pdf")
  > plot(fitme.hyp2exp.q ~ fitme.hyp2exp.t, main="Hyperbolic-to-Exponential Fit",
  +      col="blue", log="y", xlab="Time", ylab="Rate")
  > lines(arps.q(hyp2exp.fit$decline, fitme.hyp2exp.t) ~ fitme.hyp2exp.t,
  +       col="red")
  > legend("topright", pch=c(1, NA), lty=c(NA, 1), col=c("blue", "red"), legend=c("Actual", "Fit"))
  > 
  > overall.best <- best.fit.with.buildup(fitme.hyp2exp.q, fitme.hyp2exp.t)
  > cat(paste("SSE:", overall.best$sse))
  SSE: 152917.750502214> dev.new()
  dev.new(): using pdf(file="Rplots31.pdf")
  > plot(fitme.hyp2exp.q ~ fitme.hyp2exp.t, main="Overall Best Fit (h2e Data)",
  +      col="blue", log="y", xlab="Time", ylab="Rate")
  > lines(arps.q(overall.best$decline, fitme.hyp2exp.t) ~ fitme.hyp2exp.t,
  +       col="red")
  > legend("topright", pch=c(1, NA), lty=c(NA, 1), col=c("blue", "red"), legend=c("Actual", "Fit"))
  > 
  > 
  > proc.time()
     user  system elapsed 
     0.51    0.15    0.65 
Running the tests in 'tests/fit_and_plot_with_curtailment.R' failed.
Complete output:
  > # aRpsDCA
  > # Copyright (C) 2016 dwt | terminus data science, LLC
  > # <dwt [at] terminusdatascience.com>
  > 
  > # This library is free software; you can redistribute it and/or
  > # modify it under the terms of the GNU Lesser General Public
  > # License as published by the Free Software Foundation; either
  > # version 2.1 of the License, or (at your option) any later version.
  > 
  > # This library is distributed in the hope that it will be useful,
  > # but WITHOUT ANY WARRANTY; without even the implied warranty of
  > # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  > # Lesser General Public License for more details.
  > 
  > # You should have received a copy of the GNU Lesser General Public
  > # License along with this library; if not, write to the Free Software
  > # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301
  > # USA
  > 
  > library(aRpsDCA)
  > 
  > fitme.exponential.t <- seq(0, 5, 1 / 12) # 5 years
  > fitme.exponential.q <- curtailed.q(arps.decline(
  +     1000, # Bbl/d
  +     as.nominal(0.70) # / year
  +     ), 5 / 12,
  +     fitme.exponential.t
  + ) * rnorm(n=length(fitme.exponential.t), mean=1, sd=0.1) # perturb
  > 
  > exponential.fit <- best.exponential.curtailed(fitme.exponential.q, fitme.exponential.t)
  > cat(paste("SSE:", exponential.fit$sse))
  SSE: 55574.963926527> dev.new()
  dev.new(): using pdf(file="Rplots32.pdf")
  > plot(fitme.exponential.q ~ fitme.exponential.t, main="Exponential Fit",
  +      col="blue", log="y", xlab="Time", ylab="Rate")
  > lines(arps.q(exponential.fit$decline, fitme.exponential.t) ~ fitme.exponential.t,
  +       col="red")
  > legend("topright", pch=c(1, NA), lty=c(NA, 1), col=c("blue", "red"), legend=c("Actual", "Fit"))
  > 
  > fitme.hyperbolic.t <- seq(0, 5, 1 / 12) # 5 years
  > fitme.hyperbolic.q <- curtailed.q(arps.decline(
  +     1000, # Bbl/d
  +     as.nominal(0.70), # / year
  +     1.9
  +     ), 5 / 12,
  +     fitme.hyperbolic.t
  + ) * rnorm(n=length(fitme.hyperbolic.t), mean=1, sd=0.1) # perturb
  > 
  > hyperbolic.fit <- best.hyperbolic.curtailed(fitme.hyperbolic.q, fitme.hyperbolic.t)
  > cat(paste("SSE:", hyperbolic.fit$sse))
  SSE: 209591.320481539> dev.new()
  dev.new(): using pdf(file="Rplots33.pdf")
  > plot(fitme.hyperbolic.q ~ fitme.hyperbolic.t, main="Hyperbolic Fit",
  +      col="blue", log="y", xlab="Time", ylab="Rate")
  > lines(arps.q(hyperbolic.fit$decline, fitme.hyperbolic.t) ~ fitme.hyperbolic.t,
  +       col="red")
  > legend("topright", pch=c(1, NA), lty=c(NA, 1), col=c("blue", "red"), legend=c("Actual", "Fit"))
  > 
  > fitme.hyp2exp.t <- seq(0, 5, 1 / 12) # 5 years
  > fitme.hyp2exp.q <- curtailed.q(arps.decline(
  +     1000, # Bbl/d
  +     as.nominal(0.70), # / year
  +     1.9,
  +     as.nominal(0.15) # / year
  +     ), 5 / 12,
  +     fitme.hyp2exp.t
  + ) * rnorm(n=length(fitme.hyp2exp.t), mean=1, sd=0.1) # perturb
  > 
  > hyp2exp.fit <- best.hyp2exp.curtailed(fitme.hyp2exp.q, fitme.hyp2exp.t)
  > cat(paste("SSE:", hyp2exp.fit$sse))
  SSE: 129745.704158372> dev.new()
  dev.new(): using pdf(file="Rplots34.pdf")
  > plot(fitme.hyp2exp.q ~ fitme.hyp2exp.t, main="Hyperbolic-to-Exponential Fit",
  +      col="blue", log="y", xlab="Time", ylab="Rate")
  > lines(arps.q(hyp2exp.fit$decline, fitme.hyp2exp.t) ~ fitme.hyp2exp.t,
  +       col="red")
  > legend("topright", pch=c(1, NA), lty=c(NA, 1), col=c("blue", "red"), legend=c("Actual", "Fit"))
  > 
  > overall.best <- best.curtailed.fit(fitme.hyp2exp.q, fitme.hyp2exp.t)
  > cat(paste("SSE:", overall.best$sse))
  SSE: 127961.27029938> dev.new()
  dev.new(): using pdf(file="Rplots35.pdf")
  > plot(fitme.hyp2exp.q ~ fitme.hyp2exp.t, main="Overall Best Fit (h2e Data)",
  +      col="blue", log="y", xlab="Time", ylab="Rate")
  > lines(arps.q(overall.best$decline, fitme.hyp2exp.t) ~ fitme.hyp2exp.t,
  +       col="red")
  > legend("topright", pch=c(1, NA), lty=c(NA, 1), col=c("blue", "red"), legend=c("Actual", "Fit"))
  > 
  > 
  > proc.time()
     user  system elapsed 
     0.32    0.25    0.54