Math Is Fun Forum

  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#51 2011-07-08 02:07:20

Old_Trafford
Member
Registered: 2011-07-04
Posts: 44

Re: Finding the equation from a set of numbers

these are problematic measurements and can be omitted

Offline

#52 2011-07-08 02:13:03

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Finding the equation from a set of numbers

Do you want them all removed?


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#53 2011-07-08 02:13:09

Old_Trafford
Member
Registered: 2011-07-04
Posts: 44

Re: Finding the equation from a set of numbers

did you get the final equation?

Offline

#54 2011-07-08 02:15:13

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Finding the equation from a set of numbers

Not yet, I need to know about removing those data triplets that start with .741

Do you want them all removed or one left?


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#55 2011-07-08 02:15:31

Old_Trafford
Member
Registered: 2011-07-04
Posts: 44

Re: Finding the equation from a set of numbers

Yes, remove all of the (0.741) values

Offline

#56 2011-07-08 02:17:46

Old_Trafford
Member
Registered: 2011-07-04
Posts: 44

Re: Finding the equation from a set of numbers

These are values for the night, where there is no sun. We dont need them for our equation.

Offline

#57 2011-07-08 02:26:26

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Finding the equation from a set of numbers

You have some more .834 etc. Do you want to delete the data for all cases where column A is less than 1?


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#58 2011-07-08 02:28:08

Old_Trafford
Member
Registered: 2011-07-04
Posts: 44

Re: Finding the equation from a set of numbers

Delete all the numbers where column A is less than 150

Offline

#59 2011-07-08 02:28:31

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Finding the equation from a set of numbers

Very good, will do.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#60 2011-07-08 02:29:16

Old_Trafford
Member
Registered: 2011-07-04
Posts: 44

Re: Finding the equation from a set of numbers

Thanks

Offline

#61 2011-07-08 02:31:37

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Finding the equation from a set of numbers

That leaves 2176 triplets of data.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#62 2011-07-08 02:32:34

Old_Trafford
Member
Registered: 2011-07-04
Posts: 44

Re: Finding the equation from a set of numbers

Good

Offline

#63 2011-07-08 02:57:31

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Finding the equation from a set of numbers

Fit done, testing residuals.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#64 2011-07-08 03:07:05

Old_Trafford
Member
Registered: 2011-07-04
Posts: 44

Re: Finding the equation from a set of numbers

ok

Offline

#65 2011-07-08 03:10:46

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Finding the equation from a set of numbers

A linear fit is not doing a very good job. I am getting a maximum residual of about 558. This is very large! It is occuring for this triplet.

{27.3185,33.185,1139.932}

k=16.68982487483329


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#66 2011-07-08 03:24:18

Old_Trafford
Member
Registered: 2011-07-04
Posts: 44

Re: Finding the equation from a set of numbers

what do you mean residual?

Offline

#67 2011-07-08 03:39:03

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Finding the equation from a set of numbers

The formula A = B + 16.68982487483329 C will compute values for A given a B and a C. Those values will not be exact. For instance lets take the first data set.

The exact C is 508.463

78.55049277904726 that is the residual. The difference between the exact answer and the computed one.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#68 2011-07-08 03:39:49

Old_Trafford
Member
Registered: 2011-07-04
Posts: 44

Re: Finding the equation from a set of numbers

that seems to be a very big problem. How can this be fixed?

Last edited by Old_Trafford (2011-07-08 03:40:06)

Offline

#69 2011-07-08 03:44:59

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Finding the equation from a set of numbers

Not everything can be fit by a linear equation. We call A = B + 16.68982487483329 C the model. It is obviously not the underlying law for your data. To get a good fit is just as much luck, art and skill.

Looking at a plot of the data you provided I would say either the measurements have so much noise that they are drowning out the correct signal. Or the model ( law ) is complicated.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#70 2011-07-08 03:45:49

Old_Trafford
Member
Registered: 2011-07-04
Posts: 44

Re: Finding the equation from a set of numbers

if we try to get a A=LxB+KxC, will it get better? I mean, if we add a factor L and multiply it by B.

Last edited by Old_Trafford (2011-07-08 03:46:23)

Offline

#71 2011-07-08 03:49:38

Old_Trafford
Member
Registered: 2011-07-04
Posts: 44

Re: Finding the equation from a set of numbers

also, can you please mail me the mathematica file?

Offline

#72 2011-07-08 03:53:47

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Finding the equation from a set of numbers

All fits can be improved by adding more parameters. This is true right up until you would have one less parameter than data sets. Then you would have an exact fit, called an interpolation.

That is very much like using a cannon to kill a mosquito, sure you will get him, but what did you prove?

There are also other types of fits besides a least squares one that was used here. There is package that I developed that uses the so called minimax fits.

I will play with it if you want. In the end I will turn over the best result possible and the commands that get it.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#73 2011-07-08 03:56:46

Old_Trafford
Member
Registered: 2011-07-04
Posts: 44

Re: Finding the equation from a set of numbers

Please do try to make it better. But first can you send me the mathematica file so i can play too? Thank you

Offline

#74 2011-07-08 04:10:11

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Finding the equation from a set of numbers

What version of mathematica do you have?


Put your spreadsheet file on your desktop.
This command will bring it in to mathematica.

data=Import["C:\\Documents and Settings\\Owner\\Desktop\\PV thermal.xlsx",{"Data",1,Range[5,4536],{3,4,5}}];

Then enter and run these.

data=Select[data,First[#]>=150&];
data=RotateLeft[#]&/@data;

Data is now pruned and in correct order.

model=b+k*c;
fit=FindFit[data,model,{k},{b,c}]

residuals[l_]:=Abs[l[[3]]-(l[[1]]+16.689824874833292  l[[2]])]

r=residuals[#]&/@data;

Use this command to find the biggest residual. The smaller this is the better.

Max[r]

Take a look at your data with this command.

ListPlot3D[data]


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#75 2011-07-08 04:16:28

Old_Trafford
Member
Registered: 2011-07-04
Posts: 44

Re: Finding the equation from a set of numbers

mathematica 8. i will try these...

Offline

Board footer

Powered by FluxBB