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

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

Calculating a Function out of a cloud of points

sm�ller-2
11-Garnet

Calculating a Function out of a cloud of points

Hallo,

i have a Problem i need to solve fast 😞

Problem:

Density is a function of pressure and temperature

I can create a cloud of points for the density:

                         Temperature

Pressure                 100°          200°          300°  

      100bar           Density      Density

     200 bar

     300 bar

          etc                  

         

My problem is now, how can i calculate a Density Function depending on these Input Points?

Can anyone help me ?

Thx 😃

8 REPLIES 8

Look up "Curve Fitting and Smoothing" and "Interpolation and Prediction" in Help.  You may find the cspline 2D example of particular interest.

Stuart

There are a number of possibilities.

If you know (from theory or observation) the form of the expression

you can find the least squares values of the coefficients that "fits" the cloud of points.

Or, you can brute-force a fit.  Mathcad will do a polynomial least squares fit to the data.  "regress" is a function from "old" Mathcad that will do a fit to whatever order polynomial you choose and the data will support.  "polyfit" is available in Prime--it will allow you to specify the order of the fit and allow specific combinations of independent variables.

RichardJ
19-Tanzanite
(To:sm�ller-2)

You need to fit a surface to your data. You don't say where the data is from though; ideal gas, non-ideal gas, solid, liquid? You could fit a physical equation to the data, for example using minerr, or a multinomial,, using regress. We need more information to go much beyond that.

I assume you are ok interpolating between the data points you created.  If so, this should be all you need to do:

bicubic.jpg

Yea there is no possible equation i think its from measured data.

Its a mixture of Ehthylen and solid  30% Propylen Particles or so.

A polynomic Interpolation or fitting is what i needed.

Real gas.

@dferry its exactly what i needed THx!

In love with Mathcad

I got to thinking about plotting the data.  Came up with this.  Maybe someone knows a simpler way.  I couldn't figure out how to get a mesh; not sure if it's possible, particularly in Prime.

zplot3.jpg

fyi, I had to remove the units because it won't plot otherwise.

Top Tags