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

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

Programming example

ptc-1368288
1-Newbie

Programming example

Collab ElSid:

Here is a programming example. It is a function, a function that constructs the n x n PseudoInverse matrix. It is built around several Mathcad built-in functions. It includes a specific feature that an existing Mathcad built-in does not have, thus the reason of such a construct. Typical but not limited to, as far as a programming example.

In literature, "PseudoInverse" is popular. Mathsoft did not retain this denomination, rather they have called the built-in function "geninv(,)" [generalized inverse, in reference to square matrix]. This paragraph is just telling that in brute force, the attached "pseudo_inv(A,tol) = geninv(A)".

You had the very best programming collection in Stuart replies. You wanted a fresh one from the day, here is one of different style. It is left in the original form from the author with ORIGIN = 1. A simple exercise would consist in modifying the construct to generalize back to the more native Mathcad style ORIGIN = 0.

Hope it helps and you have no back feeling that Jean dropped you.

jmG
6 REPLIES 6
ELSID
4-Participant
(To:ptc-1368288)

Thank you. No bad feelings. I've been playing with Stuart's looping file from the other thread. Thanks to his program, I've modified and expanded, all while learning about what is preached in this collab. Your help is appreciated and I do learn from what you send. Just keep in mind that items posted may/may not be fully documented for various reasons.
See Richard comment about proprietary (http://collab.mathsoft.com/read?130528,18).
Yes, sometimes as a power user/tutor, you may need to read into what is requested due to poor wording on the posters part (again, Stuart reading into what I was requesting)

I am not doing rocket science, just re-writing/re-creating excel sheets etc. to make them more traceable. In the process, I have found numerous issues that justify some previous test systems problems (i.e. motor spiking/tripping fuse due to being fractionally too small 1.25 HP installed ... needed 1.5 HP).

When you link to a thread in the collab, like this:

http://collab.mathsoft.com/read?130528,18

"Proprietary" in a public forum = no comment. There are Excel calculators for what you were visiting for.

jmG
ELSID
4-Participant
(To:ptc-1368288)

Except excel is not as transparent. Some places are slow to change ... I just like reworking "verified code" and converting to Mathcad. Especially when I catch errors due to excels cryptic notation.

>..errors due to Excel cryptic notation.<<br> _________________________

That does not exist.
Excel is like any computing machinery, i,e: garbage-in = garbage-out. It follows the universal order of operations. Hard to introduce operational error with the colored bracketing. I would bet that any of these "calculator module" are VB coded macros ... coded as per the coder.

jmG

On 11/18/2009 8:33:02 PM, jmG wrote:
>That does not exist.
>Excel ... follows the
>universal order of operations.

Not in all respects, in fact. Excel gives unary minus a higher precedence than exponentiation, so that, for example, -x^2 + 1 is different from 1 - x^2 (where x is any number)! Try an example comparison between Excel and Mathcad.

stv

On 11/20/2009 11:12:09 AM, stv wrote:
>On 11/18/2009 8:33:02 PM, jmG wrote:
>>That does not exist.
>>Excel ... follows the
>>universal order of operations.
>
>Not in all respects, in fact. Excel
>gives unary minus a higher precedence
>than exponentiation, so that, for
>example, -x^2 + 1 is different from 1 -
>x^2 (where x is any number)! Try an
>example comparison between Excel and
>Mathcad.
>
>stv
______________________________

For sure you don't understand "order of operations" ...
Who said that -x^2 + 1 was not different from 1 -
>x^2 ?
>Try an example comparison between Excel and Mathcad<<br>
I don't have to teach you the alphabet.

Scripting a continued fraction in Excel, ORIGINLAB ... KALKULATOR ... all the same and same as Mathcad. Yes I did but won't spend time explain what you should know.

jmG
Top Tags