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

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

Given find gives one solution when there are no or infinitely solutions, why?

henningsogaard
1-Newbie

Given find gives one solution when there are no or infinitely solutions, why?

Consider this:

The examples show that Mathcad 15 may be a dangerous tool when used for solving systems of linear equations. If we set up a system of linear equations and the equations by mistake becomes singular, we may not discover our mistake, since Mathcad returns a unique solution anyway.

Maple, Wolfram Alpha (Mathematica) and the TI-89 calculator return results that indicate if there are no, one unique og infinitely solutions. For the examples above Maple gives the follwing answer:

Is it possible to make Mathcad give more informative results in case of singular systems of equations?

/Henning

27 REPLIES 27

Give us an example?


Much easier to help if you post your worksheet with this example.

Henning Søgaard schrieb:

The examples show that

It seems that you intended to include a worksheet or at least screenshots but failed to do so.

If you solve your system numerically, the solution depends strongly upon the guess values provided and you get only one solution (at best). Thats OK, regarding that we have to do with a numerical approximation.

Solving symbolically either via solve from the symbolic palette or by evaluating a solve block symbolically without guess values, I agree, that Mathcad should at least warn if the solution calculated is not unique. If there is no solution you get a "no solution found" error anyway.

In case of an infinite number of solutions, by default you are presented with a single solution only unless you use the modifier "fully". See screenshots:

fully1.png

fully2.png

Please post an example worksheet.

Well, I copied the Mathcad-examples into the original post but for some reason it has disappeared. I cannot figure out how to attach a worksheet to this reply. I try to insert an image - here it is:

Linear+systems.jpg

To attach a file you have to activate the "extended editor". Link is in the upper right corner of the message window

According your first example see my remarks to "fully"

Your second example is bad - it should yield the "no solution found" error. Assume the reason being numerical inaccuracy even whilst using the symbolic evaluation. After all, using a solve block means using an iteration and approximation.

The symbolic solve does the job correctly

fully4.png

I thought that the Symbolic Evaluation arrow would always mean symbolic and not numeric evaluation. When I saw that the Given Find construct returned floating point results I realized that Mathcad may use numeric evaluation when the arrow is applied. This is rather confusing. Anyway, how does Mathcad do numerical evaluation without any starting guess?

It is not using the numeric processor. The symbolic processor can do arbitrary precision arithmetic, which is what it is doing in this case. It's not solving it iteratively though, and therefore does not need guess values. When there are no floating point numbers in the expressions it's supposed to do exact, integer, arithmetic though, unless you specify otherwise using the float keyword.symbolic+find+bug.jpg

You get the same result using the float keyword with the default value of 20. I would call this a bug.

ELSID
4-Participant
(To:RichardJ)

What version of 15 are people using, M010? I do not have access to MC at the moment, but there was a recent update to MC 15 that may have added or solved this issue. Just trying to help pinpoint if its an existing "bug" or a new one

RichardJ
19-Tanzanite
(To:ELSID)

M010. I can't get the update though. I have no use for maintenance other than the updates, and I am not willing to pay the amount they are asking just for a few bug fixes.

Werner_E
25-Diamond I
(To:ELSID)

ELSID schrieb:

What version of 15 are people using, M010? I do not have access to MC at the moment, but there was a recent update to MC 15 that may have added or solved this issue. Just trying to help pinpoint if its an existing "bug" or a new one

I'm using MC15 M020 dating from 2012-11-27 which AFAIK is the latest release. As Richard and me both have that issue, it looks like they did neither have added nor solved that issue.

Werner_E
25-Diamond I
(To:RichardJ)

The symbolic processor can do arbitrary precision arithmetic, which is what it is doing in this case. It's not solving it iteratively though,

Are you sure about that? I don't have any insight in the internal matters but have always thought that a solve block would be solved by iteration, no matter if evaluated numerically or symbolically. On the other hand, the question why symbolical eval doesn't need guess values is a good one.

RichardJ
19-Tanzanite
(To:Werner_E)

Are you sure about that?

Yes, but only because it doesn't need guess values

Wow, thats strange. Multiplying the first equation by 3 or dividing the second by by 3 yields the (correct) "no solution found" error. Whats going on here??

fully5.png

Even the order of the two equation matters

fully6.png

So clearly - if you want to be on the safe side, use symbolic solve and/or check your matrix for singularity yourself.

Werner,

Can you attach this Mathcad worksheet with error?

Werner_E
25-Diamond I
(To:VladimirN)

Can you attach this Mathcad worksheet with error?

Sure, here it is. But the error is OK as that system has no solution.

The only thing which is misleading is the first evaluation which gave a result. Richard called it a bug.

RichardJ
19-Tanzanite
(To:Werner_E)

Richard called it a bug.

Either that. or a very undesirable "feature"

Werner_E
25-Diamond I
(To:RichardJ)

Richard Jackson schrieb:

Richard called it a bug.

Either that. or a very undesirable "feature"

I agree, fully

But if you then think that Mathcad's solve should default to "fully", look at the next screenshot and reconsider your opinion 😉

fully3.png

It makes sense that it is up to the user to use "fully" or not. On the other hand, if the user does not apply "fully" when solving a system of equations with infinitely solutions it would be nice with a warning, just as you pointed out earlier.

In one of the examples where you applied "fully" I noticed that solve introduced a complex parameter (_z) in the answer. I tried to restrict the answer to the real domain by applying the condition y = real as follows but it didn't have any effect.

Untitled.jpg

Why is that?

Since Mathcad switched from Maple to muPad as the numeric processor with version 14, all calculations default to domain complex (in older Mathcads you had to use the modifier complex to get into that mode). Unfortunately restricting solutions to domain real never worked reliable as it should - i would call it a bug. Often calculations are not simplified the way we would do it by hand, simply because Mathcad is not willing to accept an "assume, ALL=real" condition. Those arbitrary values _z, _z1, etc., Mathcad throws in in under-determined situations, seem to default to domain complex all the time.

A similar bug^, which was discussed here not long ago, is, when you try to force a variable x ,you solve for, to be integer, by applying the condition trunc(x)=x. It simply doesn't work. Either MC finds no solution or the condition is ignored.

I just played around with assume (as I thought that it would not make sense to apply assume,y=real after solve, as then no y ist present anymore). But I found another buggy behaviour. Look at the effect which "assume,y=real" has on the name of the arbitrary variable compared to "assume,ALL=real".

fully6.png

RichardJ
19-Tanzanite
(To:Werner_E)

Since Mathcad switched from Maple to muPad as the numeric processor with version 14,

Symbolic processor

Unfortunately restricting solutions to domain real never worked reliable as it should - i would call it a bug.

It's not a bug. It just doesn't work very well. With the Maple symbolic engine it was not possible to force the domain of the solution at all. At least, not in one step. Even now, I tihnk the best approach is to get the full result first, then mess around with that to restrict the domain.

A similar bug^, which was discussed here not long ago, is, when you try to force a variable x ,you solve for, to be integer, by applying the condition trunc(x)=x. It simply doesn't work. Either MC finds no solution or the condition is ignored.

Do you mean with the numeric processor? That's not a bug. It's just a limitation of the solver. It can't handle flat regions in the objective function, because when it iterates nothing changes. There used to be a solving extension pack that had functions that could obtain integer solutions, but it dosen't work with any version after MC11

Werner_E
25-Diamond I
(To:RichardJ)

Symbolic processor

Yes, of course.

It's not a bug. It just doesn't work very well. With the Maple symbolic engine it was not possible

You're right. Just a fine difference.

Do you mean with the numeric processor? That's not a bug. It's just a limitation of the solver. It can't handle flat regions in the objective function, because when it iterates nothing changes. There used to be a solving extension pack that had functions that could obtain integer solutions, but it dosen't work with any version after MC11

Yes, you are right. I was thinking on an exemple from http://communities.ptc.com/message/193351#193351

In that solve block I had to disable at least one (any one) of the three trunc-conditions to get the numeric solver to find a solution. Strange enough with all three enabled the erreor message was not "no solution found" but "this variable is undefined" (tracing guided me to the denominator of the RHS fraction and the expected "no solution was found").

Symbolic evaluation results in a "no solution found" even if only one trunc-condition is enabled.

11.01.png

RichardJ
19-Tanzanite
(To:Werner_E)

Strange enough with all three enabled the erreor message was not "no solution found" but "this variable is undefined"

Starting in MC12, with the numeric solver that's the only error you ever get from a solve block. It doesn't matter what the actual problem is.

Sorry, for a linear system we must use "linear" tools:

lsolve.png

Sorry, for a linear system we must use "linear" tools:

This means that for a given system of equations you first need to determine whether it is linear or not, and if it is linear you must form the M and v matrices. These steps are indeed not very difficult to accomplish, but on the other hand it would be easier if you could always put the equations directly into a solve command whether they are linear or not. Does Mathcad provide functions to test linearity at to extract M and v.

An old ox (Mathcad 11 with Maple not MuPad) makes a straight furrow:

solve11.png

Announcements

Top Tags