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 Harvey Hensley  
#1 Posted : 10 July 2020 03:32:16(UTC)
Harvey Hensley


Rank: Member

Groups: Registered
Joined: 28/05/2020(UTC)
Posts: 18
United States
Location: Bartlesville, OK

Was thanked: 4 time(s) in 2 post(s)
The transpose and vectorize functions don't work as expected. My guess is that these problems may be due to the use of Prode Physical Properties during the creation of the matrix and vectors involved in the examples.

transpose errorvectorize error

The Smath file for these errors is attached.

Example 7 errors.sm (85kb) downloaded 24 time(s).

I found the solution. I used eval() of variables obtained from Prode PP. This broke the dependency on Prode. Both transpose and vectorize of division now work for the problems shown.

Edited by user 10 July 2020 19:29:03(UTC)  | Reason: problems solved

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

Offline Jean Giraud  
#2 Posted : 10 July 2020 16:46:12(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
SS 6179 does not open your 7251 ... incorrect format.
No idea what Prode is doing ?
No interest for WASP. Get it IAPWS from Katmar, they have more than WASP.
For those properties not interpolated from system providers,
they must be available from data in your Prode Smath.
Nothing can come from not visible data from source.
Cubic is a very poor fitter unless data are cubic.
Very few phenomenons are cubic by nature.
Jean

Page14 Harvey.sm (717kb) downloaded 10 time(s).
Offline Jean Giraud  
#3 Posted : 10 July 2020 23:18:40(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: Jean Giraud Go to Quoted Post
Cubic is a very poor fitter unless data are cubic.

You can get lot more from Cholesky matrix solver.
These two examples are remarkable pieces of fitting.

Genfit Rational [2 styles Broyden, Ge].sm (118kb) downloaded 19 time(s).
Offline Harvey Hensley  
#4 Posted : 12 July 2020 17:49:31(UTC)
Harvey Hensley


Rank: Member

Groups: Registered
Joined: 28/05/2020(UTC)
Posts: 18
United States
Location: Bartlesville, OK

Was thanked: 4 time(s) in 2 post(s)
Prode obtains their data from DIPPR and DECHEMA and then fits the data for equations of state, binary interaction parameters where data are available and properties such as heat capacity. Prode has 17 different equations for heat capacity and chooses the best one for each compound. In the Prode archive, the temperature range of the data is given. For benzene, the range is 50 to 1500 K. The equation used for benzene heat capacity is highly non-linear as shown in the figure below. That equation cannot be symbolically integrated which means the reactor model would have to repeatedly integrate cpDT numerically to obtain enthalpy. Instead, I compute the heat capacity values for the range of interest from the PPP enthaly and then re-fit to a cubic equation. As you can see, the cubic fit is very good.

heat capacity fit

I knew that the sm file attached to my original post would not compute without Prode and my Prode database. However, I expected someone could look at the code and suggest a solution. Instead, I was able to find the eval solution. Using eval also reduced the computation time by an order of magnitude.

thanks 1 user thanked Harvey Hensley for this useful post.
on 12/07/2020(UTC)
Offline Jean Giraud  
#5 Posted : 12 July 2020 22:49:44(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Prode data sets is public but not free.
Why should I pay $ to share my skill in fitting ?
> 2300 products up to 35 properties per component.
That is no sweat for Smath. However, data sets are needed.

Page6 Pentane.sm (8kb) downloaded 17 time(s).
Offline Jean Giraud  
#6 Posted : 13 July 2020 01:08:44(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Harvey,
If you wish, you can exercise your cubic(s).
The red fit is one piece.

Water rho.PNG
Offline Harvey Hensley  
#7 Posted : 15 July 2020 00:57:47(UTC)
Harvey Hensley


Rank: Member

Groups: Registered
Joined: 28/05/2020(UTC)
Posts: 18
United States
Location: Bartlesville, OK

Was thanked: 4 time(s) in 2 post(s)
Originally Posted by: Jean Giraud Go to Quoted Post
Harvey,
If you wish, you can exercise your cubic(s).
The red fit is one piece.


Although this thread has deviated from the original subject (function errors) to the merits of different fitting functions and thermo software, I will respond with some fits to the water density data.

I don't expect the cubic polynomial to fit every set of data. In the past I have used various nonlinear functions, using genfit in Mathcad. Looking at your curve, I would probably have started with a natural log function. The first plot below shows the cubic fit and the ln fit. The latter does quite well with one term and three parameters. The cubic does fairly well except near the critical point.

cubic and ln fits

The plot below shows the Prode equation used for the liquid water density. It does well through out the data range, including near the critical point. The equation does not work with a reduced temperature of 1.

PPP fit

Finally, I think you may have misinterpreted my intent in my last post. I described what Prode uses for data and their fitting capabilities because you had said you didn't know what Prode was doing. I was not promoting Prode.
Offline Jean Giraud  
#8 Posted : 15 July 2020 20:11:59(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: Harvey Hensley Go to Quoted Post
The plot below shows the Prode equation used for the liquid water density. It does well through out the data range, including near the critical point. The equation does not work with a reduced temperature of 1.

In my times, Prode was the Air Liquide Bible, in English too.
I have the water rho IAPWS from B. Spang in Mathcad.
Very many data sets have model(s).
Otherwise, we rescue via interpolation methods, mostly:
1. Padé normalized rational fraction.
2. ChebyShev linfit.
3. Thiélé inverse interpolation.
4. Piece wise LSQ [can't make it work Smath].
5. Convolution Polynomials [Laser].
Some data set can only be fitted by hand [Chemist].
All that said in short, why not re-thread to be more attractive ?
Prode Discussion would attract greater audience.

Water rho.PNG

Genfit Chemist.sm (35kb) downloaded 7 time(s).
Inst_Type T_J NBS 125.sm (119kb) downloaded 7 time(s).

Users browsing this topic
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.