Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline uni  
#1 Posted : 21 June 2014 23:52:14(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,494
Man
Russian Federation

Was thanked: 1274 time(s) in 745 post(s)
Dependences: Mathcad Custom Functions.

CoolProp for PTC Mathcad

Quote:
CoolProp is an open-source, cross-platform, free, thermo physical, fluid properties database that includes pure fluids, pseudo-pure fluids, and humid air properties. Nearly all the fluid models in CoolProp are based on Helmholtz energy formulations, and therefore the thermodynamic properties of interest can be obtained directly from partial derivatives of the Helmholtz energy.

Distributed with the most recent version of CoolProp (4.0.0) are PTC Mathcad “User Function” libraries, designed to wrap some of the primary CoolProp functions and make them available within PTC Mathcad worksheets. There are wrapper libraries defined for both PTC Mathcad 15.0 and PTC Mathcad Prime 3.0. The CoolProp wrapper source code for PTC Mathcad is also open-source and distributed freely on the CoolProp website.

In addition to the source code, there are pre-compiled libraries (.dll files) for both PTC Mathcad 15.0 and PTC Mathcad Prime 3.0. The provided PTC Mathcad 15.0 .dll was compiled/built in a 32-bit environment. The provided PTC Mathcad Prime 3.0 library was compiled/built in a 64-bit environment. If using a PTC Mathcad environment other than the two mentioned, there are build-scripts and instructions distributed with the source code, enabling users to build the CoolProp wrapper library specific to their environment.


Code:
Wrapper of CoolProp for MathCAD 15
==================================

copyright Scott Polak and Ian Bell, 2013

To Use
======

* Copy the CoolPropMathcadWrapper.dll file to C:\\Program Files (x86)\\Mathcad\\Mathcad 15\\userefi or equivalent for your version

* Open the CoolPropFluidProperties.xmcd file in MathCAD, fields should populate

To Build
========

* You will need to have Visual Studio 2008 installed (Express version is fine).  Alternatively newer versions of Microsoft Visual Studio C++ should be fine, you'll just have to update the path to the vcvarsall.bat in the BuildDLL.bat file

* Run the BuildDLL.bat file, it will generate the CoolPropMathcadWrapper.dll

* Follow the above instructions


Links:

1. CoolProp Website.
2. CoolProp for PTC Mathcad.
3. Download CoolProp-4.2.2-windows_superpack.zip ( 46.4 MB ).

Edited by user 10 January 2022 07:28:38(UTC)  | Reason: Not specified

File Attachment(s):
CoolPropFluidProperties.pdf (160kb) downloaded 490 time(s).
CoolPropFluidProperties.sm (45kb) downloaded 430 time(s).
Russia ☭ forever
Viacheslav N. Mezentsev
thanks 2 users thanked uni for this useful post.
on 22/06/2014(UTC),  on 22/06/2014(UTC)

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline mkraska  
#2 Posted : 22 June 2014 01:36:13(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,985
Germany

Was thanked: 1124 time(s) in 721 post(s)
Hello uni,

I'd like to include this in the portable distribution but so far I fail to do so. Putting coolprop.dll into the userefi directory does not seem to do the job.

efi.txt says

22.06.2014 00:28:26 [LoadLibraries] begin:
22.06.2014 00:28:26 [LoadLibraries] D:\FHB\Software\SMath\2014 06 21 SMath and Maxima\extensions\plugins\91a20d24-c30b-4774-9b1b-4d502a80420f\1.0.4977.35617\userefi\CoolProp.dll loaded.
22.06.2014 00:28:26 [CreateUserFunction] Psi - [DIGAMMA.DLL] [ z ] Digamma function for complex z
...

All functions in your example file are undefined.

Thanks for any hint.



Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline uni  
#3 Posted : 22 June 2014 07:20:53(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,494
Man
Russian Federation

Was thanked: 1274 time(s) in 745 post(s)
CoolPropMathcadWrapper.dll

Code:
To Use
======

* Copy the CoolPropMathcadWrapper.dll file to \\userefi or equivalent for your version

* Open the CoolPropFluidProperties.xmcd file in MathCAD, fields should populate


Code:
22.06.2014 10:18:04 [LoadLibraries] begin:
22.06.2014 10:18:04 [CreateUserFunction] FluidProp1 - [CoolPropMathcadWrapper.dll] [ Fluid, Property Name ] returns a fluid-specific parameter, where the parameter is not dependent on the fluid state
22.06.2014 10:18:04 [CreateUserFunction] FluidProp - [CoolPropMathcadWrapper.dll] [ Output Name, Input Name 1, Input Property 1, Input Name 2, Input Property 2, Fluid Name ] returns a fluid-specific parameter, where the parameter is dependent on the fluid state
22.06.2014 10:18:04 [CreateUserFunction] FluidPropI - [CoolPropMathcadWrapper.dll] [ Output Name, Input Name 1, Input Property 1, Input Name 2, Input Property 2, Fluid Name ] returns a fluid-specific parameter, where the parameter is dependent on the fluid state, using integer math for faster computation
22.06.2014 10:18:04 [CreateUserFunction] HAProp - [CoolPropMathcadWrapper.dll] [ Output Name, Input Name 1, Input Property 1, Input Name 2, Input Property 2, Input Name 3, Input Property 3 ] returns a parameter of humid air, where the parameter is dependent on the fluid state and humidity
22.06.2014 10:18:04 [CreateUserFunction] FluidPropsParams - [CoolPropMathcadWrapper.dll] [ string, name of the parameter to retrieve ] returns the value of the requested CoolProps parameter
22.06.2014 10:18:04 [LoadLibraries] C:\Users\User\AppData\Roaming\SMath\extensions\plugins\91a20d24-c30b-4774-9b1b-4d502a80420f\1.0.4977.35617\userefi\CoolPropMathcadWrapper.dll loaded.
22.06.2014 10:18:04 [CreateUserFunction] Psi - [DIGAMMA.DLL] [ z ] Digamma function for complex z
22.06.2014 10:18:04 [LoadLibraries] C:\Users\User\AppData\Roaming\SMath\extensions\plugins\91a20d24-c30b-4774-9b1b-4d502a80420f\1.0.4977.35617\userefi\DIGAMMA.DLL loaded.
22.06.2014 10:18:04 [CreateUserFunction] kronecker - [KRONECKR.DLL] [ M,N ] Kronecker product of a square matrix M and a square matrix N
22.06.2014 10:18:04 [LoadLibraries] C:\Users\User\AppData\Roaming\SMath\extensions\plugins\91a20d24-c30b-4774-9b1b-4d502a80420f\1.0.4977.35617\userefi\KRONECKR.DLL loaded.
22.06.2014 10:18:04 [LoadLibraries] end.
Russia ☭ forever
Viacheslav N. Mezentsev
thanks 1 user thanked uni for this useful post.
on 22/06/2014(UTC)
Offline omorr  
#4 Posted : 22 June 2014 10:25:57(UTC)
omorr


Rank: Administration

Groups: Registered, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,740
Man
Serbia

Was thanked: 318 time(s) in 268 post(s)
Thank you uni Good

Regards,
Radovan
omorr attached the following image(s):
CoolPropFluidProperties.png
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
Offline mkraska  
#5 Posted : 22 June 2014 11:24:22(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,985
Germany

Was thanked: 1124 time(s) in 721 post(s)
Originally Posted by: mkraska Go to Quoted Post

All functions in your example file are undefined.
Thanks for any hint.

I used the wrong dll (from excel and dll subfolder).
Now the library seems to work. Just strSplit() is undefined.

Maxima has a function split(string, delimiter), however, due to a translation bug only the default delimiter (space) works. Therefore, the kommas have to be replaced by spaces first.
mkraska attached the following image(s):
dplit.PNG
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
thanks 2 users thanked mkraska for this useful post.
on 22/06/2014(UTC),  on 22/06/2014(UTC)
Offline Robert  
#6 Posted : 01 September 2014 22:54:02(UTC)
Robert

Rank: Newbie

Groups: Registered
Joined: 31/08/2014(UTC)
Posts: 3
Austria

Hello and thanks for the infos already given here.

I tried to follow the instuctions on my linux system :

- Portable SMath and Maxima is installed successfully
- The CoolPropMathcadWrapper.dll was already in the userefi directory
- Efi plugin installed

However so far the CoolProp functions are not recognized.

Maybe its not possible to use CoolProp with SMath on Linux? As MathCAD doesn't run under Linux the following line given by Uni makes me think so:

* Open the CoolPropFluidProperties.xmcd file in MathCAD, fields should populate

If anybody managed to run it under linux I would be very interested.

Thanks,
Robert
Offline mkraska  
#7 Posted : 02 September 2014 00:59:57(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,985
Germany

Was thanked: 1124 time(s) in 721 post(s)
Originally Posted by: Robert Go to Quoted Post
Hello and thanks for the infos already given here.

I tried to follow the instuctions on my linux system :

- Portable SMath and Maxima is installed successfully

Do I get it right, you really got to work the Maxima plugin under linux? Could you please explain, how that was done?

Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline uni  
#8 Posted : 02 September 2014 14:00:17(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,494
Man
Russian Federation

Was thanked: 1274 time(s) in 745 post(s)
Show me efi.txt.
Russia ☭ forever
Viacheslav N. Mezentsev
Offline Robert  
#9 Posted : 09 September 2014 01:14:42(UTC)
Robert

Rank: Newbie

Groups: Registered
Joined: 31/08/2014(UTC)
Posts: 3
Austria

Hi Mkraska,

Well, yes I am running the portable version (2014 08 24 SMath and Maxima) under Linux (Linux Mint 16 Petra). I so far did basic static calculations, that works but I don't know if the Maxima plugin is used... It couldn't have been easier to install it, I just followed the instructions. Sorry that I cant tell more but please just write me if you want more info or a kind of test.

Regards,
Robert
Offline mkraska  
#10 Posted : 09 September 2014 01:54:51(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,985
Germany

Was thanked: 1124 time(s) in 721 post(s)
Originally Posted by: Robert Go to Quoted Post

Well, yes I am running the portable version (2014 08 24 SMath and Maxima) under Linux (Linux Mint 16 Petra). I so far did basic static calculations, that works but I don't know if the Maxima plugin is used... It couldn't have been easier to install it, I just followed the instructions. Sorry that I cant tell more but please just write me if you want more info or a kind of test.

There are some examples in the interactive handbook. Open the handbook via [?] button in the toolbar. Navigate to Mathematics> Symbolic Math with Maxima
If you get a pop-up window "Start Maxima" with a progress bar (not more than 20sec) and no errors in the math regions, then Maxima is running.

A quick test would be to type Maxima TAB a+b and evaluate that symbolically (-> button in the arithmetics palette).

Yet I do not expect Maxima to run, as it has never been tested under Linux in the development. Under linux, Maxima can hardly be run by starting maxima.bat, as done by the plugin. There might be a chance in wine, but I haven't heard of any success.

Edited by user 09 September 2014 01:59:30(UTC)  | Reason: Not specified

mkraska attached the following image(s):
maxima.PNG
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline uni  
#11 Posted : 09 September 2014 11:24:36(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,494
Man
Russian Federation

Was thanked: 1274 time(s) in 745 post(s)
CoolProp 4.2.5 also works: Wrapper of CoolProp for MathCAD 15.
Russia ☭ forever
Viacheslav N. Mezentsev
Offline Robert  
#12 Posted : 10 September 2014 23:27:11(UTC)
Robert

Rank: Newbie

Groups: Registered
Joined: 31/08/2014(UTC)
Posts: 3
Austria

Hi Uni and Mkraska,

I tried what you suggested, and yes, I did't manage to run Maxima on my linux system although I can use SMath. It seems to me that there is something with the file system, because :

- When I declare the Maxima installation path, the program aborts
- In the /userefi directory there is no efi.txt file

My solution is simply to install Windows so that I can use SMath for my calculations.

Thanks for your hints and for that great program,
Robert
Users browsing this topic
Similar Topics
Make Up Water Requirement using CoolProp Enthalpy Balance (Questions)
by ioncube 19/02/2023 21:03:43(UTC)
Finding a Temperature with Root, Solve or FindRoot Using CoolProp (Questions)
by Valentino 30/03/2022 16:20:10(UTC)
coolprop plugin problem (Bugs & Problems)
by gabrago 02/07/2021 16:26:34(UTC)
CoolProp [IAPWS-IF97] (Samples)
by Jean Giraud 14/03/2019 15:18:03(UTC)
Ideal Vapor-Compression Refrigeration Cycle (CoolProp) (Samples)
by vmit 01/04/2018 19:57:02(UTC)
Diff and Coolprop (Questions)
by Razonar 28/01/2018 05:37:12(UTC)
CoolProp units (Questions)
by Peter J Francis 01/08/2017 13:43:27(UTC)
CoolProp Wrapper (Extensions)
by Davide Carpi 29/03/2016 02:11:53(UTC)
Coolprop wraper (Bugs & Problems)
by Dzinic 20/09/2015 23:59:03(UTC)
CoolProp version 5 wrapper (Questions)
by ibell 03/12/2014 20:55:01(UTC)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.