Is there a way to create user defined functions in such a way that they can be accessed from a new worksheet that doesn't have the funciton defined in that workspace, essentially to have it behave like a built in function? If this cannot be directly achieved in Mathcad 15, how else would you go about doing this? I want to start with a very basic function like logarthic temperature difference (LMTD)
LMTD(t2,t1) := (t2-t1) / (ln(t2/t1))
such that in a new worksheet I could only have to type
LMTD(25,50) =
and get my answer of 36.067 without having to define LMTD in every worksheet I use.
Thanks
You can insert a reference to the worksheet with your functions on top of the new WS. So you can use your functions as demanded.
From MC15 help:
Including One Worksheet Inside Another |
You can insert a reference to a worksheet, which makes the current worksheet behave as if you had inserted the actual regions from the referenced worksheet.
To insert a reference to a worksheet:
C:\Program Files\Mathsoft\Mathcad\conform.xmcd
http://www.ptc.com/go/mathsoft/coeffs.xmcd
Upon completing these steps, you see an icon,
with the name of the referenced worksheet. The referenced worksheet's definitions and functions take effect at this point, just as if you had copied them into the worksheet. Double-click the icon to view the referenced worksheet.
In version 15 (and before) it was possible to create a template that you could open as a "blank" worksheet. You could create an "area" in that worksheet and define constants and functions in that area, then collapse the area (and the constants and functions would magically disappear). Then, every time you opened a new sheet from that template the constants and functions would be there, hidden, in the collapsed area. Ready to use.
Prime does not (yet) have that capability.
This is the approach that I use. I like it because it is portable -- I can just carry a template around with me (e.g., from installation to installation) without having to worry about an extra worksheet. Clearly, though, Werner's approach will also work -- personal preference.