cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

Functional Expression for Density from Beattie Bridgeman Equation

jroth
4-Participant

Functional Expression for Density from Beattie Bridgeman Equation

Hello,

I'm wondering if it is possible to set up a function to calculate the density from the Beattie Bridgeman Equation. The equation is pressure as a function of the specific volume and temperature. P(T,v). However, the answer I want is the density. I can solve it using a solve block, but would like to be able to express the solution as funtion. I.e; rho(T,P) = answer, where I just need to input the Temperature and Pressure. But as seen, the pressure is a function of the density.

I have attached the MathCad 15 sheet that has the function, but I'm unsure if I will need to use the mathcad programming to get an answer back in the way I would like. I don't know if there is a way to set up the solve block or solution such that I can have the expression be as above.

1 ACCEPTED SOLUTION

Accepted Solutions
AlanStevens
17-Peridot
(To:jroth)

See the attached.

Alan

View solution in original post

3 REPLIES 3
AlanStevens
17-Peridot
(To:jroth)

See the attached.

Alan

jroth
4-Participant
(To:AlanStevens)

Alan,

Thank you for the response. As a question of how it is working; is the program making a loop in the definition? Are we circularly defining both the density(T,P) and P(T,density), but we are just giving it a starting place with the density?

If we are, I didn't know that would work.

AlanStevens
17-Peridot
(To:jroth)

You have defined the Pressure function above the Given ... Find solve block, so there is no need to define it again within the block. All we are doing is making sure it equates to the specified value, Pin.

The solve block uses an iterative method to find density, so it needs a starting value. This is the value of 1 kg/m^3 defined immediately above the word Given. Here, the same initial value is used whatever the conditions you are considering; however, this is probably ok for your application. If this restriction causes problems you could include the initial guess as an input argument to the function (but then you would need to call rho with rho(initial rho, T,P)

Basically, the solve block uses the intial value of rho and the input Temperature to calculate P(T,1/rho). It then compares this value with the input pressure, Pin. If they agree (to within a tolerance) then the block returns that value of rho. if it doesn't agree, it changes the value of rho and tries again. It repeats this process until it gets agreement.

Alan

Top Tags