Showing results for
Do you mean
Solved!

# [NX10] Can I apply a cut off value for an independent in the Formula Field editor?

Can I apply a cut off value for an independent in the Formula Field editor?

If I set a value at maximum in the Domain section of the Formula Field editor it has no effect.

5 REPLIES

## Re: [NX10] Can I apply a cut off value for an independent in the Formula Field editor?

You can create cutoff values for independent domains in a formula field by using IF statements in the formula expression. Here is an example of a pressure that ramps linearly with z, but is bounded by a start and end value for z:

LoadStart and LoadEnd are expressions defined as a length in mm. In the expression above, they are interpreted as z coordinates in the field's coordinate system. PressureRamp is another expression that linearly ramps a pressure with respect to z.

The key for you is that the formula is evaluated only between  z values LoadStart and LoadEnd. For all other Z values, the pressure is set to zero.

For reference, I used NX 10. Older versions support IF statements in formula fields as well.

Regards,

Mark

Mark Lamping

Simulation Product Management

Simulation and Test Solutions

Siemens Industry Sector

Siemens Product Lifecycle Management Software Inc.

mark.lamping@siemens.com

www.siemens.com/plm

## Re: [NX10] Can I apply a cut off value for an independent in the Formula Field editor?

Hi Mark,

I tried the following:

if (z<0) -0.000001025[kg/mm^3]*9.81[m/sec^2]*z else 0.0

with

-0.000001025[kg/mm^3]*9.81[m/sec^2]*z being the function I want

And all positive values of z cut-off.

But I'm afraid that didn't work. Can you maybe tell me what I'm doing wrong in this example?

Regards,

Rogier

Solution
Solution
Accepted by topic author R_Smit
‎07-27-2016 02:50 AM

## Re: [NX10] Can I apply a cut off value for an independent in the Formula Field editor?

I reproduced your error as well with that expression. NX is getting confused by z<0 where there is no unit assigned to 0. Add a length unit to 0, such as 0[mm], and the expression should work.

NX should have issued an Alert with the application of the expression without the unit on 0. It did for me:

Dimension mismatch (binary operation)

That is hinting at a dimension error in the expression. When in doubt, spell out units explicitly on all numerical values in the expression. I think NX was incorrectly interpreting 0 as a pressure rather than as a length. I will submit a PR for development to review this. I don't think you should have needed the unit on 0.

Regards,

Mark

Hi Mark,

That worked!

Thanks a lot

Regards,

Rogier

## Re: [NX10] Can I apply a cut off value for an independent in the Formula Field editor?

Rogier,

I'm glad to see that you are able to move forward with your model. I did get feedback from development regarding the measure/units issue on the conditional statement. The expressions system currently assumes that the conditional statement's measure matches the measure of the expression itself. So, the expression measure is pressure, which means the conditional statement's assumed measure is also pressure. My PR turned into an enhancement request such that the conditional statement's assumed measure would match the measure of the left hand side of the conditional statement (length in your example). For now, you will have to specify the unit of conditional statement quantities.

Regards,

Mark