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

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Mathcad Documentation completeness question

ptc-2784652
1-Newbie

Mathcad Documentation completeness question

I have said on several occasions that there is a need for Mathcad documentation. Let me be more clear. Here is the sort of information I miss.

  1. Concerning Mathcad interactive specification. Is there a set of syntax diagrams or BNF notation specification of the complete Mathcad interactive interface?
  2. Is their a complete list of ALL the Mathcad data structures types?
  3. Is their a complete specification of what can and can not be put into place holders in each and every context?
  4. Is there and specifications that tell all the contexts that subscripts and superscripts are valid to use?
  5. Is there any specification of what can and can not be put into a subscripts in various contexts?
  6. Is there any uniform parsing standards that tells when and where various implementations will or will not work?
  7. Is there any specifications where only scalars can be used?
  8. Is there any documentation that document the valid domain and ranges in regard to values and value types of all the implementations?

(I apologize if I have been sloppy in the overlaps and holes in the coverage of my questions).

How wonderful it would be to know what one can and can not do in any particular context without any waste of time or thrashing around in the dark!

Sincerely submitted, JS

15 REPLIES 15

John,

There is a technical answer for each of your questions but your list is too short , it might just confuse. You already know that Mathcad does not support superscript unless you define as an operator, It does support literal and/or numerical subscript as a variable name, but don't confuse with index, which index may be a single numerical value or an integer range. I'm surprised there is no link to the PTC Mathcad work sheets repository, that you can download and learn quick how to construct a project in supplement to the qs delivered with the Mathcad install CD.

See you soon while you are brewing your project .

Jean

Hi John,

With regards to the types of data to use in each context, did you know you can use context-sensitive Help for every feature and function in Mathcad? For example, let's say you want to use a function, but need more information on the function's arguments. You can insert the function into your worksheet, place the pointer on the function name, and press F1. This will open the Help page for that specific function. You'll be able to see what type of arguments the function takes, and for example, if it only accepts scalars. You can also access context-sensitive Help via the Insert Function dialog box.

The documentation cannot cover all possible scenarios and implementations, but if you know which functions and operators you need, you can use context-sensitivity for finding the information you seek. As Jean points out, you can also refer to the Mathcad Resource Center and download worksheets and example files for your reference.

Ibrahim

Thanks Ibrahim,

I have used the context help, and it is good as far as it goes. But in regard to the completeness of the documentation, there is a reason for that.

There is another system we all know about it that is incredibly widely used. It is called the Decimal System. The Decimal System is easily documented. So easy, in fact, many people who use it could document it completely in a few minutes. Now think about another system that is impossible to completely document. It is called the Roman Numeral System. In the Roman Numeral System, in order to make bigger numbers, it is necessary to invent new conventions of representation.

One system is completely systematic with a necessary and sufficient set of rules, and the other is ad hoc and open ended and requires new conventions in order to create larger and larger numbers. Please note how much more one of these systems is used than the other. Tthat alone tells me that just how worthy it is to strive to make our systems more like the Decimal System and less like the Roman Numeral System.

Mathcad is not bad as systems go, in regard to ease of use and the like...but like most systems it is, in fact, very mediocre compared to the real limits of just how good it really could be.

Here is a short sampling of how Mathcad is "Roman Numeral" like. I don't think the Mathcad syntax and behavior was thought out very carefully in regard to a number of concerns. So Mathcad is maybe a bit better than typical, but in no way any where near what it could be. Remember world markets run in the billions.

Here are examples of just one small area of syntax/behavior of how Mathcad is more "Roman Numeral" like than "Decimal" like. Mathcad is more or less impossible to completely document. The very best syntax and set of conventions would not have these kinds of problems.

sintax.GIF

I'm sorry I'm such a grouch about Mathcad...but there is Prime coming down the line, and I hope....or at least wish...that they would make it better in these regards. I haven't actually seen it yet.

John Sellers wrote:

sintax.GIF

I'm sorry I'm such a grouch about Mathcad...but there is Prime coming down the line, and I hope....or at least wish...that they would make it better in these regards. I haven't actually seen it yet.

Well, lots of luck with that...

Your issues with Mathcad seem somewhat unwarranted, as the issues you've raised are not necessarily issues with Mathcad, per se, but with MATH and its notational limitations. The bottom line is that the multiplication symbol in general usage is overloaded as are many other math symbols and operators. You can check any set of college level math texts and see that. Now, Mathsoft made certain choices in implementing the notation, some good, and some bad. When two vectors are operated upon with a multiplication operator, it makes some sense to interpret that as a dot product. However, squaring a vector is not the equivalent of the dot product of a vector with itself, so some ambiguity exists, which is somewhat outside of the purview of Mathcad.

In mathematics, you must apply executable rules. Mathcad is based on that and the sources are various, adapted for the type of OS of the plateform. In your red example [and the not red], you are not applying any rule. So you get red for some kind of "no rule" or nothing for "not wrong but not executable". The decimal arithmetic is simple 0...1 [implicitly ± 0...1]. But for functions, the arithmetic rule does not apply. Each functions is an approximation and each approximation is set for a specific range . So, the arithmetic of the function is the arithmetic of the base argument. For example: assume that the base accuracy of ln(x) is 20 decimals in the range [1/SQRT(2) ...SQRT(2)], then the arithmetic of the function is the on the base argument and the floating point. In other words, the arithmetic of a function is the "digit arithmetic of the function", and the chain rule applies on composition... ln(x)*sinh(y)*exp(z)*SQRT(w) will have degraded accuracy based on the range argument of each of the functions involved.... 3, 6, 9 decimals and I'm happy in Engineering works.

Jean

RichardJ
19-Tanzanite
(To:ptc-2784652)

The very best syntax and set of conventions would not have these kinds of problems.

I disagree that these are problems, and they are well documented.

The documentation for the multiplication operator says:

If x and y are scalars, returns the product of x and y.

If x and y are vectors, returns the dot product (inner product) of x and y, a scalar formed by multiplying element-wise the entries of the first vector with the complex conjugate of the entries of the second vector, and summing the results.

If x and y are matrices, returns the matrix product of x and y.

If one operand is a scalar and the other is a matrix, each element in the matrix is multiplied by the scalar.

So the default behavior for two vectors is the dot product. As Eden points out, that is not the same as squaring a vector because there is no accepted definition of what that means. So, like many other operators and functions in Mathcad, when you square a vector what you get is the operator applied element by element. This is documented. The description of the exponentiation operator says:

If y is a scalar and x is a vector, the result is a vector of the same size as x, whose ith entry is y raised to the power xi.

As far as nested matrices go, the behavior is also documented:

Most of Mathcad's operators and functions do not work with nested arrays, since there is no universally accepted definition of what constitutes correct behavior in this context. Certain operators and functions are nevertheless useful and appropriate for nested arrays. Functions that enumerate rows or columns and functions that partition, augment, and stack matrices, can be applied to nested arrays. The transpose, subscript, and column array operators and the Boolean equal sign all support nested arrays.

Mostly documented, anyway. It doesn't actually say that multiplication by a scalar is permitted, even though it obviously is.

John Sellers wrote:

I have said on several occasions that there is a need for Mathcad documentation. Let me be more clear. Here is the sort of information I miss.

  1. Concerning Mathcad interactive specification. Is there a set of syntax diagrams or BNF notation specification of the complete Mathcad interactive interface?
  2. Is their a complete list of ALL the Mathcad data structures types?
  3. Is their a complete specification of what can and can not be put into place holders in each and every context?
  4. Is there and specifications that tell all the contexts that subscripts and superscripts are valid to use?
  5. Is there any specification of what can and can not be put into a subscripts in various contexts?
  6. Is there any uniform parsing standards that tells when and where various implementations will or will not work?
  7. Is there any specifications where only scalars can be used?
  8. Is there any documentation that document the valid domain and ranges in regard to values and value types of all the implementations?

(I apologize if I have been sloppy in the overlaps and holes in the coverage of my questions).

How wonderful it would be to know what one can and can not do in any particular context without any waste of time or thrashing around in the dark!

Sincerely submitted, JS

I guess I'm unclear as to why you think you need BNF notation for anything Mathcad related. There's already context help, along with the Insert Function descriptions. In most cases where I've needed to use the help files, the descriptions were adequate for what I was looking for, so I'm unclear as to what you think might be missing. I would never think BNF to be that useful, since it was specifically intended for a very specific audience doing a very specific task, neither of which exist for myself or anything I do. While BNF has a precisceness that's required for formal software specifications, it's not particularly user-friendly and is very off-putting for casual users and non-programmers.

As for number types, there's basically only one type that's used almost always, which is a straight floating point number whose range is fixed to roughly 10^-307 to 10^+307. There are some limited types for non-decimal radix input, but they're converted to floating point internally.

So far as I know, the major complaint over the years has been more the lack of a printed manual, or even a PDF manual version of what used to be in the Mathcad function reference manuals. The same information, more or less, is in the help files and in the Insert Function dialog boxes.

Actually BNF can be very valuable.

Here is an example of how I was effected in Mathcad. In May I posted http://communities.ptc.com/thread/6282 (quest for 3D plot capabilities) and nobody answered my question for over a month. I finally posted a crude work around, and then jean Giraud responded and at that point I finally learned 3D plot could display multiple objects by accepting a sub-indexed list of meshes. (which BTW I have never been able to find documentation for in help). If the BNF notation for the 3D place holder existed, I would have learned that simple fact about 30 seconds after I started looking instead of waiting a month before I got around to chasing the answer.

Why 30 seconds? Because I would only have to look in one place to find the names of the structure of interest, and it would certainly exist in that one place. If I needed more, I would have the right search term to search on. That is what BNF or some other formal syntax can do for you.

What is even more important about having BNF is that the understanding of the capabilities of a data structure, operator, function, et al can be brought to a closure in a short time by examining the syntax and using it as a key to understanding. Otherwise one is regulated to a slow and protracted process that may take years.

Single sourcing all syntax rules by having a formal syntax established - the path to superior quality.

I have had the experience of sitting down for the first time with a complicated user interface and within two hours know exactly how to use more than 200 functions. I was able to work for two weeks on a project with no need to go back to look at help or have any doubt in my mind how to implement the project or how it would behave when I was done.

I've also had the experience working with 5 lines of critical undocumented code with an ad hoc & open ended syntax for 2 months. That system used homogeneous coordinates as a backbone and I was able to add the capability of dragging and dropping scalable, rotatable widgets on any application in the environment. After two months of work, I never succeeded in determining that there were no bugs in those 5 lines of code because of the arbitrary way the rest of the system was syntactically and semantically structured and related to this critical code. Actually during those 2 months I made corrections in those 5 lines of code that fixed capabilities that were broken at the system level that would have never been broken if the relationship among things had had a solid structure.

The critical difference between the two systems was the fact that in one, all syntax was clearly defined, and the other had almost an infinite number of unintended consequences due to inability to directly examine the huge number of conceivable interactions between or among components that were independently conceived in isolation from one another. Well defined syntax is a necessary component of preventing such situations.

You show me any system that does not have complete syntax definition, and I will show you a system that over time will degenerate or become frozen in respect to the ability to improve it or make it more stable regardless of claims or belief to the contrary. Sound familiar?

I could say more, but it is time to wrap up this rant.

Several things John,

The former Mathcad collab went down Feb 4 2010 [from recollection], down for a very long period. Sometimes in April it went back and almost deserted . I rejoined in this one June 22 and realized that many collabs have either deserted for good or just visit. About using Mathcad, personally I have learned most of it [in fact all of it] from the Mathcad 8 Pro. Treasury that does not exist anymore for a long time. The Mathcad structure is so VAST that it's about impossible to make any diagram . I'm saying that based on my exceptional ability to put things/words/facts in picture/diagram [over 30 years in Process Control and Logic]. In fact I have several work sheets called "For Loop Structure". The remaining of several hundred MB of work sheet is the remaining of the "Mathcad structure".You learn Mathcad by doing, and so many structures were discovered between collabs ! The way you mention having learned 200 functions shortly is because you were familiar with similar systems [that reminds me: Siemens, Bailey, Foxboro, Honeywell, Micon, Asea, Leeds & Northrup...] . I understand the importance of understanding quick what one system can and can't do for bidding on projects, especially when the client has some kind of "Proprietary Expertise" .

''''''''''''''''''''''''''''''''''''''''''''

I can see you sweating in there ! ! !

>The critical difference between the two systems was the fact that in one, all syntax was clearly defined, and the other had almost an infinite number of unintended consequences due to inability to directly examine the huge number of conceivable interactions between or among components that were independently conceived in isolation from one another. Well defined syntax is a necessary component of preventing such situations.<

You are right about systems that get frozen and can't be improved by lack of provision, but that as well for digital [numerical] system as for analog systems. The Heavy Water Plant got frozen for months by lack of provision in the GEPAC temperature reading: below -20°C it started inversing the reading ... no documentation, just machine code to get the piece of maths on TI-58.

Concerning Mathcad, You learn project by project. It takes years and in the mean time one forgets the rational of thinking, like losing calculus.
Cheers John, please stay in this community.


Jean

John,

The worst you will encounter are wrong or incomplete formulation. Here, the area from cross product is given in Mathematica, and probably in others . The Mathematica cross product is the same in Mathcad [I have checked], but the result is wrong, easy to check ... wrong in both Mathematica and Mathcad. Mathcad 11 says the cross product does no behave same as in previous versions. Can't tell what a mathematical behaviour is, neither if the right is wrong or vice versa ! Whatever, the area from cross product is wrong, The original source [quite recent] may have a typo, may be wrong, the symbology may have been misinterpreted, the author may be RIP, can't trace the wind, nobody checked ... just to show how difficult it is to document and maintain the documentation with changes from versions to versions.

Jean

Jean,


I don't believe that both Mathcad and Mathematica have the wrong interpretation for cross-product, especially if both programs agree. Also Mathcad is now in release 15, although I don't recall the definition for cross-product changing since Mathcad 11.


Mona Zeftel

Senior Technical Consultant.

RichardJ
19-Tanzanite
(To:jeanGiraud)

The cross product is fine. Amazingly, Mathcad, Mathematica, Maple, and MuPad have not all introduced identical bugs. The problem is that your vectors u and v have nothing to do with your triangle. If the corner of the triangle is at (xx,yy,zz) then u=(0,5,0)-(xx,yy,zz) and v=(5,0,0)-(xx,yy,zz). Then you get 8, not 11.225

Thanks Richard,

The work sheet is updated in the original thread.

BNF is completely inappropriate for Mathcad. BNF describes languages whose elements are strings of symbols (from some specified alphabet). Mathcad does not use such a string representation for expressions.

PhilipOakley
5-Regular Member
(To:TomGutman)

Generally I'm going to support Tom on this one. Part of the problem is that BNF is a particular style of documenting how stuff works in textural environments. It presupposes a [limited] particular set of key operations that can be recorded in a certain way. In that context BNF isn't appropriate to MathCAD.

This is not to say that there aren't other structured methods for documenting MathCAD's base functionality. Unfortunately I haven't seen one.

Plus the style of mathcad usage is such that users create a lot of additional functionality within their (longer) sheets that would need a mechanism for automating that documentation so users (multi-user worksheets) can navigate more easily. I've made suggestions about particular bits of point functionality I'd like but not have been picked up.... shame.

Philip

Top Tags