Topic
2 replies Latest Post - ‏2013-04-05T14:19:00Z by SystemAdmin
SystemAdmin
SystemAdmin
378 Posts
ACCEPTED ANSWER

Pinned topic Unbound Expression

‏2013-04-05T01:00:06Z |
Hello Everyone,

Could someone please help me explain why I get an "Unbound expression" error with this constraint??
I am calculating angles between segments and I just want to set that if the denominator is zero then the angle is 90.

forall(f in Floor){
forall (p in aSegments){
if ((ChangeinX[f][p])== 0)
Angles0[f][p] == 90;
}
}

I have attached the .mod file as well,.

Any assistance rendered will be highly appreciated!
Updated on 2013-04-05T14:19:00Z at 2013-04-05T14:19:00Z by SystemAdmin
  • ol
    ol
    33 Posts
    ACCEPTED ANSWER

    Re: Unbound Expression

    ‏2013-04-05T10:03:10Z  in response to SystemAdmin
    Hello,
    you cannot change an expression with a constraint, you need to build the expression with the "if" inside.

    for example:
    
    dexpr 
    
    float Angles0[g in Floor][h in aSegments] = (ChangeinX[g][h]==0) ? 90 : (Slope0[g][h]-(Slope0[g][h]^3)/3+(Slope0[g][h]^5)/5-(Slope0[g][h]^7)/7);
    


    and your can remove the lines:

    forall(f in Floor){
    forall (p in aSegments){
    if ((ChangeinX[f][p])== 0)
    Angles0[f][p] == 90;
    }
    }

    The same problem appears with Angle1.
    Regards,
    Olivier
  • SystemAdmin
    SystemAdmin
    378 Posts
    ACCEPTED ANSWER

    Re: Unbound Expression

    ‏2013-04-05T14:19:00Z  in response to SystemAdmin
    Thank you very much sir for helping me, it works now.