# Objective function error in a robust model

**URL:** <https://discourse.julialang.org/t/objective-function-error-in-a-robust-model/49123>\
**Category:** Optimization (Mathematical)\
**Tags:** question\
**Created:** [October 27, 2020, 2:43pm UTC](https://discourse.julialang.org/t/objective-function-error-in-a-robust-model/49123 "2020-10-27T14:43:54Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [October 27, 2020, 7:29pm UTC](https://discourse.julialang.org/t/objective-function-error-in-a-robust-model/49123/3 "2020-10-27T19:29:42Z")

</div>

This is similar to a number of your [previous](https://discourse.julialang.org/t/how-to-use-the-summation-in-julia/41522) [questions](https://discourse.julialang.org/t/how-to-build-a-constraint-with-summation/41618/9).

Your (math) objective function doesn’t make sense because `w` and `t` are not defined.

In code, you need your summation to loop over all the indices, something like `for a in A, w in W, t in T`.

---

_[View the full topic](https://discourse.julialang.org/t/objective-function-error-in-a-robust-model/49123)._
