Using Prime 3.0, the determinant function does not handle a matrix with complex numbers. Don't how to fix it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
Solved! Go to Solution.
- Labels:
-
Other
- Tags:
- determinant_solve
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hmmmm!
From my 3.0:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
After opening the document "Determ_FK.mcdx" in Mathcad Prime 3.1 Express and recalculation (button "Calculate") there are no errors:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Please provide a worksheet (and screenshot) of your issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Express lacks symbolics. And the question is: Is presence of symbolics required for calculations with complex numbers?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
The following result was obtained in Mathcad Prime Express 3.0 (there is no bug). Please attach your worksheet for Prime 3.0.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Sorry I accidentally clicked "answered", "newbee". I still have the problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
No worries Foster - Welcome to PTC Community
Best,
Toby
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
So, Toby, can you (have some PTC expert) confirm that this is a bug...?
Luc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks Luc - I will make an inquiry and follow-up.
Best,
Toby
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Where is your worksheet with this bug, Luc?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
How come you have double bars "||A||" and "||B||" for the determinant?
Luc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
This operator:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
This is what Mathcad 11, correctly, makes of it. I'd expect mathcad 15 to give the same results:
Luc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Yes, this is the "norm", for the calculation of "determinant" is used:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
And when I subsequently unchecked each of the calculation options. Prime just crashed.
Luc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Luc,
From what source did you get your Mathcad Prime Express version?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Downloaded it from PTC website.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Can you post your file? (Need to click "Use advanced editor" in upper right to get "Attach" on lower right.
![](/skins/images/695EE5AD3E567050FEDD72575855ED93/ptc_skin/images/icon_anonymous_message.png)