![]() The obvious and most natural one is to strip all unitsĪnother approach is to make all elements the very same unitīoth ways above of course will give you a dimensionless solution. So you have a couple of choices to get polyroot to work. Polyroot(v) will always solve so that the scalar product of v with the vector of powers of x is dimensionless " no matter which of the first three elelements has the wrong unit (and disregarding the setting of ORIGIN).īut if you use polyroot with a vector of more than three elements and the wrong unit is in the fourth or higher element it will give you the appropriate element count (no matter what ORIGIN is set to, the first element is always "Element 0"). It will always tell you that "Element 2 of this vector must have units. The error message itself is a confusing (not necessarily wrong. So you found yet another function in Prime which still will not work as expected when used with units So you will never get an error that element 0 or element 1 should have a different dimension. You can provide ANY units for those first two values, but the third (and all following for polynomial of higher order) have to be consistent. Mathcad can't tell the desired unit of the resulting variable unless you provide units for the first two elements of the vector. If you supply km (or m, it doesn't matter) you get the correct result.Įven the eror message makes sense (though it wasn't helpful in your case). The correct unit for the coefficient of the linear element is length. In your first attempt you supplied no unit at all and in your second the wrong unit. And as Prime has dynamic unit checking you also have to supply the correct unit for a zero value. Polyroots() is fully unit aware and works intuitiv as expected - you just have to take care and use the correct units all over. Forget (most) of what I had written above.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |