cancel
Showing results for
Did you mean:
cancel
Showing results for
Did you mean:

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

15-Moonstone

## 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.

1 ACCEPTED SOLUTION

Accepted Solutions
23-Emerald III
(To:ifomenko)

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

9 REPLIES 9
23-Emerald III
(To:ifomenko)

I get this in Mathcad 11.

(The error messages are the same for all red evaluations).

Apparently it's not 'simple'.

Success!
Luc

15-Moonstone
(To:LucMeekes)

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

23-Emerald III
(To:ifomenko)

Then don't use the delta function, but use (i=j) instead:

Success!
Luc

23-Emerald III
(To:ifomenko)

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

15-Moonstone
(To:LucMeekes)

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!!!

24-Ruby V
(To:ifomenko)

@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.

15-Moonstone
(To:Werner_E)

Thank you, I forgot that symbolic engine doesn`t like branching.

15-Moonstone
(To:Werner_E)

One very simple and interesting result

24-Ruby V
(To:ifomenko)

Thats exactly the very same problem as you had here

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:

Announcements
Top Tags