# Optimization with Optim gives different results each time

**URL:** https://discourse.julialang.org/t/optimization-with-optim-gives-different-results-each-time/54143
**Category:** Optimization (Mathematical)
**Tags:** optim, optimization
**Created:** [January 28, 2021, 8:38pm UTC](https://discourse.julialang.org/t/optimization-with-optim-gives-different-results-each-time/54143 "2021-01-28T20:38:05Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![thisrod](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thisrod/32/10642_2.png) [@thisrod](https://discourse.julialang.org/u/thisrod)
#### Post date: [January 29, 2021, 6:55am UTC](https://discourse.julialang.org/t/optimization-with-optim-gives-different-results-each-time/54143/4 "2021-01-29T06:55:47Z")

</div>

> [@Michael\_Barmann](#):
>
> I keep getting different results each time I run the same block of code

That’s what you’re doing wrong: to get reproducible results, you clearly need to run a _different_ block of code.

To give you more precise advice than that, we’ll need to see the code you’re running, and some other things described [here](https://discourse.julialang.org/t/psa-make-it-easier-to-help-you/14757).

---

_[View the full topic](https://discourse.julialang.org/t/optimization-with-optim-gives-different-results-each-time/54143)._
