# Fixing parameter values when solving inverse problem using DiffEqFlux

**URL:** <https://discourse.julialang.org/t/fixing-parameter-values-when-solving-inverse-problem-using-diffeqflux/64963>\
**Category:** Modelling & Simulations\
**Created:** [July 20, 2021, 4:11am UTC](https://discourse.julialang.org/t/fixing-parameter-values-when-solving-inverse-problem-using-diffeqflux/64963 "2021-07-20T04:11:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![juliascrub](https://avatars.discourse-cdn.com/v4/letter/j/5daacb/32.png) [@juliascrub](https://discourse.julialang.org/u/juliascrub)\
**Post date:** [July 20, 2021, 4:11am UTC](https://discourse.julialang.org/t/fixing-parameter-values-when-solving-inverse-problem-using-diffeqflux/64963/1 "2021-07-20T04:11:46Z")

</div>

Is there a way to fix certain parameters when using sciml\_train? I could manually override them in the loss function like below but am curious if theres a better way

```julia
function loss(p)
    overridden_p = p but with some parameters fixed
    sol = solve(prob, Rodas4(), p=overridden_p)
    ...
end

```

My use case is that I am modeling a pipe thats got some geometric parameters like length, and sometimes maybe I do want the optimizer to change those values during optimization but maybe some other times I already have a certain pipe in mind with a certain length and dont want the optimizer to change that parameter and just leave it to whatever I set initially.

---

<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:** [July 20, 2021, 4:27am UTC](https://discourse.julialang.org/t/fixing-parameter-values-when-solving-inverse-problem-using-diffeqflux/64963/2 "2021-07-20T04:27:12Z")

</div>

For right now, manually override. We should set this up in the optimizer some time, but it’s not in the interface right now.
