-1

I think the key challenge in my code is calling these in line functions:

rr(τ) = 1/((1+prstp)^(tstep*(τ-1)))

I am calling it in the following way:

@NLconstraint(dice_model,
              UTILITY == sum((C[i]^(1-elasmu)*l[i]/(1-elasmu)) * rr(1.0) for i in 1:100))

 error coming when I call this

Sundar R
  • 13,776
  • 6
  • 49
  • 76
Deep S
  • 23
  • 2
  • 1
    Do you get any errors or unexpected results? The image shows just a warning, which wouldn't affect further processing. It also says what step you can take to avoid the warning too: register the function with the model, as shown in the message. Can you update the question with where you're having problems with this? – Sundar R Feb 23 '22 at 08:39

1 Answers1

0
  • Option 1: register the function like the warning helpfully tells you to
  • Option 2: replace rr(1.0) by a constant. In an earlier line have my_const = rr(1.0), and then in the nonlinear expression use my_const instead of rr(1.0).
Oscar Dowson
  • 2,395
  • 1
  • 5
  • 13