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

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

MathCAD Help Needed

DenisMartens
1-Newbie

MathCAD Help Needed

Hello,

I am writing a simple routine to exchange the rows, columns or both of a symmetric matrix. Prior to doing so, the routine must catch errors and display them together (if multiple errors are present, they must be listed as separate lines but in a single execution of routine). My routine works, but I cannot figure out how to catch and display the errors properly.

I have attached my code. Any help much appreciated.

8 REPLIES 8

1. Not clear what the switched product is ! ?

2.The "error test" depends upon what the

symmetric matrix represents.

Monkey don't see, monkey can't help .

MCADmatrix_rc_colrow.gif

jmG

Jean,

The symmetric matrix does not represent anything in particular at this point. I simply cannot figure out how to display three different errors simultaneously. That is, I can only display the first error which my routine catches (the routine exits once the error occurs). I want to display all errors which occur (total of 3 possible types in my program). Have a look at my code if you can. Sorry if this is a silly thread, I am a newbie to MathCAD and I have to say that although it is a great calculating tool, writing algorithms with this software is a bit painful :/.

Thanks again for the help.

Denis Martens wrote:

Jean,

The symmetric matrix does not represent anything in particular at this point. I simply cannot figure out how to display three different errors simultaneously. That is, I can only display the first error which my routine catches (the routine exits once the error occurs). I want to display all errors which occur (total of 3 possible types in my program). Have a look at my code if you can. Sorry if this is a silly thread, I am a newbie to MathCAD and I have to say that although it is a great calculating tool, writing algorithms with this software is a bit painful :/.

Thanks again for the help.

Denis,

I can't see your code, I'm Mathcad 11.

Some collab will surely be curious of what you are attempting.

Cheers, Jean

What you let understand is that some stuff should result in a symmetric matrix and that if it is not symmetric, you then want to rotate whatever can be in order to make it it symmetric . Immediately, if a result is not correct for some conditions or values , that indicates some boundary in exploiting such a system. I can't see how to rotate 2*3 to make it 7. Has it got something to do about those "PseudoInverse". You must have some source and reference of what is doing what.

You have it written in such a way that if the error doesn't exist then S1, S2, and S3 are undefined. In which case you can't concatenate them! You could add an otherwise for each error and assign an empty string, but there is an easier way.

RichardJ
19-Tanzanite
(To:RichardJ)

You have other errors too. Unless you specifiy otherwise, all array indexing in Mathcad starts at 0, not 1. The logic of your first "if" is also wrong: you need "and", not "or". I slightly improved the error handling too.

Thanks Richard. You are right on the money.

In Mathcad, checking if "a matrix is symmetric or not " is baby stuff.

MCADmatrix_rc_colrow_1.gif

jmG

Top Tags