# How to bring differential equations to wanted value with DiffEqFlux?

**URL:** <https://discourse.julialang.org/t/how-to-bring-differential-equations-to-wanted-value-with-diffeqflux/54167>\
**Category:** Numerics\
**Tags:** question\
**Created:** [January 29, 2021, 7:15am UTC](https://discourse.julialang.org/t/how-to-bring-differential-equations-to-wanted-value-with-diffeqflux/54167 "2021-01-29T07:15:55Z")\
**Posts on this page:** 1\
**Showing post:** 17

<div class="post-metadata">

**Author:** ![Luigi\_Marongiu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/luigi_marongiu/32/7909_2.png) [@Luigi\_Marongiu](https://discourse.julialang.org/u/Luigi_Marongiu)\
**Post date:** [February 26, 2021, 6:53am UTC](https://discourse.julialang.org/t/how-to-bring-differential-equations-to-wanted-value-with-diffeqflux/54167/17 "2021-02-26T06:53:05Z")

</div>

I have been looking at [example 2](https://diffeq.sciml.ai/stable/features/ensemble/) of the vignette since it covers a Lotka-Volterra system. This example has a main function that resembles the one I called `growth` in my [second post](https://discourse.julialang.org/t/how-to-test-multiple-parameters-with-sde/55089). The problem is that the example than sets another function:

```julia
function g(du,u,p,t)
  du[1] = p[3]*u[1]
  du[2] = p[4]*u[2]
end

```

What is the use of this function in my case?  
I just want to test over u[3] in `growth`. How do I write that down?  
shall I do:

```julia
function g(du,u,p,t)
  du[1] = p[3]*u[1]
  du[2] = p[4]*u[2]
  du[3] = p[5]*u[3]
end

```

or simply

```julia
function g(du,u,p,t)
  du[3] = p[1]*u[3]
end

```

What about the indices?

---

_[View the full topic](https://discourse.julialang.org/t/how-to-bring-differential-equations-to-wanted-value-with-diffeqflux/54167)._
