Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X
Hm...I think I found a way:
We can see that only these 4 values (roots) are repeated: -0.439-1.077i, 0.584-0.431i, 0.274+0.784i, and -0.648+0.852i.
Now I am interested in how to extract/retain only those unique 4 values?
Depend on TOL. So need UniqueP function to select 4.
A(x) is not an array?
I do not know how to think at the differences between the two. I see that when defining x as not integer values (0.1, 0.2, 0.3, etc), then I cannot use like Cx and also I cannot use further UniqueP function. On the other hand when defining range variable as y (1,2,3, etc, integer values), then I can use UniqueP function but only when defining with matrix index as B. Maybe someone can explain a little bit this function UniqueP, and also why I cannot use A(x) with UniqueP function.
You cannot, I repeat cannot, use a non-integer range definition to index a Mathcad array. You can only use integers in the range ORIGIN .. 2^31-2 to index a Mathcad array.
Consequently, Cx fails because x is a real (ℝ) range variable. By succeeds because y is an integer (ℤ) range variable. The first element of B is zero because you didn't define it (your ORIGIN = 0, but y starts at 1; all undefined elements with valid indices have the default value of zero).
A range variable is NOT a vector; it is a separate data type. Consequently, it is that rare beast that may look like a duck and even walk like a duck occasionally but is most definitely not a duck.
When Mathcad sees a range variable on the left hand side of an evaluation or definition operator it treats the range variable as an iterator over the implied sequence given by the range definition (range operator with values). When you evaluate A(x) and D(y), Mathcad iterates over x and y and applies A and D to those values individually and writes the result to the screen individually.
What you then see on the worksheet looks very much like a vector but is actually best thought of as a list of separate values stacked on top of each other. So,, when you try to apply UniqueP to A(x), what's really happening is that Mathcad is trying to apply UniqueP to A(x) for each single value of x in turn; as A(x) returns a scalar and UniqueP expects to see an array (to take the row of), Mathcad raises an error.
Now, B really is a duck, sorry vector, so UniqueP is happy with it and returns the expected value.
Range Variables - confusing Mathcadders for over 30 years.
Stuart
Success!
Luc
Interesting!
Needless to say that the symbolic solve does not work that way in non-MC11 versions.
The symbolic would switch to float mode and returns just one solution.
Based on the graphic, it is difficult to say whether the four spikes only 'touch' the floor plan at one point (just four solutions), or whether they penetrate it and the solution consists of four circle-like shapes. In the latter case, however, there would be an infinite number of solutions, not just 43... Can you plot the solutions in the Gauß-plane?
I guess you want to see this:
or (sorted on angle) like:
Success!
Luc
Thanks.
What I had in mind was an xy-plot Im(sroots) over Re(sroots). Just unconnected points.
Guess thats basically what your second plot shows.
Interesting that it seems to not correspond with the 3D plot I made.
I also used uno's implicitplot2D to plot the zeros of the absolute values of f(z). But it did not find any, probably because of numerical inaccuracies. but when I look for complex arguments with |f|=0.5, I get a result which corresponds perfectly with the four (and only four) solutions found:
I also plotted the zeros of Re(f) and Im(f) and it indicates, too, that there are only four solutions.
Worksheet in Mathcad 11 format attached
What do you thing that the many solutions which the symbolics in MC11 had found stem from?
Did you check the function values of your solutions vector?
Good point, I forgot to check the roots. As it appears of that long list, only the last four seem to come close to 0:
that makes the four roots to be:
or, in the total picture:
I think Mathcad/Maple used the polyroots function on the polynome:
And this was caused by the fact that I set the function up with all integers (writing 16/10 instead of 1.6 etc.)
Considering that the undocumented trick using solve as a symbolic function gives:
Now I see where 43 roots came from.
Ok, with the function defined with fractional exponents (1.6, -2.7) I get only a single root:
Which is just the first (!) of the long list, and not a root at all.
Conclusion: Care must be taken with such expressions.
Success!
Luc