# Euler Equation Iteration to solve an Optimization problem

**URL:** <https://discourse.julialang.org/t/euler-equation-iteration-to-solve-an-optimization-problem/84135>\
**Category:** Finance and Economics\
**Tags:** optimization\
**Created:** [July 12, 2022, 11:49pm UTC](https://discourse.julialang.org/t/euler-equation-iteration-to-solve-an-optimization-problem/84135 "2022-07-12T23:49:17Z")\
**Posts on this page:** 2\
**Page:** 2

<div class="post-metadata">

**Author:** ![nicolas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nicolas/32/26439_2.png) [@nicolas](https://discourse.julialang.org/u/nicolas)\
**Post date:** [July 27, 2022, 9:28pm UTC](https://discourse.julialang.org/t/euler-equation-iteration-to-solve-an-optimization-problem/84135/21 "2022-07-27T21:28:27Z")

</div>

> [@Albert\_Zevelev](#):
>
> ```julia
> Π1 = Π1p
> Π2 = Π2p
> 
> ```

Hi Albert,

I think your FPI solver should have

```julia
        Π1 .= Π1p
        Π2 .= Π2p

```

Otherwise, Π1 and Π2 just point to Π1p and Π2p and dist = 0 automatically. Long ago have I stopped counting the number of times this bug happened to me too.

---

<div class="post-metadata">

**Author:** ![Albert\_Zevelev](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/albert_zevelev/32/11844_2.png) [@Albert\_Zevelev](https://discourse.julialang.org/u/Albert_Zevelev)\
**Post date:** [August 1, 2022, 7:20pm UTC](https://discourse.julialang.org/t/euler-equation-iteration-to-solve-an-optimization-problem/84135/22 "2022-08-01T19:20:11Z")

</div>

Yes, basically. Where F is a vector of functions, X, and \gamma are vectors, and the solution X(\gamma) is a function.  
There are many methods for doing this: projection/perturbation/etc…  
One method is Euler Iteration, a fixed point method I’m trying to get to work here.

[Previous page](https://discourse.julialang.org/t/euler-equation-iteration-to-solve-an-optimization-problem/84135.md?page=1)
