Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Generating reports in Word from MathCad calculations 4

Status
Not open for further replies.

EMorel

Mechanical
Sep 6, 2012
43
Good morning Gentlemen,

I don't frequent this forum much, and I did a quick search but did not find much that related to my question. I use MathCad 11 for completing Seismic Analysis in accordance with the ASME BP&V Code. I have created a template that I input a about a dozen variables into and it will run through about 50-60 equations for me.

I then transpose the results of the MathCad calculations into a Word document that serves as my report. I use Word because it provides a clean mixture of text and equations without having to see what MathCad does (the equation definition and then the equation solution side by side)

My question is: Is there a way that I can export only my results into defined points of a Word document? Like with Excel and Word, you can link a spreadsheet to a document and as you change the spreadsheet it will update the Word Doc. I know it might be a long shot, but I figure it was worth asking people that have more MathCad experience than I do, since I am pretty much self-taught from the Mathcad manual.

If this is not possible, do you guys have any suggestions as to what would be a more effective process? Currently, we are running into issues where there is too much room for error in the transposition of results. Myself or someone else trying to accurately read and re-write 50-60 different numbers can easily get a fit of dyslexia and screw something up.
 
Replies continue below

Recommended for you

M11 came with an Excel add-in that works in Excel, so you could output the results into Excel, and embed the Excel sheet within the Word document.

TTFN
faq731-376
7ofakss
 
Use one of Mathcad's file / data ouput components / functions to create an appropriate number of text files (ie, one for each point in the Word Document that you need).
Use Word's file import mechanism to link to those files.


I usually use IFRs's suggested method of putting all of my equations in an Area and collapsing it. However, it may require some work to restructure a worksheet retrospectively and the file-read route may be easier.
 
Thanks for the input guys! I hadn't ever heard of the hidden regions, I may see if I can do something with that and write my report directly into MathCad.

Is there a way to sequentially show a solution in MathCad? That's not really the term I would use to describe it, but for example, I have many different spots where I currently have something that defines an equation, and then solves the equation for the report. Example (not really in the report, but easy to visualize)=

"sqrt(a[sup]2[/sup] + b[sup]2[/sup]) = c .... Pythagorean Theorem. (a and b are previously defined in the report somewhere),

c = XX"

Is there a way to go directly from the definition to the answer without requesting c in the program? Like this:

"sqrt(a[sup]2[/sup] + b[sup]2[/sup]) = c = XX"

I don't think there is, but it would make it much more simple to present in MathCad this way if I can! I've tried just bolding my solutions, but it bolds every constant/variable in every equation, whether it be a definition or a result.

Sorry for the newcomer questions, I have never used MathCad outside of generic problem solving! And thanks for the tips so far!
 
In newer versions of mathcad you can do what you want, but I'm unsure when it was implemented. I know with V14 I am able to do that, but with mathcad 2000 I can't.
 
structSU10,

In your version, how do you do it? If I define an equation, it won't let me hit an equal sign in the same equation. If you can tell me how you do it in 14, I'll try it in 11.
 
Yea, its as simple as that, just hitting the equal sign after defining the equation. A way you could work around it is type the equation as text and then go to instert>math region and do the C : , it should look the same, and will still be a live calculation.
 
You can, you can use <CTRL>= instead of just =, which calls up the constraint operator used in solve blocks. This results in a dead expression, though, but can be used for the purposes of illustration and documentation.

TTFN
faq731-376
7ofakss
 
EMorel said:
I hadn't ever heard of the hidden regions, I may see if I can do something with that and write my report directly into MathCad.
Just for the sake of terminological exactitude, I'm not sure that Mathcad in any variant can hide individual regions but what it can do is define a section of a worksheet as an "Area". An Area is bounded by two horizontal markers that span the width of the worksheet. An Area can be named and can be "Collapsed"; collapsing an area effectively rolls up the bottom marker to meet the top marker, thus 'hiding' all the regions that it contains. You can password protect an Area to stop casual users from expanding it (useful for both protecting your intellectual property and for stopping the ignorant from messing with things and then complaining it don't work no more! [evil]). However, whilst Areas are definitely useful, they won't allow you to show an equation and result side-by-side but they might allow you to hide a lot of "detail".

Mathcad 11, as you've probably found out, doesn't have the inline "c:=a+b=" facility ... I think it was introduced in Mathcad 12 (which, version you fortunately can't get anymore unless you're very unlucky).

 
Excognito,

Thank you for the explanation, I did discover the usefulness of Areas and collapsing them, though for this report instance it wont do me much good.

So, after 12 they removed the feature to have "c:=a+b=" ?? This program is pretty awesome, but that seems odd. lol
 
Sorry, did I give that impression? No, they ADDED the capability in M12 - it's not in Mathcad 11 (or, at least, it's not in mine!). It's definitely in M15 and Mathcad Prime 2.0.
 
Ah, got it, I read that as It was introduced in 12... you cant get it anymore. lol
 
No, luckily you can't get V12 anymore. It was absolutely the worst, buggiest, piece of junk that MathSoft ever produced and was a factor in them having to get rescued by PTC.

Sounds like there is enough information above to do what you want within MathCad directly. In any version back to about V0.5 you can type <cntl>= to put anything you want equal to anything else (and as many times as you want) and it is not evaluated outside a program or a solve block. So

c<cntl>=sqrt(a[sup]2[/sup]+b[sup]2[/sup]<cntl>=5cm

Is perfectly acceptable to the parser. You could put a:3 cm, b:4 cm, c:sqrt(a[sup]2[/sup]+b[sup]2[/sup]) in a collapsed area and type the answer into your <cntl>= expression. This has the risk that you won't update the hard number if conditions change.

I did:
a:3cm
b:4cm
c:sqrt(a[sup]2[/sup]+b[sup]2[/sup] c=5cm

in actual documents for 10 years and did't feel like it detracted much from the people who wanted to follow the math. Getting headers, footers, and pagination right in MathCad is always a challenge, but sometimes it is worth it.

David Simpson, PE
MuleShoe Engineering

"Belief" is the acceptance of an hypotheses in the absence of data.
"Prejudice" is having an opinion not supported by the preponderance of the data.
"Knowledge" is only found through the accumulation and analysis of data.
 
In my last post please pretend that if a closing parentheses is required but missing, then I meant to put it in the proper place.

David Simpson, PE
MuleShoe Engineering

"Belief" is the acceptance of an hypotheses in the absence of data.
"Prejudice" is having an opinion not supported by the preponderance of the data.
"Knowledge" is only found through the accumulation and analysis of data.
 
Zdas04, I understand what you're saying about the <ctrl>=, but as you said, the problem is that it won't update if parameters change, which is the point of doing it all in MathCad instead of transposing to a separate report.

Looks like I'm going to be pushing the company for a later version, because being able to do the "c:=a+b=XX" would GREATLY clean up this report. Luckily, MathCad isn't the most expensive program out there!
 
The only point is you get the appearance of a function you wanted. Once I retired and started my own business I started using MathType for equations in the body of a report and just generated appendix in native MathCAD (with areas hidden). That works for me.

If you get a new version of MathCAD and start using the == stuff you need to be really careful to make sure that everything updates with a change. In V14 that doesn't happen most of the time. I end up having to put the cursor on every equation and hit F9 to make sure that I'm seeing the current stuff. Can be frustrating. Not enough to go to V15.

David Simpson, PE
MuleShoe Engineering

"Belief" is the acceptance of an hypotheses in the absence of data.
"Prejudice" is having an opinion not supported by the preponderance of the data.
"Knowledge" is only found through the accumulation and analysis of data.
 
So if I were to update my MC, what version would be ideal? Can I still get older versions before Prime? From what I'm reading, Prime 2.0 is a step backwards from 11? Keep in mind that I don't use MathCad for many things, and I only have a library of about 10 worksheets that, if necessary, I could re-write in a newer version. I'm not doing anything outrageous either, the hardest equations require only the basic principals of calculus, the rest is basically algebra, just a lot of it.
 
If you intend to upgrade, go for version 15. Not only is it the currently supported version, but it is also, in my opinion, the best of the post V11 versions. If your needs are limited as you describe, then you might like to try Prime 2. It's still not up to M11/M15 standards, but it still reasonably capable and looks slightly more "professional" in some respects. Prime actually has a few advantages over M15 in that it has dropped the static type checking introduced in M12 onwards and added mixed units in arrays. You get M15 for free if you buy Prime.
 
According to PTC's published roadmap for Mathcad, M15 will be supported with maintenance releases through 2014, and MP3 is to be released sometime this year.

TTFN
faq731-376
7ofakss
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor