cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

Define variables for multiple functions

ptc-4871672
1-Visitor

Define variables for multiple functions

I have defined variables for phi and delta. I used these variables in a function which came to the correct result. I used them in another function right below and was given the wrong value. After substituting the variable with the actual value, I got the right answer. How do I define the variables correctly for more than a single function? FIle is attached. Please advise.

ACCEPTED SOLUTION

Accepted Solutions
RichardJ
19-Tanzanite
(To:ptc-4871672)

With a quadratic in phi that must be an empirical formula, therefore the coefficients assume phi is a numerical value, but with particular implicit units. In this case, degrees. You must therefore divide phi by that unit in the formula. If you do it this way, rather than manually entering the numeric values, the formula will work whether you define phi in degrees or radians.

View solution in original post

5 REPLIES 5

In the term (0.8152-0.0545phi+0.001771*phi^2), you can not substitute in 34 for phi. That has to be converted to radians.

The function was based on regression analysis of phi and delta in degree. So I cannot convert them to radian. As you can see in the calcualtion below. Both phi and delta were input in degee. The calcualted value (i.e., 4.731) is the correct answer. I think the problem is related to how to define phi and delta as globle variables. Any other suggestions?

Oh, so those coefficients were from a regression that you performed elsewhere. Hmmm, in that case, the coefficients actually do contain some sort of units. Are you doing the regression in Excel. I would recommend one of two things:

1) Repeat the regression in radians. This basically eliminates the need for units (at least in terms of angles).

2) Do the regression in Mathcad!

RichardJ
19-Tanzanite
(To:ptc-4871672)

With a quadratic in phi that must be an empirical formula, therefore the coefficients assume phi is a numerical value, but with particular implicit units. In this case, degrees. You must therefore divide phi by that unit in the formula. If you do it this way, rather than manually entering the numeric values, the formula will work whether you define phi in degrees or radians.

It is correct. Thanks.

Announcements

Top Tags