Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bayesian ODE with Julia

I have been trying to implement Bayesian ODE. In Oil industry, we use the following equation to fit production data then forecasting :

The ODE equation is described as :

where 0<n<1, n and K are parameters defined by fitting the raw production data, in my case K is 0.17, n = 0.87.

My initial code :

using DiffEqFlux, OrdinaryDiffEq, Flux, Optim, Plots, AdvancedHMC
    
function Arps!(du,u,p,t)
    y = u
    K,n = p
    du  = (y * K * y^n)
end

tspan=(1.0,200.0)
tsteps = range(1, 200, length = 200)
u0 = [5505.99]
p=[0.17,0.87]
prob1 = ODEProblem(Arps!,u0,tspan)
sol_ode = solve(prob1,Vern7(),saveat = tsteps)

Not sure how to solve this issue :

MethodError: no method matching iterate(::DiffEqBase.NullParameters) 
like image 776
Minou92 Avatar asked May 11 '26 00:05

Minou92


1 Answers

You didn't pass any parameters into your ODE. prob1 = ODEProblem(Arps!,u0,tspan,p).

For the Bayesian part, look at the tutorial:

https://turing.ml/dev/tutorials/10-bayesiandiffeq/

like image 76
Chris Rackauckas Avatar answered May 15 '26 05:05

Chris Rackauckas