# MonteCarloProblem Error

**URL:** <https://discourse.julialang.org/t/montecarloproblem-error/25538>\
**Category:** General Usage\
**Tags:** package, diffeq\
**Created:** [June 21, 2019, 9:34pm UTC](https://discourse.julialang.org/t/montecarloproblem-error/25538 "2019-06-21T21:34:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![LGa](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lga/32/7864_2.png) [@LGa](https://discourse.julialang.org/u/LGa)\
**Post date:** [June 21, 2019, 9:34pm UTC](https://discourse.julialang.org/t/montecarloproblem-error/25538/1 "2019-06-21T21:34:02Z")

</div>

Hello,  
I am following the instructions from the DifferentialEquations.jl package ([http://docs.juliadiffeq.org/latest/features/noise\_process.html#Direct-Simulation-of-the-Noise-Process-1](http://docs.juliadiffeq.org/latest/features/noise_process.html#Direct-Simulation-of-the-Noise-Process-1)) to Monte Carlo simulate paths of a Geometric Brownian Motion.  
Here is the code

using Plots, DiffEqBase, DiffEqNoiseProcess, Compat

μ = 0.0  
σ = 0.3  
W0 = 1.0  
t0 = 0.0  
tEnd = 10000.0  
dt = 0.001  
W = GeometricBrownianMotionProcess(μ,σ,t0,W0)  
prob = NoiseProblem(W,(t0,tEnd))  
sol = solve(prob;dt=dt)

monte\_prob = MonteCarloProblem(prob)  
monte\_sol = solve(monte\_prob;dt=dt,num\_monte=100)

Everything works fine but the very last command yields the following error:

ERROR: LoadError: type MonteCarloProblem has no field tspan

I must be missing something basic.

I am running Julia v"1.1.1".

Thanks in advance for any help.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [June 21, 2019, 10:00pm UTC](https://discourse.julialang.org/t/montecarloproblem-error/25538/2 "2019-06-21T22:00:06Z")

</div>

This happens to be an error which I just fixed on master.

```julia
using Plots, DiffEqBase, DiffEqNoiseProcess, Compat, DiffEqMonteCarlo

μ = 0.0
σ = 0.3
W0 = 1.0
t0 = 0.0
tEnd = 10000.0
dt = 0.001
W = GeometricBrownianMotionProcess(μ,σ,t0,W0)
prob = NoiseProblem(W,(t0,tEnd))
sol = solve(prob;dt=dt)

monte_prob = MonteCarloProblem(prob)
monte_sol = solve(monte_prob;dt=dt,num_monte=100)

```

now works. Thanks for the report!

---

<div class="post-metadata">

**Author:** ![LGa](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lga/32/7864_2.png) [@LGa](https://discourse.julialang.org/u/LGa)\
**Post date:** [June 21, 2019, 10:47pm UTC](https://discourse.julialang.org/t/montecarloproblem-error/25538/3 "2019-06-21T22:47:14Z")

</div>

Excellent! Thank you very much.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [June 21, 2019, 11:57pm UTC](https://discourse.julialang.org/t/montecarloproblem-error/25538/4 "2019-06-21T23:57:38Z")

</div>

No problem. I’ll release it by Monday.
