CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   How to get a formula from data. (https://www.cfd-online.com/Forums/main/2590-how-get-formula-data.html)

 Q.Ronnie September 12, 2000 05:45

How to get a formula from data.

hello, everyone.

Now I have a lot of data from simulation to be dealt with. The only thing I want to do is to summarize a formula with those data. For example, y=f(x1,x2,x3). CAN anyone tell me a thread about how to do to get a formula from a series of data.

Thank you.

 A. Taurchini September 12, 2000 06:53

Re: How to get a formula from data.

Well, what you should do is interpolate your data in your computational domain, but there are a lot of ways for doing this. The simpler thing to do is defining a polinomial such as

a0 + a1x +a2x^2 + .... = y

where a0,... are the unknowns and x is your variable (you can easily extend this to multiple variable), and assign your data to this curve obtain the numerical coefficients a. The accuracy of course depends from the maximum exponent of the polinomial you choose. This is obviously not the best method but you can find a lot of bibliography on this argument (data interpolation). Just one more thing ... remember that the relation you'll find will be valid (with a certain error of course) only within your computational domain.

 Anindya September 12, 2000 18:43

Re: How to get a formula from data.

Plot the data in a spreadsheet like excel. Now using excel graph plotting join the points with a line through the data. It might be linear, non-linear, exponential, power law, semi-log etc, etc.

Depending on what type of curve you choose, excel will automatically display the formula of the st-line or non-linear curve which you see on the plot.

Hope it helps.

 Q.Ronnie September 13, 2000 00:28

Re: How to get a formula from data.

Thank you indeed. But i still don`t know how to extend one variable to multiple variables. And would you please tell me what bibliography should I refer to. I`am sorry for wasting your time.

 A. Taurchini September 13, 2000 03:49

Re: How to get a formula from data.

Application like Excel and so on do exactly what I said, but of course they are useful for statistical data (spreadsheet were firstly made for economical study) but not at all for mathematical. I mean, does Excel give you the error of your (its...) approximation ? Of course NOT ! This means that for simple and rough study Excel it's good, but if you need some relevant data to compare with others you have to proceed with an interpolation scheme (usually more complex than what Excel can do).

The extension to multiple variable means you have to build a complete polinomial, like this (two variable x1,x2)

a0+a1(x1)+a2(x2)+a3(x1)^2+a4(x2)^2+a5(x1)(x2)+... =y

Bibliography. I may advise you a lot of books but none is in english (Italian, Russian ...), you'll find more explanation on every book of numerical methods. You may even search over the net ... As a first step try www.efunda.com/math/num_interpolation/num_interpolation.cfm

Bye.

 Q.Ronnie September 13, 2000 04:37

I really appreciate.

 Steve Amphlett September 13, 2000 07:33

Re: How to get a formula from data.

The best book I've found on this topic is by far:

INTRODUCTION TO LINEAR REGRESSION ANALYSIS Douglas C Montgomery & Elizabeth A Peck

AFFILIATION: Arizona State University; Coca-Cola Company

SOURCE: (New York City, New York, USA; John Wiley, 1992, Wiley series in probability and mathematical statistics - applied probability and statistics, 2nd ed., 540pp.)

- most of their stuff can be implemented quite easily in MATLAB.

 A.Hassaneen September 13, 2000 09:57

Re: I really appreciate.

Beside all the aforementioned suggestions, I meight recommend you to read about the subject in one of the "deisgn of experiment" book. Also, if you have an access to one of the statistical packages (for example: SPSS or MINITAB) I was using the later for something like what you are looking for. Good luck

 Hasib Iqbal September 13, 2000 21:43

HELP!!!

Dear CFD user,

I am totally new to CFD and would very much appreciate if you could possibly give me an idea of any books that are at a beginner level. Also any books that cover CFD for sprays.

Thanks

 A.Hassaneen September 14, 2000 03:25

Re: HELP!!!

I meight suggest the book"Numerical Heat Transfer and Fluid Flow" by Patankar.

 Lex September 14, 2000 05:09

Re: Interpolation

Hi You see I'm working at the same problem First of all you should know what for do you need this formula!!! If only for graphical demonstration - for example You don't need it at all :)) As for me I prefer to work with splines they are just easier to use! For example using polinoms you can have problems with finding coefficients!!! You have to solve the linear system and so on May be Matlab will be enough for your purposes I don't know So if you are interested you can mail me for soon I'll have some source code and sure have some more ideas.

Yours Lex.Privalov

 clifford bradford September 17, 2000 00:28

Re: How to get a formula from data.

perhaps the best thing would be for you to acquire som software package that does this right off the top of my head i can't think of one but you can check in ASME's "mechanical engineer" there's a software advertised each month in here that does this kind of thing. also you mathematician statistician friends can recommend one to you or any techniques to do it yourself.

 kakollu September 25, 2000 13:30

Re: Interpolation

besides, polynomial fitting can lead to oscilations, so it is better to use splines!

 All times are GMT -4. The time now is 13:26.