×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Are you an
Engineering professional?
Join Eng-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

#### Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

# Explicit Calculation2

## Explicit Calculation

(OP)
Hi all,

In some reports, where variables have been stated earlier in the report it would be easier for those (other than myself) reading the document to see the values in the calcuation as well as the variables.  Obviously this is as opposed to restating the values at the start of the calc (and wasting a lot of space).

Simple example (a=2in, b=3in, F=85ksi):

P=a*b*F
=2in*3in*85ksi
=5.1e5 lbf

I can show this calc using the explicit function with relative ease.

MY QUESTION:

What if i didn't have a=2in however?  What if 'a' was calculated from two other variables, i.e. a=x-y (x=5in, y=3in)?

I then get:

P=a*b*F
=(x-y)*3in*85ksi      (this is the line i get)
=2in*3in*85ksi        (this is the line i need)***
=5.1e5 lbf

Is there any way of achieving this in Mathcad (v13)?

### RE: Explicit Calculation

You'll have include x and y in your calculation. E.g. explicit,a,x,y,b,F. This isn't quite what you want, but it is "explicit".

### RE: Explicit Calculation

(OP)
If 'a' is a simple calculation as in my example, that is ok.  However if it is a more complex calc, this becomes more of a problem.

Is there a way of just showing the value of the variable 'a' and not it's origins?

Thanks again...

### RE: Explicit Calculation

It's not very sophisticated, but why not just "echo" the current values of the relevant input variables just before you evaluate the expression; e.g.:

a =
b =
F =

P = a*b*F
P =

### RE: Explicit Calculation

Hi Ferry,

I have the exact same problem, i was hoping to find a solution here.

I did have to use all above solutions in the past, but they are not what i am looking for (and very cumbersome in some cases)

Did you find another way?

Does one know of a function that would output the value stored in a variable as opposed to the formula it is made up ?

Does one know how to explicitly output a variable once it has passed thru an IF statement ?

Thank you
Thierry

### RE: Explicit Calculation

(OP)
Hi there,

Sadly a simple solution never turned up.  I've had to use a combination of two options.

The first is as JulianHardy says above.

The second achieves what I was after as far as the presentation of the report is concerned, however it involves using a little cheat which can really screw up your calculations if you don't keep a close eye on it.

Say x := y + z
then x = <some value>

Off the page, to the right of the visible border and slightly below the 'x = <some value>' line, I then REDEFINE 'x' MANUALLY to be equal to the value shown above.

i.e. x := <some value>

This is where the problems come in, obviously you need to make sure that this re-definition isn't interfering with your current calc, or declaration of x as a result of the calc.

Then, equally obviously, any changes you make to the calculations won't automatically carry through the document, you need to go through the document from your change downwards and redefine each of the values manually.

There's a huge scope for error in this, without being quite vigilant in your checking. I highlight each redefinition in some disgusting colour to make sure I don't forget to check them.

The plus point is that the variables are now stored as their value, rather than as their derivations.

I guess it's down to evaluating how important it is that you can display your calculations explicitly, against the added work and error risk of the above method.  I personally use it for smaller forms, but avoid it for any lengthy calculations.

Maybe in some future version of mathcad this'll be possible.  I haven't upgraded to v14 yet so I don't know whether it's fixed there or not.

Good luck,

Scott

### RE: Explicit Calculation

Thanks Scott,

We'll we got around the exact same way, with the odd hand input, brigth red not to forget it. Unfortunately, as you say, it is taking out the automation and can lvery misleading if one value is forgotten.

Thanks
Thierry

#### Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

#### Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Close Box

# Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!