# Type VariableRef has no field head

**URL:** <https://discourse.julialang.org/t/type-variableref-has-no-field-head/28116>\
**Category:** Specific Domains\
**Tags:** question\
**Created:** [August 28, 2019, 3:50pm UTC](https://discourse.julialang.org/t/type-variableref-has-no-field-head/28116 "2019-08-28T15:50:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![faoh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/faoh/32/9483_2.png) [@faoh](https://discourse.julialang.org/u/faoh)\
**Post date:** [August 28, 2019, 3:50pm UTC](https://discourse.julialang.org/t/type-variableref-has-no-field-head/28116/1 "2019-08-28T15:50:18Z")

</div>

Hi All,

I try to formulate an objective function, like x\*log(x), x is a nonlinear expression. However, when I run the optimization, it shows type VariableRef has no field head. Anyone else saw this message?

JuMP.@NLexpression(model, R1, (ami\*tstp)/dc )  
JuMP.@NLexpression(model, R2, log((ami \* tstp)/dc) )  
JuMP.@NLexpression(model, R, R1 \* R2 )

return JuMP.@NLobjective(model, Min,

```
     R
  )

```

The ami, tstp, and dc are very long nonlinear equations. If needed, I can post as well.

When I try to solve the optimization, it shows

type VariableRef has no field head

I also test the expression of R1 and R2 for the objective function individually and they work fine. However, when I use the expression of R1\*R2 / R, it shows the error.

Thanks
