# Pass extra arguments to ODEForwardSensitivityProblem's RHS function

**URL:** <https://discourse.julialang.org/t/pass-extra-arguments-to-odeforwardsensitivityproblems-rhs-function/40933>\
**Category:** New to Julia\
**Tags:** question, diffeq\
**Created:** [June 7, 2020, 3:15pm UTC](https://discourse.julialang.org/t/pass-extra-arguments-to-odeforwardsensitivityproblems-rhs-function/40933 "2020-06-07T15:15:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ca0h](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@ca0h](https://discourse.julialang.org/u/ca0h)\
**Post date:** [June 7, 2020, 3:15pm UTC](https://discourse.julialang.org/t/pass-extra-arguments-to-odeforwardsensitivityproblems-rhs-function/40933/1 "2020-06-07T15:15:21Z")

</div>

For DiffEqSensitivity.jl’s ODEForwardSensitivityProblem, I was wondering if we could pass extra arguments to RHS function that are not for sensitivity analysis?

In DifferentialEquations.jl, we could pass extra arguments to ODEProblem’s RHS function as follows:

```julia
param = (p, arg)
prob = ODEProblem(RHS_func, u0, tspan, param)

function RHS_func( du, u, param, t )
    p, arg = param
   du[1] = f1(u, p)
   du[2] = f2(u, p)
end

```

However, I don’t think this will work for ODEForwardSensitivityProblem. Is there a possible work-abound? It will be great if I don’t need to make these arguments global.

---

<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 7, 2020, 3:22pm UTC](https://discourse.julialang.org/t/pass-extra-arguments-to-odeforwardsensitivityproblems-rhs-function/40933/2 "2020-06-07T15:22:35Z")

</div>

Just use a closure or a call-overloaded struct
