# How to find source code of a function in DifferentialEquations.jl?

**URL:** <https://discourse.julialang.org/t/how-to-find-source-code-of-a-function-in-differentialequations-jl/40402>\
**Category:** General Usage\
**Created:** [May 29, 2020, 8:51am UTC](https://discourse.julialang.org/t/how-to-find-source-code-of-a-function-in-differentialequations-jl/40402 "2020-05-29T08:51:01Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abolfazl\_Ziaeemehr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/abolfazl_ziaeemehr/32/9014_2.png) [@Abolfazl\_Ziaeemehr](https://discourse.julialang.org/u/Abolfazl_Ziaeemehr)\
**Post date:** [May 29, 2020, 8:51am UTC](https://discourse.julialang.org/t/how-to-find-source-code-of-a-function-in-differentialequations-jl/40402/1 "2020-05-29T08:51:01Z")

</div>

Hello everybody,  
I am new to the forum.  
I need to have access to detail documentation of some functions in DiffrentialEquations.jl package. I look into the source code in Github repository, but I could not find the function.  
For example I need to know how to pass parameter to  
`EnsembleProblem(prob,prob_func=prob_func)`  
in solving SDE.

function prob\_func(prob, i, repeat)  
remake(prob,u0=rand() \* prob.u0)  
end

I need to know the documentation of prob\_func or the source code.

Do you have any idea?

---

<div class="post-metadata">

**Author:** ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)\
**Post date:** [May 29, 2020, 9:03am UTC](https://discourse.julialang.org/t/how-to-find-source-code-of-a-function-in-differentialequations-jl/40402/2 "2020-05-29T09:03:18Z")

</div>

`@edit`

---

<div class="post-metadata">

**Author:** ![ettersi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ettersi/32/6829_2.png) [@ettersi](https://discourse.julialang.org/u/ettersi)\
**Post date:** [May 29, 2020, 9:18am UTC](https://discourse.julialang.org/t/how-to-find-source-code-of-a-function-in-differentialequations-jl/40402/3 "2020-05-29T09:18:50Z")

</div>

`@edit` works if the code structure is simple enough, but big Julia project like `DifferentialEquations.jl` tend to wrap the actual algorithm in several layers of argument-handling functions which can be tedious to work through using only `@edit`. In such cases, I find the debugger in IDEs like Atom or VSCode quite useful. In Atom, try `Juno.@enter your_function()` and press `Step into` until you reach the level of the actual algorithm.

---

<div class="post-metadata">

**Author:** ![ericphanson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ericphanson/32/215186_2.png) [@ericphanson](https://discourse.julialang.org/u/ericphanson)\
**Post date:** [May 29, 2020, 11:35am UTC](https://discourse.julialang.org/t/how-to-find-source-code-of-a-function-in-differentialequations-jl/40402/4 "2020-05-29T11:35:21Z")

</div>

You can get access to the help mode by typing `?`, so entering `? EnsembleProblem` should show you some documentation.

---

<div class="post-metadata">

**Author:** ![Abolfazl\_Ziaeemehr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/abolfazl_ziaeemehr/32/9014_2.png) [@Abolfazl\_Ziaeemehr](https://discourse.julialang.org/u/Abolfazl_Ziaeemehr)\
**Post date:** [May 29, 2020, 12:23pm UTC](https://discourse.julialang.org/t/how-to-find-source-code-of-a-function-in-differentialequations-jl/40402/5 "2020-05-29T12:23:12Z")

</div>

I usually use `vscode`, F12 does not work there to find the definition of the function.

---

<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:** [May 29, 2020, 12:34pm UTC](https://discourse.julialang.org/t/how-to-find-source-code-of-a-function-in-differentialequations-jl/40402/6 "2020-05-29T12:34:04Z")

</div>

`@which EnsembleProblem(prob)`

---

<div class="post-metadata">

**Author:** ![erlebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/erlebach/32/12973_2.png) [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Post date:** [June 4, 2020, 3:41pm UTC](https://discourse.julialang.org/t/how-to-find-source-code-of-a-function-in-differentialequations-jl/40402/7 "2020-06-04T15:41:59Z")

</div>

Here is what I happened when I tried `@which`:

```julia
julia> @which EnsembleProblem prob
ERROR: LoadError: MethodError: no method matching @which(::LineNumberNode, ::Module, ::Symbol, ::Symbol)
Closest candidates are:
  @which(::LineNumberNode, ::Module, ::Symbol) at /Users/sabae/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.4/InteractiveUtils/src/macros.jl:128
  @which(::LineNumberNode, ::Module, ::Any) at /Users/sabae/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.4/InteractiveUtils/src/macros.jl:122
in expression starting at none:1

```

where `prob` is the output of `DiscreteProblem`:

```julia
julia> prob
DiscreteProblem with uType Array{Float64,1} and tType Float64. In-place: true
timespan: (0.0, 20.0)
u0: [0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0 … 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]

```

---

<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 4, 2020, 3:47pm UTC](https://discourse.julialang.org/t/how-to-find-source-code-of-a-function-in-differentialequations-jl/40402/8 "2020-06-04T15:47:03Z")

</div>

@which EnsembleProblem(prob)

---

<div class="post-metadata">

**Author:** ![ignace](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ignace/32/24275_2.png) [@ignace](https://discourse.julialang.org/u/ignace)\
**Post date:** [April 18, 2021, 8:59pm UTC](https://discourse.julialang.org/t/how-to-find-source-code-of-a-function-in-differentialequations-jl/40402/9 "2021-04-18T20:59:42Z")

</div>

Hello and thank you all for the above responses.  
Is there a function that allows one to obtain the exact location of a Julia function in one’s file system?  
Thanks!

---

<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:** [April 18, 2021, 9:08pm UTC](https://discourse.julialang.org/t/how-to-find-source-code-of-a-function-in-differentialequations-jl/40402/10 "2021-04-18T21:08:48Z")

</div>

Again, the answer is just `@which`.
