Pattern match exception problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Pattern match exception problem
Hi
I`m trying to make simple calculation but without success. What`s the problem?
MC15 file is attached for convenience.
Thanks in advance.
Solved! Go to Solution.
- Labels:
-
Other
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Or use this alternative definition of it:
(The symbolic processor is not so fond of programming constructs, it likes pure mathematical expressions better.)
Success!
Luc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I get this in Mathcad 11.
(The error messages are the same for all red evaluations).
Apparently it's not 'simple'.
Success!
Luc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Problem is in delta function, if you change it by 1 for example everything is OK.
If you change double sum by two summing loops inside program block everything is OK too!See attached file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Then don't use the delta function, but use (i=j) instead:
Success!
Luc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Or use this alternative definition of it:
(The symbolic processor is not so fond of programming constructs, it likes pure mathematical expressions better.)
Success!
Luc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Problem is not to find answer but understand why mistake is.
But thank you for very short and elegant delta function and it really works!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@ifomenko wrote:
Problem is not to find answer but understand why mistake is.
The reason for the error is, that Mathcads symbolics always try to evaluate and simplify symbolically all used expressions and functions before it applies specific values or patrameters.
Obviously it can't symbolically evaluate an if-statement, because it usually can't know if the condition is fulfilled or not, as this depends on the values of the specific arguments.
In case of your double sum Mathcad could know which branch to chose, but it looks like it tries to evaluate and simplify the expression in the sum before the sum is evaluated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you, I forgot that symbolic engine doesn`t like branching.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
One very simple and interesting result
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thats exactly the very same problem as you had here
https://community.ptc.com/t5/PTC-Mathcad/Symbolic-issue/td-p/655681/jump-to/first-unread-message
Seems like the symbolic doesn't like strings
I just gave it a try in Prime 6 and the new symbolic (while in many cases weaker and less capable even compared to muPAD) does not have this problem:
