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

Bug with 'In-Line' definition and evaluation

jhardy
1-Newbie

Bug with 'In-Line' definition and evaluation

I have found what appears to be a bug with definition and evaluation within the same statement ("In-Line Definition and Evaluation"), if vectors are used. (This affects only MC 14 as far-as I know, as earlier versions did not support "In-Line" definition and evaluation in a single statement.)

It seems that if you define and then evaluate a vector of parameters in a single statement, and change the displayed units of the evaluation, you get incorrect results when the vector is referenced later. If you define on one line, then evaluate on a separate line (changing units in the "evaluation" statement), as per MC 13 and earlier limitations, it works fine.

See attached sample file, which replicates the same set of simple calculations, the first time not using "In-Line" definition and evaluation, the second time using "In-Line" definition and evaluation. It seems that in the second example, changing the displayed units from default "m/s" to "km/hr", changes the numerical values in the underlying vector, but does not update the units. As a result, all later references to the Velocity vector yield incorrect results.

Is this a known bug? The work-around is straight-forward enough (don't use in-line definition and evaluation of vectors), but this could be a real problem for anyone who has been using in-line definition and evaluation in any worksheets which use vectors. (Like me!)
14 REPLIES 14

Sorry, I do not see any error in my Mathcad 14. Send please the picture of your Mathcad 14!
Val
http://twt.mpei.ac.ru/ochkov/v_ochkov.htm

This was a known bug in the early releases of v14. Have you installed the latest service release?

Preston

You can download updates to Mathcad 11 through 14 at http://www.ptc.com/support/mathcad_downloads.htm


Mona

On 4/27/2010 2:43:39 PM, MonaZ wrote
>You can download updates to
>Mathcad 11 through 14 at
>http://www.ptc.com/support/mathcad_downloads.htm

>Mona

In fact, the PTC download link is broken.

Jean,

I fixed the link. It included a period.

Thanks for catching it.

Mona

On 4/27/2010 4:11:46 AM, jhardy wrote:
...
>(This affects only
>MC 14 as far-as I know, as
>earlier versions did not
>support "In-Line" definition
>and evaluation in a single
>statement.)
_____________________________

Mathcad 8, 2001i, 11 [probably 2000, 2001]
DID SUPPORT in-line definition, see attached.

jmG


jhardy
1-Newbie
(To:jhardy)

Thanks all for your feedback.

I am running Mathcad 14.0.0.163 (build 701291152). I don't know what the latest patch is. I will have to try to get my IT support team to get the latest patch, but I don't know how successful I will be - we only have a few copies of Mathcad scattered among a select few users, and it is not one of our "core" Enterprise-wide supported applications. I don't think we have active maintenance agreements on Mathcad. Is there some way I can download the patch without an active support agreement? (The link that Mona provided doesn't work for me: "Document not found" error.)

@ Val: Please see attached screen copy of my bug - hopefully this issue can be resolved if I can somehow get the patch to the latest version.

@ jmg: Thanks for the update about v8 having the capability of in-line definition & evaluation. I wonder why they took it out in later versions?

Thanks again, everyone!
RichardJ
19-Tanzanite
(To:jhardy)

On 4/27/2010 7:55:41 PM, jhardy wrote:
> (The link
>that Mona provided doesn't
>work for me: "Document not
>found" error.)

It's PTC's crappy web site. It's a valid page, but the link doesn't work. The web site is also a nightmare to navigate. Go to the PTC web site, Click on "support" at the top, then "Mathcad" on the "left", then the "single user" tab in the middle of the page", then scroll down until you see "Download Mathcad Updates". Click on that. At some point in that process it will prompt you to log in, and if you don't have an account you will have to create one.

Richard

On 4/27/2010 7:55:41 PM, jhardy wrote:
...
>@ jmg: Thanks for the update
>about v8 having the capability
>of in-line definition &
>evaluation. I wonder why they
>took it out in later versions?
>
>Thanks again, everyone!
_______________________________

There is certainly more than 1 incorrect result in your work sheet [*.gif].

kg/m�(m/s)�= Pa accordingly to Mathcad 11

kg/m�(m/s)�=kg/(m*s�)= 1atm = 101325pa

At the speed you have, it's a,lot of dynamic pressure, like a tornado. The unit system has been discussed, suggested with no result or agreement and bullied near insults. The best is to go direct to BMP [Bureau des Poids at Mesures].
I have recollection Stuart had all the links, maybe more.

jmG


jmg,

I don't intend to reopen the debate of calculating with units versus unitless with you again - let's just say we agree to disagree on that particular issue!

With respect to the basic calculation - the problem first arose in a much more complex worksheet than the one I posted - I just wanted to make the simplest possible demonstration of the nature of the problem.

For the record, the mini-calculation I posted just calculates free-stream air pressure, given by:

p = 1/2*rho*v^2

Density of air (rho) is typically taken as 1.2 kg/m3

For a free-steam velocity of 40, 50 and 60 m/s, the corresponding free-stream air pressures are 960 Pa (0.96 kPa), 1,500 Pa (1.5 kPa) and 2,160 Pa (2.16 kPa) respectively, so the first half of my worksheet (without in-line evaluation) gives the correct solutions. (And yes, these are relatively high wind velocities - but that is what we have to deal with when designing structures for cyclone loading!)

In the second version of the worksheet, performing the in-line evaluation of the velocity vector from base units of m/s to km/hr over-writes the original m/s numeric values in the vector with their km/hr equivalents, but the vector as a whole still carries units of m/s, so the subsequent free-stream pressure calculations are wrong.

Hope this clarifies things. (And yes, I know that if I had worked unitless throughout, and stuck to base SI units everywhere, this problem would not have surfaced at all, but I would rather be able to do my calculations in whatever units work for me and / or the client and / or the source reference I am working from.)

On 4/29/2010 2:33:00 AM, jhardy wrote:
>jmg,
>
>I don't intend to reopen the
>debate of calculating with
>units versus unitless with you
>again - let's just say we
>agree to disagree on that
>particular issue!
>
>With respect to the basic
>calculation - the problem
>first arose in a much more
>complex worksheet than the one
>I posted - I just wanted to
>make the simplest possible
>demonstration of the nature of
>the problem.
>______________________________

You made your point about the nature of the problem.

For sure users of the units system are at liberty to discard Engineering practice. By that I mean that my clients [also our clients] were asking that formulas be executed in the dimensional form in order that all the conversion be carried and in appropriate "UnitResult", and that years and decades before Mathcad or else existed. There are lot of pressure unit system but there is only ONE primary standard. Your demonstration is just great, showing the importance of making any calculation fully visible and traceable with or w/o units. How do you think Eiffel put it down and up ? It's only very recent that his "model or work" has been computerized.

It WAS interesting, thanks.

jmG

PS: your pressure unit is dramatically incorrect considering the extremes in atmospheric pressures recorded under different cyclones/tornados/typhoon/twisters recorded ... or vice versa the weight density of air. OK, you put � tolerances.
TerryH
1-Newbie
(To:jhardy)

Cheers Julian,

I agree it is a "bug" people should be made aware of based on your simple file example. People often forget engineers use calculations to design things that not properly designed can put people and property at risk. They need confidence in computer software calculations.

In-Line evaluation gives me screen refresh problems so I try to never use it. My problem relates to using it on Windows 7 64 bit, not a recognized platform, so I run with a few tweaks for graphics I found on the collaboratory.

Was not aware In-Line Evaluation also corrupted vector values making computations in error. PTC need to address this.

Thanks for bringing this to the attention of the community of users. It is serious issue. I don't know how we give this knowledge to a wider circulation of users.

It was a "feature" added to version 14 from 13. The "feature" is described in promotional literature.

Regards
Terry H.

"It was a "feature" added to version 14 from 13"
______________________________

In-line evaluation dates back to at least mathcad 8. Of rare and specific utility, that should be carefully used or not used at all in normal visible construct.



jmG
RichardJ
19-Tanzanite
(To:TerryH)

On 4/29/2010 3:13:35 AM, TerryH wrote:

>Was not aware In-Line
>Evaluation also corrupted
>vector values making
>computations in error. PTC
>need to address this.

It's been fixed. If you are seeing the bug then download and install the service release.

Richard
Top Tags