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

# Pinned topic Unbound Expression

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

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!

#### Attachments

Updated on 2013-04-05T14:19:00Z at 2013-04-05T14:19:00Z by SystemAdmin
• ol
51 Posts

#### Re: Unbound Expression

‏2013-04-05T10:03:10Z
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