How do you convert a function with complex numbers using the equation curve

How do you convert a function with complex numbers using the equation curve

Anonymous
Not applicable
2,726 Views
28 Replies
Message 1 of 29

How do you convert a function with complex numbers using the equation curve

Anonymous
Not applicable

I have an equation that creates a spiral and I'd like to draw it using Inventor.  However, the parametric equation curve places the vector in the wrong quadrant.  Here's the example.

 

F(r,t) = r cos(k ln(t)) - i r sin(k ln(t))

 

Entering r cos(k ln(t))  as the x(t) function and -r sin(k ln(t)) for the y(t) function does not give the same values as Mathematica or other, nor the resulting spiral.  Entering -r sin(k ln(t)) for the y(t) function does give something similar, except that the points are in the incorrect quadrant.  For instance, for t=2, the same angle from the x axis results, however it should be another pi/2 radians more to be that angle from the other side of the y axis, resulting in a spiral having more curl than the original.

 

What am I doing wrong?

0 Likes
Accepted solutions (1)
2,727 Views
28 Replies
Replies (28)
Message 2 of 29

swalton
Mentor
Mentor
Accepted solution

Does the local sketch coordinate system match the UCS?  Inventor has an automatic selection algorithm that makes odd choices....

 

The local sketch x-direction may match the part y-direction, or the z-direction, or some edge on the sketch surface.

Steve Walton
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Inventor 2025
Vault Professional 2025
Message 3 of 29

johnsonshiue
Community Manager
Community Manager

Hi! I think a common misunderstanding is the angular unit. The angular unit in Inventor by default is degree, not rad. You will need to go to Tools -> Document Settings -> Unit -> change it to rad if the equation is based on radian angle. Please attach the part here so forum experts can take a look.

Many thanks!

 



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
0 Likes
Message 4 of 29

Anonymous
Not applicable

My units are set to radians.

0 Likes
Message 5 of 29

Anonymous
Not applicable

Not sure, but maybe someone can try an example:

* Create a 2D sketch on the x-y plane

* Create an equation curve (parametric, 1 min to 50 uL)

* For x(t), enter 1/t^(0.8) *  cos(1.2 * ln(t))

* For y(t), enter -1/t^(0.8) * sin(1.2 * ln(t))

* Press enter

* Draw a circle (any diameter at x(t) = 1/2^(0.8) *  cos(1.2 * ln(2)) = 0.386861 (in the lower right hand quadrant

and y(2) = -1/2^(0.8) * sin(1.2 * ln(2)) = -0.424518 (0.424518 in the lower right hand quadrant) and check math at...

http://www.wolframalpha.com/input/?i=1%2F2%5E(0.8)+*+cos(1.2+*+ln(2))-i+1%2F2%5E(0.8)+*+sin(1.2+*+ln...))

 

Expected result: Or enter the same in Excel and the point should lie on the spiral.

Actual Result: The spiral created in Inventor does not come near that point.  Entering 1/t^(1/2) * sin(1.2 * ln(t)) for y(t) instead of -1/t^(1/2) * sin(1.2 * ln(t)) comes closer, but still...the spiral is not the same.

 

Hope that helps.

 

0 Likes
Message 6 of 29

Cris-Ideas
Advisor
Advisor

Hi,

I think you should read this: equation curve - how to constrain

 

could you clarify:

1) is the base of your ln in your original function 10 or e?

2) are i and k a real numbers? or integers?

3) can you post image of how does this what you want looks like?

 

Cris

Cris,
https://simply.engineering
Message 7 of 29

Cris-Ideas
Advisor
Advisor

Hi,

I think you should read this: equation curve - how to constrain

 

could you clarify:

1) is the base of your ln in your original function 10 or e?

2) are i and k a real numbers? or integers?

3) can you post image of how does this what you want looks like?

 

Cris

Cris,
https://simply.engineering
Message 8 of 29

Anonymous
Not applicable

"ln" is used instead of "log", thus the natural logarithm with base "e".  "i" means the value of the function is the imaginary part...or "y" axis coordinate.  It doesn't affect the equation otherwise, as the two functions are calculated separately.  "k" can be either an integer or a real number, as neither should affect the result.  I will try to attach some images.

0 Likes
Message 9 of 29

Anonymous
Not applicable

Ok...refer to screenshot. 

 

Mathematica places the value 

 

x(t) = (  (1/(t)^(0.8)) *  cos(1.2 * ln(t)) ) 

y(t) = ( -(1/(t)^(0.8)) * sin(1.2 * ln(t)) )

 

in the lower right hand quadrant, as it should be. 

 

http://www.wolframalpha.com/input/?i=(++(1%2F(2)%5E(0.8))+*++cos(1.2+*+ln(2))+)+%2B+i+(+-(1%2F(2)%5E...)

 

However, Inventor LT places it 180 degrees around zero (pi/2 radians).

 

Hope this helps.  Not sure what's going on with it.

Message 10 of 29

Cris-Ideas
Advisor
Advisor

Hi,

I do not think this powering is an issue as X^0,5 works fine.

 

Will look in to it once have a free moment. but still do not understand exactly this thing with imaginary part.

Can you explain this in as simple way as possible.

 

Cris.

Cris,
https://simply.engineering
Message 11 of 29

Anonymous
Not applicable

I agree, t^rational is not a problem...it's too early for me and I need more coffee.  Smiley Happy  I edited my response with a different screenshot.  Don't worry about the imaginary i, as I do not enter it into the y(t) equation at all.  But in short, a complex number is a vector point on a plane, just the same as (x,y) is.

0 Likes
Message 12 of 29

Anonymous
Not applicable

For more on complex numbers (and the imaginary part), you can read more at https://en.wikipedia.org/wiki/Complex_number 

 

but in short, it's simply a different way to express vector locations and then enter them into equations as a single function.  Instead of x(t) = something and y(t) equals something else, you get z(t) = x(y) + i y(t), where z is the "complex number" and y is the "imaginary part" of the complex number...x is the "real part"  It's not really "imaginary", as all numbers are imaginary.  After all, when was the last time you stubbed your toe on the number 5?  It's just a bad way mathematicians refer to the y axis.

0 Likes
Message 13 of 29

Anonymous
Not applicable

Type in one of my replies.  I wrote "pi/2 radians" when i meant "pi radians".  Anyway, I have a simple work around...just multiply y(t) by minus one.  Should do the trick.

0 Likes
Message 14 of 29

Cris-Ideas
Advisor
Advisor

Ok your initial function was :


 

F(r,t) = r cos(k ln(t)) - i r sin(k ln(t))

 


so r cos(k ln(t)) would be x(t) and

-r sin(k ln(t)) would be y(t)

 

so what are the parameter values for:

r, k,?

 

also what is the range for t you want this function for?

 

and what are the units for all of those.

 

I have tried your formulas from post but I am gettting strange function.

 

Cris

 

 

Cris,
https://simply.engineering
Message 15 of 29

Anonymous
Not applicable

.

you might want a look at this post Double Helix which can soon be converted for use within Inventor.

 

HTHs

 

 

Message 16 of 29

Anonymous
Not applicable

I gave an example above, but here it is again:

 

x(t) = (  (1/(t)^(0.8)) *  cos(1.2 * ln(t)) ) 

y(t) = ( -(1/(t)^(0.8)) * sin(1.2 * ln(t)) )

 

such that r = (1/(t)^(0.8)) and k - 1.2

 

...and then 1 min to 50 uL)

0 Likes
Message 17 of 29

Cris-Ideas
Advisor
Advisor

I tried it,

It works for me as xepected.

Velues are calculated correctly

I would need your file to check why it is not working for you.

Cay you post ipt.

complexed numbers curve.png

 

Cris.

 

 

Cris,
https://simply.engineering
Message 18 of 29

Anonymous
Not applicable

That is not the correct curve, as shown in your image.  The first value should begin at -1 on the x axis, as when t=1, the result of the function is x(t)=-1 and Y(t) = 0.  It is starting in the wrong quadrant.

0 Likes
Message 19 of 29

swalton
Mentor
Mentor

Take a look at the link in @Cris-Ideas post #6.  Per that discussion, equation curves in Inventor sketches are not constrained to the local coordinate system.  I am astonished by that answer, but I find no difference in Inventor 2018's behavior.

 

You will have use sketch constraints and dimensions to translate the start-of-curve to the proper point and rotate the curve correctly for your desired solution. 

 

I have attached a 2018 sample part for your review.

Equation 1 is based on this thread.

Equation 2 is based on @Cris-Ideas 2016 post

Equation 3 is something I made without trig functions to check behavior

 

@johnsonshiue, Is this correct behavior?  The example video in the help file shows an equation curve that is fully constrained.  http://help.autodesk.com/view/INVNTOR/2018/ENU/?guid=GUID-9527E927-0001-4A8F-822E-9A30064B6A8F  My expectation would be that the equation curve would be fully constrained by the equations and ranges, not free to be dragged and rotated by my mouse.

 

 

 

Steve Walton
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Inventor 2025
Vault Professional 2025
0 Likes
Message 20 of 29

Anonymous
Not applicable

I kind of get that sketches are not constrained to the local coordinate system, but I think they should at least plot them to the proper coordinate the equation sends them to...at least initially, not somewhere else.  Then the user could drag them where they want them to be.  Anyway, love Inventor LT.  No complaints, just gotta know how it works, making sure my math was right...and all's good.

0 Likes