Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X
Hello,
Mathematica result:
Maple result:
Mathcad 11 result:
Mathcad 15 result:
Mathcad Prime 8 result:
Why does Mathcad Prime give such a result when calculating the determinant of that matrix? Is this some bug from prime? or?
Mathcad Prime 8 file attached.
In Maple you have a typo - first row, second column
Did not influence pretty much...
Anyway, strange how Mathcad Prime calculates this determinant...
still quite a large difference compared to the other solution! Look at the coefficients of s and s^2. All other programs get 4.2 and 11.3 but the result of Maple significantly differs!
In P8 you may try modifiers like "collect,s", "expand" or even just "simplify".
"In P8 you may try modifiers like "collect,s", "expand" or even just "simplify"."
I already tried and nothing...
And I don't really see what else to do, because we simply have the matrix and apply the determinate (| |) to it...
Is this not a bug or something in Prime, because it calculates like this?
A function like this (to do these kinds of calculations) should be created I think:
https://www.mathsisfun.com/algebra/matrix-determinant.html
But this function should also be valid for calculating the determinant of a matrix larger than 3x3 as in the example above...
@Werner_E @LucMeekes
Does anyone know how to make a function like this?
@Werner_E @LucMeekes @ttokoro @Fred_Kohlhepp
Mathcad Prime 8 result (as shown above):
Calculation with the formula above (hand calculation):
Yeah, you sure could write something like the Lagrange expansion using recursion, but chances are that symbolical evaluation still fails or explains that the result is too large, etc. I would say that writing a working function to symbolically calculate the determinant of a matrix is a job for the development team at PTC.
Did you already report your various problems with the symbolic calculation to PTC support?
"Did you already report your various problems with the symbolic calculation to PTC support?"
No, I don't know how to do this.
@Cornel wrote:
"Did you already report your various problems with the symbolic calculation to PTC support?"
No, I don't know how to do this.
Maybe @VladimirN or @DJNewman can provide information about the current way to do so.
I know PTC employees may have a little different workflow than what normal customers have, but the above should suffice.
Until then...I think we can use your function of calculation of minors of a matrix also for calculating the determinant of a matrix.
Here also calculate minors, but instead of putting the common element to be 1 as it is in the above function, the common element must be that number when we want to calculate the determinant of a matrix.
So, for example, if we have a matrix:
And if we want to calculate the minor:
With your function we get:
Classically we get:
But if we want also to do this:
We have to multiply that minor by the common element (and ignore the sign, because the InvElement function already takes its sign into account), so not by 1 as it is in your function.
So, with the above example, we should have:
How can we do this in the above InvElement() function?
And at the end, the sum of each element multiplied by its minor must be made, but now let's see if it is possible to do what I said first/above, and then step 2 is to make the respective sums.
How do I make it so that when I put instead of the matrix, a function to which I assign a matrix, to get the result as in the first case when I put a matrix? (this is for symbolic computation. Numeric computation is ok as seen from the previous post)
Another thing:
Here is my attempt for a function to calculate the determinant of a square matrix.
First we define utility functions to delete rows and columns of a matrix
Then the determinant is calculated by Lagrange expansion after the first column - done recursive until we arrive at an 1x1 matrix
I haven't tested thoroughly, but it seems to work quite well, BUT ... its VERY SLOW when evaluated symbolically!!
Furthermore something like "simplify" or "expand" is necessary as otherwise the result isn't really nice 😉
Have fun and use at your own risk!
EDIT: Added an alternative function to delete rows (and columns) which avoids the slow "submatrix" function but it did not speed up the calculation.
How can that fraction be made to stop appearing? Is it possible to do that, somehow? Because we see that the numerator tends to 0...each variable s of numerator is multiplied by at least 10^-10, and at the final of the fraction we get the correct answer of the determinat.
Or would the only option be to manually extract the correct result of the determinant?