I am trying to insert a law curve in NX 9 which defines an ellipsis which begins at CS origin and ends at a specific point P (x_p, y_p) at an specific angle. Lamda is the angle the ellipsis is supposed to have at point P. I am using the following expressions:
x = a*cos(-right_angle+right_angle*t+t*asine((y_p-b)/b))
y = b*sin(-right_angle+right_angle*t+t*asine((y_p-b)/b))+b
a = abs(SQRT(x_p/(x_p*m^2-2*y_p*m))*(y_p-x_p*m)) [semi axis in horizontal direction]
b = y_p/(1-m*x_p/abs(m*x_p)*sqrt(1-(x_p/a)^2)) [semi axis in vertical direction]
m = tan (lamda) [slope at point P]
t = parameter for law curve which goes from 0 to 1
lamda, x_p and y_p are constants which can be chosen freely. When I try to insert the law curve I get the error message "Invalid Spine or law function data".
I already copied the formulae into an excel sheet and the graph looks fine. So the equations should be correct. Any idea why this is not working?
EDIT: x_p must be > 0 for the equations of x and y
EDIT 2: the expression right_angle is defined as 90 degrees
Solved! Go to Solution.
Make sure that all of your expressions have the correct dimensionality applied - e.g. "t" should be a constant (unitless), "x" should be a length, "right_angle" should be angle, etc. If the expression does not evaluate to the units assigned to the expression, errors will result.
x_p, y_p, lambda are expressions also?
Production: NX10.0.3.5 MP16/TC11.2
I'd rather be e-steamed than e-diseaseled
Wow, it finally works! Thank you very much.
For the record:
I have now created a separate expression: arc = arcsin((y_p-b)/b) and turned it manually into an angle because apparently arcsin does not automatically return its value as angle in degrees but as a length (at least that's what the error message told me). Then I replaced the asine() in x and y with "arc".
Just tested it with arc = asine((y_p-b)/b). Seems to work fine as well.
So out of curiosity: why does it not work in the form I posted originally? The description within NX for asine() is "Returns the inverse sine of a given number in degrees with angle dimensionality". So shouldn't this work properly without creating a separate expression?
EDIT: Oh and for some reason arcsin() cannot even be found in the function list? Is there a reason for this?
This is a problem with Law Curve. I found the following Final Response from PR 7376497; "Law Curve doesn´t work with Arcus-Sinus function", which helps explain the inconsistency:
The problem where a Law Curve doesn´t work with Arcus-Sinus function has been investigated and the following has been found. This is a known problem for the current "Law Curve" function which is not up-to-date with the expression system's change. The "Law" function is still using the original naming for system function as:
The (radians) functions list are:
acos -> rcos
asin -> rcos
atan -> rtan
atan2 -> rtan2
cosh -> cosr
sinh -> sinr
tanh -> tanr
The supported (degree) function list are:
So instead of using the "asine" please replace it with the original "arcsin".