Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Degrees vs. Radians in ProE 1

Status
Not open for further replies.

treddie

Computer
Dec 17, 2005
417

In ProE/Creo, for some reason I cannot fathom, PTC breaks from mathematics tradition by using degrees instead of radians in its calculations. This may be fine for simple functions, such as Sin(THETA), but completely fails for more complicated functions such as:
Cos(THETA) + THETA * Sin(THETA).

Because of this, the following will not work in a Curve From Equation scenario in ProE:

Code:
rb = .45333
ro = .53928

/*  "t" is ProE's internal counter variable (analogous to "trajpar"), and counts from 0 to 1.

/*  This equation is naturally with respect to radians, so the last term in parens converts from rads to degs:
THETAstop = ((Sqrt(ro - rb) * Sqrt(rb + ro)) / rb)     *     (180/pi)

/*  Now comes the "fun" part, where ProE's insistence on using degrees causes failure:
x = rb * (Cos( t * THETAstop ) + ( t * THETAstop ) * Sin( t * THETAstop ))
x = rb * ( Sin(t * THETAstop ) - ( t * THETAstop ) * Cos( t * THETAstop ))

The last two equations are what they are and must be calculated with respect to radians, NOT degrees. So what is the solution to this conundrum?
 
Replies continue below

Recommended for you

OK, I think I found the problem. The key is to apply a units conversion at only three particular points...Not for all instances of THETAstop:
/* Convert rads to degs:
THETAstop = ((Sqrt(ro - rb) * Sqrt(rb + ro)) / rb) * (180/pi)

/* Convert only one spot in each equation back to rads, before solving:
x = rb * (Cos( t * THETAstop ) + ( t * THETAstop*(pi/180) ) * Sin( t * THETAstop ))
x = rb * ( Sin(t * THETAstop ) - ( t * THETAstop*(pi/180) ) * Cos( t * THETAstop ))

The reason is obvious...A trig function of an angle will always give the same result regardless of units, provided the angle is in the correct units for the solver.
The second and third equations, however have a scalar applied (THETAstop), and this must be converted to radians before use.

 
Another reason why my answers were coming out wrong is that I was expecting certain values of x and y, but did not take into account that I needed PROJECTED values. So along with the conversion thing, what I was getting back was bunk.
 
There is an alternative to conversion - Under the Utilities there is the option to select units.
 
robertlib,

Where is that exactly? I can find a Utilities menu when I start up the Relations editor, but when you do a Curve from Equation, all you get is the WordPad interface with no way to change units.
 
It's in the standard relations editor (its also in the equation editor in creo 2). All it does is add [rad] or {deg] after the variable/number.
 
Hm...I'm stuck then, I guess until I can get Creo 2. I only have Creo v5 m080.
 
If you look in your standard relations editor, you should find the same thing (I remember units being in Wildfire 3) - which means that in principle, you should be able to add [deg] or [rad] after the variable/number and get an accurate result.
 
I guess that means avoiding "Curve from Equation" and going directly to a part level relation to do the same thing.
 
You could try to use the [deg] and [rad] in the equation editor - they have changed the format in Creo 2.0 to look like the standard relations editor, but I suspect that the underlying programming for the equations is identical to that of the relations.
 
Ahhhh, OK. Just like a standard function.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor