Equation Curve - Error - Square-root of zero or negative number

Equation Curve - Error - Square-root of zero or negative number

coltong
Explorer Explorer
281 Views
1 Reply
Message 1 of 2

Equation Curve - Error - Square-root of zero or negative number

coltong
Explorer
Explorer

Hello, 

What I'm trying to do

I'm trying draw a an equation curve: 

  • File type:  .ipt 
  • Equation Type: Explicit, Cartesian
  • Desired range: xmin = 0 to xmax = 2.63
  • Equation:  11.75 in * PI * ( 0.32914 ul - ( 0.0290921 ul * sqrt(128 ul - ( 48.611533 ul * x ))))

The Problem 

Inventor will plot the equation from xmin = 0 to xmax =1.035 (see Image 1), but any value greater than 1.036 will output this error  "cannot evaluate square root or a negative number" (see Image 2).   The "128 ul - ( 48.611533 ul * x )" argument of the sqrt function is not negative over the range of xmin = 0 to xmax = 2.63.   

What the heck is going on?  I have attached an .ipt file with the equation curve. 

coltong_4-1640893450420.png

Image 1:  Plot works from xmin = 0 to xmax = 1.036 

 

coltong_5-1640893476180.png

Image 2:  Plot error for xmin=0 to xmax=1.04

 

Thanks for you help! 😄 

0 Likes
282 Views
1 Reply
Reply (1)
Message 2 of 2

TomaszDąbrowski
Enthusiast
Enthusiast

My opinion - this is a problem with units.

I will focus on this piece of exuation, because it must be positive:

(128 ul - ( 48.611533 ul * x ))

You mentioned that it works with x=1,036, so I asume that it doesn't work with x=1,037.

 

128-(48,611533*1,037) = 77,5898 - looks fine, but

128-(48,611533*1,037*2,54) = -0,04180 - is negative, let's check for 1,036

128-(48,611533*1,036*2,54) = 0,08167 - is positive

So when I multiply x by 2,54 (in-cm transformation) I get the results you described.

Coincidence? I don't this so 😉

0 Likes