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

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

Using Prime 3.0, the determinant function does not handle a matrix with complex numbers. Don't how to fix it.

fstulen
1-Visitor

Using Prime 3.0, the determinant function does not handle a matrix with complex numbers. Don't how to fix it.

When I load a matrix up with al reals the |A| or det(A) works fine and returns the value.  If I add a +1i or any imaginary number to an element, the |A| or det(A) returnb 0.  This frustrating since I have programs that use this alot for filling arrays in a linear systems problem. 

ACCEPTED SOLUTION

Accepted Solutions
LucMeekes
23-Emerald III
(To:Fred_Kohlhepp)

Express Prime does work with complex numbers,

It understands that the middle element of B is a complex number. It can produce it's complex conjugate, but the Re() and Im() functions are considered 'Premium' function, although you can easily circumvent that by defining them using the complex conjugate.

Anyway, this is what Express Prime 3.1 produces (typed everything in myself):

Luc

View solution in original post

51 REPLIES 51

Hmmmm!

From my 3.0:

I typed Fred's example into Prime 3.1: No Good

I typed Fred's example into MC15: Good

I converted MC15 to Prime 3.1: Good

I did copy/paste of converted elements into new Prime 3.1 worksheet: No Good!

After opening the document "Determ_FK.mcdx" in Mathcad Prime 3.1 Express and recalculation (button "Calculate") there are no errors:

Pic_2.png

VladimirN
24-Ruby II
(To:fstulen)

Please provide a worksheet (and screenshot) of your issue.

aklay
2-Explorer
(To:fstulen)

We do not know which version of Prime Foster has. Maybe he uses Express Prime and there may exist the difference between full Prime and Express Prime. If I tried to calculate the determinant of Fred's matrix B in Express Prime the result was 0.

Fred_Kohlhepp
23-Emerald I
(To:aklay)

That's interesting

and depressing.

If Express can't do an operation it should report that it can't, not give a false answer.

Can express deal with imaginary numbers?

Express lacks symbolics. And the question is: Is presence of symbolics required for calculations with complex numbers?

Fred_Kohlhepp
23-Emerald I
(To:aklay)

You don't need symbolics.  Mathcad is primarily numeric.

You should be able to open the attached file using Express.

It writes two imaginary variables and operates with them.

LucMeekes
23-Emerald III
(To:Fred_Kohlhepp)

Express Prime does work with complex numbers,

It understands that the middle element of B is a complex number. It can produce it's complex conjugate, but the Re() and Im() functions are considered 'Premium' function, although you can easily circumvent that by defining them using the complex conjugate.

Anyway, this is what Express Prime 3.1 produces (typed everything in myself):

Luc

VladimirN
24-Ruby II
(To:aklay)

The following result was obtained in Mathcad Prime Express 3.0 (there is no bug). Please attach your worksheet for Prime 3.0.

Pic_1.png

fstulen
1-Visitor
(To:fstulen)

I am using Prime 3.0.  I asked a colleague at work to try it.  She got the same result |A| = 0. 

I ran Fred's example and it didn't work in Prime 3.0.  It did work fine in MC 15, which I downloaded via a free 30-day trial.

It is a bit more odd.  When I first opened my file in Prime 3.0 it gave the correct answer,  (Maybe it justs displayed where I left off).  Then I changed one value of variable  (a material value) of a material property and it didn't work.  When I close Prime 3.0 and then restart,  the file doesn't run even the first time.

So why does it work on Fred's Prime 3.0, and it doesn't work on others?.  Was there a patch or minor upgrade we're missing

fstulen
1-Visitor
(To:fstulen)

Sorry I accidentally clicked "answered", "newbee".  I still have the problem

No worries Foster - Welcome to PTC Community

Best,

Toby

LucMeekes
23-Emerald III
(To:Tmetcalf)

So, Toby, can you (have some PTC expert) confirm that this is a bug...?

Luc

Thanks Luc - I will make an inquiry and follow-up.

Best,

Toby

Where is your worksheet with this bug, Luc?

LucMeekes
23-Emerald III
(To:VladimirN)

here you go

I opened your file in Prime Expres 3.1 version and click "Calculate", the result is without bugs. And what happens if you click on "Calculate"? How you include the value for "1i" in matrix element?

Pic_3.png

Now I tried to retype this example manually in the new worksheet in Prime Express 3.0, then save / resave  / recalculate worksheet, but there are no bugs.

Pic_4.png

LucMeekes
23-Emerald III
(To:VladimirN)

How come you have double bars "||A||" and "||B||" for the determinant?

Luc

This operator:

Pic_5.png

LucMeekes
23-Emerald III
(To:VladimirN)

That should give the norm of a vector, which can be extended to the norm of a matrix ( Matrix norm - Wikipedia), but the determinant of a matrix is something different ( Determinant - Wikipedia).

Luc

LucMeekes
23-Emerald III
(To:LucMeekes)

This is what Mathcad 11, correctly, makes of it. I'd expect mathcad 15 to give the same results:

Luc

Yes, this is the "norm", for the calculation of "determinant" is used:

Pic__.png

LucMeekes
23-Emerald III
(To:VladimirN)

If I click on "Calculate" the sheet is recalculated with the same (buggy) results.

I tried playing with the calculation options. Switching on each option individually doesn't change any results, but when all are switched on:

The error messages with the two red areas are: "Unknown error: mpl%_exception".

Conclusion:

Bug!

Luc

LucMeekes
23-Emerald III
(To:LucMeekes)

And when I subsequently unchecked each of the calculation options. Prime just crashed.

Luc

Luc,

From what source did you get your Mathcad Prime Express version?

LucMeekes
23-Emerald III
(To:VladimirN)

Downloaded it from PTC website.

Can you post your file?  (Need to click "Use advanced editor" in upper right to get "Attach" on lower right.

Announcements

Top Tags