# Learning to optimize

**URL:** <https://discourse.julialang.org/t/learning-to-optimize/57207>\
**Category:** Performance\
**Created:** [March 15, 2021, 3:36pm UTC](https://discourse.julialang.org/t/learning-to-optimize/57207 "2021-03-15T15:36:10Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [March 15, 2021, 7:33pm UTC](https://discourse.julialang.org/t/learning-to-optimize/57207/12 "2021-03-15T19:33:45Z")

</div>

For how short it is, this example is nice to show as well:

> [@Seven Lines of Julia (examples sought)](https://discourse.julialang.org/t/seven-lines-of-julia-examples-sought/50416/42):
>
> With 15 lines I could write a code to perform a particle simulation with periodic boundary conditions, a langevin thermostat, and a quadratic potential between the particles, and produce an animation: using Plots ; ENV["GKSwstype"]="nul" const N, τ, Δt, λ, T, k = 100, 1000, 0.01, 1e-3, 0.26, 1e-6 const x, v, f = -0.5 .+ rand(3,N), -0.01 .+ 0.02\*randn(3,N), zeros(3,N) wrap(x,y) = (x-y) \> 0.5 ? (x-y)-1 : ( (x-y) \< -0.5 ? (x-y)+1 : (x-y) ) anim = @animate for t in 1:τ f .= 0 for i in 1:N-1, j…

I have also a simulation package written for a discipline, which may be useful: [GitHub - m3g/CKP](https://github.com/m3g/CKP)

Unfortunately the actual text of the material is in Portuguese

---

_[View the full topic](https://discourse.julialang.org/t/learning-to-optimize/57207)._
