Hello,
I think that I reached the full capability of Mathcad Prime 8 regarding the symbolic calculation. Or I am wrong?
Can somebody run this sol2 determinant in Mathcad Prime 9 to see the result?
Mathcad Prime 8 file attached.
Solved! Go to Solution.
Here is what I see in Prime 9 when I recalculate your sheet.
As you can see the result for the determinant is much nicer, the one for the inverse seems to be as ugly than what you got in P8.
Using 0.8 forces the symbolics in some sort of numeric/floating point mode (unfortunately).
If possible its always worth a try to change float numbers to fractions with integers.
You may use the "float" modifier yourself if appropriate
Experimenting with the number of significant digits in "float" can give unexpected results
Not sure where the factors 1.0 stem from. Most of them go away if we omit the "collect" modifier - strange!
My Mathcad
Uh, I do not understand Russian language, but I think it is the same result that my above result, right? And your Mathcad is Mathcad Prime 9?
Can somebody run this sol2 determinant in Mathcad Prime 9 to see the result?
Very same effect in Prime 9, too.
Prime allows to display the numerator of the first element, but the denominator is too large in the opinion of Prime.
Actually its not a limitation of the symbolics itself as you get a result which you could assign a function (with 25 arguments) which then could be used for further calculations.
Its just an artificial display limitation as the developers thought that it would not make much sense to see an expression that huge and decided to save the memory which would otherwise needed for displaying the result.
Here with less typing efforts:
You may also use this for a more compact display (up to a 9x9 matrix)
I am wondering: what is the possible solutions to this thing? Some workarounds exist?
@Cornel wrote:
I am wondering: what is the possible solutions to this thing? Some workarounds exist?
For me its not a problem which needs a solution.
If its a problem for you, you may contact PTC support and open a support case. Tell them why its a problem and talk them into modifying Prime so that larger results could be displayed on screen (maybe like it could be done in Mathcad 11 by using a registry entry).
As I see it you have four options
Hi,
I think that I reached the full capability of Mathcad Prime 8 regarding the symbolic calculation. Or I am wrong?
Answer is Prime will do a larger matrix, but why reinvent the wheel. You can just use the inbuilt function in Prime that can handle any matrix size!
The definition of the function sol2 as well as its symbolic evaluation is rather useless with this approach, isn't it? The last region in your screen should would be all thats needed. But your function shows what I tried to explained in my previous answer - its not a limitation of the symbolics itself as it returns a valid result which can be assigned a function and used numerically.
I, too, don't understand why @Cornel insists on displaying such huge expressions but obviously, for reasons unknown to us, the goal of his attempts is to get the general symbolic result displayed on screen, not a numeric one. I guess he knows that he always can get a numeric result for much larger matrices if needed.
@Werner_E wrote:
I guess he knows that he always can get a numeric result for much larger matrices if needed.
Yes, I know that, but here the problem is how to calculate symbolically the DETERMINANT and INVERSE of the matrix, not how to calculate numerically the DETERMINANT and numerically INVERSE of a matrix.
For example, look:
Result of the determinat with Wolfram Mathematica:
Result of the inverse of that matrix with Wolfram Mathematica:
Do you see the differences? The results of the two (determinant and inverse of matrix) from the two software are not displayed the same.
My question here: is it possible to see also in Mathcad Prime the same results of the determinant and inverse as it is shown in Wolfram Mathematica?
These results in Mathcad Prime with those great powers in calculation of the determinant (x^17 at numerator and x^12 at denominator) and inverse of matrix (x^33 at numerator and x^34 at denominator) seems strange...and I do not know why it looks like this and why Mathcad Prime gives the results in this manner.
Here is what I see in Prime 9 when I recalculate your sheet.
As you can see the result for the determinant is much nicer, the one for the inverse seems to be as ugly than what you got in P8.
Using 0.8 forces the symbolics in some sort of numeric/floating point mode (unfortunately).
If possible its always worth a try to change float numbers to fractions with integers.
You may use the "float" modifier yourself if appropriate
Experimenting with the number of significant digits in "float" can give unexpected results
Not sure where the factors 1.0 stem from. Most of them go away if we omit the "collect" modifier - strange!
Thank you, Werner.
Here I have another example from one of my past post:
Determinat of s*identity(7)-Aa matrix:
Not Good
Good
Inverse of s*identity(7)-Aa matrix:
Not Good
Not Good
Good
So, it is seems so far that the "problem" at Mathcad Prime is that he (Mathcad Prime) doesn't like calculation with decimal numbers...
Is there any method by which to convert Mathcad decimal numbers into fractional numbers automatically?
Or the only option here in this case is to look at each number in the matrix and manually change each number from decimal to fractional?
I don't think that conversion from a float number to a fraction with integers can be automatized in a way so the symbolic would accept it.
To get an integer we could turn the number into a string, delete the decimal point and convert the resulting string back to a number, but the symbolic does not understand the necessary functions num2str and str2num.
We could multiply the number x with 10 so often until x=trunc(x), but the symbolics nonetheless would treat the result as a float number when input value contains a decimal point.
Look:
-0.811, -1.273 and 0.637 change further in the s*identity(7)-Aa matrix also the other values from the resulted matrix from integer numbers into decimal/float numbers (for example: 1 into 1.0 and 0 into 0.0 -> 1 and 0 are the only non-decimal numbers in Aa matrix, if there were other values the same thing would have happened).
And now if we change in Aa matrix from the beginning -0.811 into -811/1000, -1.273 into -1273/1000 and 0.637 into 637/1000 then the result of determinant is changing also, and also the values of 1 and 0 in resulted s*identity(7)-Aa matrix does not change into 1.0 and 0.0:
Its not clear to me what you want to show with this.
Using exact integer fractions gives an exact result, even though "float" is used, while using decimals results in floating point results which cannot be simplified, maybe because of inaccurate intermediate floating point results.
That was the reason why I suggested that you may try using exact fractions to get simpler results.
The symbolic output of Mathcad (and Prime is no different) is hard to control. With some tricks, this matrix:
Has a determinant of:
And its inverse is:
Success!
Luc
Hi Luc, What do you mean more exactly by "with some tricks..."? Because in the images you show you didn't apply any trick...Or?
Just one trick.
The 0.8 is not a number, but a variable. It is defined as:
0.8 := 8/10
But essentially that's al there is to it.
Success!
Luc
The main trick possibly is the usage of Mathcad 11 🙂
At work so far I have to stick with Mathcad Prime...
And it is not so straight forward if someone needs to change between multiple math software in order to make some calculations. Then there are license discussion because for each extra software company must buy the license (and bosses, you know, do not really want to do that (that is money spent)).
And of course regardless of the money for licenses for multiple software, how can one feel when for example half of the calculations she/he have to do in one software and the other half of calculations in another software...?
Then it's a matter of accumulating over time different things that you have made in one software and then you use further those built things (functions, methods), and in the other software you no longer have them (or at least you don't have them all) or you need to create them again and again...
So, it is not so easy when someone urges you to use another software: "use that math software or that software".