# Thread: Determining Formula for a graph

1. Thanks for the code, its amazing!
but.... even after I pluged the real values for x (you can even check the file "math graph.pdf" in the first post to check) its still badly conditioned, and there is no graph :-(

Open this attachment to see the problem.

Edit: Guys its ok, this project took me alot of time (you have no idea, so I'll just tell the teacher that I tried, I screw it if I get a bad grade in this project, I did my best)
Thanks for the help

2. I have a suggestion: reset your time origin. It looks like your t axis is in years (1981, 1982, etc.). So, instead of plugging in 1988, which you must then raise to the 8th power, try a time axis shift: tau = t - 1980. Now, you'll be plugging in the small tau's to be exponentiated, instead of the large years. That might help condition the matrix a bit. For example, using the code

f[x_] := Aye x^8 + Bee x^7 + Cee x^6 + Dee x^5 + Eee x^4 + Eff x^3 + Gee x^2 + H x + Eye;
Solve[{f[0] == 426.8, f[1] == 470.2, f[2] == 503.4, f[3] == 557.3, f[4] == 564.7, f[5] == 575.4, f[6] == 579.8, f[7] == 624.7, f[8] == 669.9}, {Aye, Bee, Cee, Dee, Eee, Eff, Gee, H, Eye}]

Mathematica spit out an answer that did not suffer from being ill-conditioned. Now, you can re-shift your answer back to find the correct numbers with the years.

3. You are a genious!
I literally tried EVERYTHING EXCEPT THAT!
Thank you *10^1000000000

4. Okay, one last thing.....
I managed to find the formula for secton A of the graph, so do I do the same for the rest of the sections? Is there a way to "join" three graphs to make a graph passing through every point?
Thanks

5. Um.. okay. I think that if you want to put a single graph... you can try putting a polynomial of degree 26

6. Ow, I see..
Thanks!

haha I will use up all the letters of the alphabet, but I need 1 more!

7. Originally Posted by IBstudent
Ow, I see..
Thanks!

haha I will use up all the letters of the alphabet, but I need 1 more!
This is why access to several other alphabets (such as the Greek and Hebrew) is useful for obscuring what you're trying to do...

Alternatively, you could simply use an indexing scheme.

8. ## Re: Determining Formula for a graph

Originally Posted by HallsofIvy
There are 9 points so you can fit a unique 8th degree polynomial through those nine points. One way to do that is what Prove It suggested: $\displaystyle y= ax^8+ bx^7+ cx^6+ dx^5+ ex^4+ fx^3+ gx^2+ hx+ i$. Putting the x and y values of the 9 points into that gives 9 equations to solve for the 9 numbers a, b, c, d, e, f, g, h, and i.
hhhmmm interesting post. May I ask what is the mechanism behind only 8th degree polynomial required for 9 points. Is it to do with the constant which cuts the y axis?

Thanks

Bugatti the Lurker.

9. ## Re: Determining Formula for a graph

Originally Posted by bugatti79
hhhmmm interesting post. May I ask what is the mechanism behind only 8th degree polynomial required for 9 points. Is it to do with the constant which cuts the y axis?

Thanks

Bugatti the Lurker.
Two points - one straight line fits exactly
Three points - one quadratic fits exactly
Four points - one cubic fits exactly
Five points - one quartic fits exactly...

The polynomial that fits the points exactly is always one less degree than the number of points.

Page 2 of 2 First 12