NaN as a result
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
NaN as a result
I don't know why I getting this kind of result.. I tried everything. It is on page 15 . I use prime 9
Thanks in advance for your help
Solved! Go to Solution.
- Labels:
-
Algebra_Geometry
-
Civil_Engineering
-
Other
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Whenever in any calculation a NaN is involved, the result is NaN.
Maybe a utility function to do the vector multiplication ignoring any multiplications with NaN involved could help:
Applied to your calculation it looks like this:
Is this somewhere near to what you expected?
The calculation takes some time as Prime has to multiply 3669*2=7338 times two 3670x1 vectors and a user-written function using augment and filterNaN isn't very fast.
Prime 9 sheet attached
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@YA_10963798 wrote:
I don't know why I getting this kind of result.. I tried everything. It is on page 15 . I use prime 9
When you multiply any pair of vectors that contain at least one NaN, the result is also a NaN.
Stuart
I've got Mathcad Prime 10, so I can't post a worksheet that's useful to you. Sorry.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
so that means the whole results will be NaN.. and that will erase all other results?.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Stuart
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
thank you for trying . I appreciate your time
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Whenever in any calculation a NaN is involved, the result is NaN.
Maybe a utility function to do the vector multiplication ignoring any multiplications with NaN involved could help:
Applied to your calculation it looks like this:
Is this somewhere near to what you expected?
The calculation takes some time as Prime has to multiply 3669*2=7338 times two 3670x1 vectors and a user-written function using augment and filterNaN isn't very fast.
Prime 9 sheet attached
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you that solved my problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@Werner_E wrote:
Whenever in any calculation a NaN is involved, the result is NaN.
Maybe a utility function to do the vector multiplication ignoring any multiplications with NaN involved could help:
The calculation takes some time as Prime has to multiply 3669*2=7338 times two 3670x1 vectors and a user-written function using augment and filterNaN isn't very fast.
Out of idle curiosity, I wondered what you meant by "takes some time". Now I know.
Surprisingly, a brute force and ignorance method offers better performance.
Stuart
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Not such a big surprise. I suspect that "filterNaN" is the main bottleneck and not "augment" or the column selector.
The if function seems to be faster even though its used in the loop.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@Werner_E wrote:
Not such a big surprise. I suspect that "filterNaN" is the main bottleneck and not "augment" or the column selector.
The if function seems to be faster even though its used in the loop.
Indeed, filterNaN does seem to be the larger bottleneck. However, augment is not entirely innocent in these proceedings.
Stuart
