turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Close

Inventor General Discussion

- Autodesk Community
- >
- Inventor
- >
- Inventor General Discussion
- >
- Equation driven curve - unit error

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page

Contributor

20 Posts

2 Kudos

Registered:
11-23-2013

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

746 Views, 23 Replies

11-27-2013 07:42 AM

Hi there,

I would like to create an equation driven curve with inventor. I have no problems plotting the function in a plotter, however, inventor won't accept my equation. It gives me the error message, saying: "The equation contains unit errors". I'm using the explicit equations.

That's the bare equation:

"y=sqr(2)*16.5/2/sqr(pi)*sqr(arccos(1-2*x/50)-(sin

I modified it, inserting variables which I defined also in inventor, leading to this:

"sqrt(2)*height/2/sqrt(PI)*sqrt(acos(1-2*t/length)

But both equations are not accepted by inventor due to unit errors. In this design, I'm using the metric system, millimeters, so I don't understand why and how I have to redefine this for the equation in order to get it working.

I would appreciate your help,

Max

Solved! Go to Solution.

Solved! by GlennChun. See the answer in context.

Hi Max,

I've got a solution for you.

I entered the following equation:

multiplier * sqrt(acos(1 ul - 2 ul * x / length) / 1 rad - sin(2 rad * ( acos(1 ul - 2 ul * x / length) / 1 rad )) / 2 ul)

Change the first two user parameters (**length** and **height**), and the equation curve will update accordingly.

The attached IPT file can be opened in Inventor 2013 or later.

Hope this helps,

Glenn

Valued Contributor

66 Posts

15 Kudos

Registered:
02-23-2009

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

11-27-2013 07:55 AM in reply to:
19112033

Beyond the fact that the equation has unmatched brackets, it could also be because of mixed units (if any).

This gives me an error (i.e. turns red) when I type it into a user defined parameter

sqrt(2 ul) * height / 2 ul / sqrt(PI) * sqrt(acos(1 ul - 2 ul * t / length) - sin(2 ul * acos(1 ul - 2 ul * t / length)) / 2 ul))

However, if you remove the last bracket, it works.

HTH

Not sure of what the equation represents -- might be easier to find the errors (and have someone else understand it) if you broke it down into subcomponents.

This gives me an error (i.e. turns red) when I type it into a user defined parameter

sqrt(2 ul) * height / 2 ul / sqrt(PI) * sqrt(acos(1 ul - 2 ul * t / length) - sin(2 ul * acos(1 ul - 2 ul * t / length)) / 2 ul))

However, if you remove the last bracket, it works.

HTH

Not sure of what the equation represents -- might be easier to find the errors (and have someone else understand it) if you broke it down into subcomponents.

Contributor

20 Posts

2 Kudos

Registered:
11-23-2013

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

11-27-2013 08:18 AM in reply to:
conklinjm

I'm quite new to Inventor and not familiar how the program handles equation. E.g. it's totally new for me to specify units in an equation.

BTW: I forgot a bracket in my first post, sorry about that.

Breaking the equation down into subcomponents:

First of all you have the first part, which works without problems:

sqrt(2)*16.5/2/sqrt(PI)

The second part is a bit more complex:

sqrt(acos(1-2*x/50)-(sin(2*acos(1-2*x/50))/2))

So let's break it down a little.

You have this element:

acos(1-2*x/50)

And you want to subtract the following:

(sin(2*acos(1-2*x/50))/2)

So you have this:

acos(1-2*x/50)-(sin(2*acos(1-2*x/50))/2)

Now you want to calculate the square root of this difference:

sqrt(acos(1-2*x/50)-(sin(2*acos(1-2*x/50))/2))

In the end, you multiply this part with the first, resulting in this:

sqrt(2)*16.5/2/sqrt(PI)*sqrt(acos(1-2*x/50)-(sin(2*acos(1-2*x/50))/2))

So, I hope you could grasp how this equation is build up.

Anyway, if I enter this equation, as is, into Inventor, i get the following error messages:

1: Cannot evaluate inverse cosine outside of the range [-1,+1]

2: Cannot evaluate square-root of zero or a negative number

Why can't Inventor calculate the square-root of zero? sqrt(0) is defined as zero.

There seems to be a problem with my equation, but I can't find it.

Thank you for your help so far,

Max

Valued Contributor

66 Posts

15 Kudos

Registered:
02-23-2009

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

11-27-2013 09:14 AM in reply to:
19112033

It probably comes down to a unit error ... try this.

sqrt(2 ul) * 16.5 in / 2 ul / sqrt(PI) * sqrt(acos(1 ul - 2 ul * x / 50 in) - ( sin(2 deg * acos(1 ul - 2 ul * x / 50 in)) / 2 in ))

Certain functions _require_ a specific type of unit for them to calculate correctly -- for example if x is expecting a unit of 'in' and is given '1 ul' it evaluates it as 0.393701" which is not anywhere near what the intent of the design. Best approach is to go function by function and verify that both the inputs and outputs have the expected units.

HTH

sqrt(2 ul) * 16.5 in / 2 ul / sqrt(PI) * sqrt(acos(1 ul - 2 ul * x / 50 in) - ( sin(2 deg * acos(1 ul - 2 ul * x / 50 in)) / 2 in ))

Certain functions _require_ a specific type of unit for them to calculate correctly -- for example if x is expecting a unit of 'in' and is given '1 ul' it evaluates it as 0.393701" which is not anywhere near what the intent of the design. Best approach is to go function by function and verify that both the inputs and outputs have the expected units.

HTH

Contributor

20 Posts

2 Kudos

Registered:
11-23-2013

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

11-27-2013 09:42 AM in reply to:
19112033

Thank you for your help. Now we have eliminated the second error, but the first is preventing the curve to be drawn. There must be something wrong with the acos. But the strange thing is, that I can plot this function without problems in a plotter. Why not in Inventor?

Looking forward to an answer,

Max

*Expert Elite*

4,374 Posts

517 Kudos

Registered:
04-27-2005

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

11-27-2013 10:18 AM in reply to:
19112033

19112033 wrote:

.........

sqrt(2)*16.5/2/sqrt(PI)

The second part is a bit more complex:

sqrt(acos(1-2*x/50)-(sin(2*acos(1-2*x/50))/2))

So let's break it down a little.

You have this element:

acos(1-2*x/50)

........

Thank you for your help so far,

Max

The reason that this does not work is because your units are not what Inventor expects them to be. For instance, the equation acos(1-2*x/50). Inventor expects the units of the input to be unitless and it will output this in degrees. You can find the input and output in the help. Search for "algebraic operators". It should be close to the top of the list.

If you enter acos(1-2*x/50) as an equation, it will fail (x is also defined in the parameters in units (mm)).

In order to get it to work, multiple the length units by (1ul/1mm)

Kirk

*Expert Elite*

4,374 Posts

517 Kudos

Registered:
04-27-2005

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

11-27-2013 10:43 AM in reply to:
19112033

19112033 wrote:

Thank you for your help. Now we have eliminated the second error, but the first is preventing the curve to be drawn. There must be something wrong with the acos. But the strange thing is, that I can plot this function without problems in a plotter. Why not in Inventor?

Looking forward to an answer,

Max

Now, I am thinking there is something wrong with the ACOS function also. When I enter a simple equation in the equation curve, I get this error "Cannot perform division with a zero denominator". There is NO zero in the denominator.

If I change the formula to a COS function, it works.

Sorry if I mislead you.

Kirk

Contributor

20 Posts

2 Kudos

Registered:
11-23-2013

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

11-27-2013 12:04 PM in reply to:
19112033

Well, if you insert your minimum value of x (which in your case is zero), then you have a denominator of zero. If you change your xmin value to one, it should work. Thats all very strange...

*Expert Elite*

4,374 Posts

517 Kudos

Registered:
04-27-2005

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

11-27-2013 12:44 PM in reply to:
19112033

In my equation y=ACOS (x/1mm), the denominator is always "1mm". The numerator varies from 0 to 1.

If:

x=0... then the formula should be ACOS (0/1), which equals 90 deg.

x=1... then the formula should be ACOS (1/1), which equals 0 deg.

Employee

121 Posts

38 Kudos

Registered:
06-10-2004

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

11-27-2013 03:46 PM in reply to:
karthur1

I looked into the ACOS issue. Mathematically speaking, the arcsine and arccosine functions should take any input value from -1 to 1. However, Inventor seems to take a value a little less than 1, such as 0.999999, but not 1 itself. Attached is an Inventor 2013 part that shows an inverse cosine curve:

Once the tmin and tmax are changed to -1 and 1, respectively, Inventor shows an error message:

I'm logging a defect against the above issue in ACOS and ASIN. Defect number is 1510653.

Glenn

Search This Board

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Post to the Community

Have questions about Autodesk products? Ask the community.

The Knowledge Network

Access a broad range of knowledge to help get the most out of your products and services.

Download & Installation

Getting your Software

Downloads & Upgrades

Serial Numbers & Product Keys

Installation & Licensing

Activation & Registration

Network License Administration

Subscription Management

Sign In / Create Account

Maintenance Subscription Help

Desktop Subscription Help

Cloud Service Subscription FAQ

Announcements

Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!

- Privacy | Legal Notices & Trademarks | Report Noncompliance | Site map | © Copyright 2014 Autodesk Inc. All rights reserved

Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. Please see the Autodesk Creative Commons FAQ for more information.