The PTC Community is on temporary read only status in preparation for moving our community to a new platform. Learn more here
I have a code that is looking through the matrix and selects creepage based on my input parameters (PD, MG and working voltage WV). It works great....in picture 1.
picture 1
Now, I want to add a linear interpolation between 2 values of the voltage. I made a variable "a" doing linear interpolation and tested it works as expected, which it do. Column variable for searching in matrix is hardcoded at the beginning for test.
Now, since it work, code A (linear interpolation of the creepage) replace code B (that is using only search method w/o interpolation) in the original code.
That is the only change in original code. Code A is tested it works, gives values I need but after A replaces B function that is calling creepage(WV,PD,MG) is complaining "These units are not compatible". What am I missing? I dont see any problem there.
thanks
Running on Mathcad Prime 11.0.1.0
Solved! Go to Solution.
Thank you Wener,
I removed volts from the function and noticed I already strip WV of the units in parameters passed to the function when I call it. That fixed the problem.
Its hard to debug just a picture. So if possible you should post the sheet itself or at least create a sheet using dummy data which shows the same undesired effect.
In your last picture the code to the left looks like vector WV has unit Volt, but the elements in matrix creepage.IEC are dimensionless.
But in the code to the right it looks like both WV as well as creepage.IEC have the same units, possible both are dimensionless. So just replacing Code B by Code A must fail because of the division of WV by unit Volt in Code A.
BTW, is there any reason you code the linear interpolation yourself and don't use Prime's "linterp" function?
Thank you Wener,
I removed volts from the function and noticed I already strip WV of the units in parameters passed to the function when I call it. That fixed the problem.
