Click to See Complete Forum and Search --> : [RESOLVED] Curve Fitting
sgrya1
May 12th, 2008, 02:41 PM
Hi all.
I need to fit a parabola to some constraints. Again.
I know one point on the curve (x1,y1)
I know that the gradient at that point is 0.
I know the radius of curvature of that parabola.
y=ax²+bx+c (1)
y’=2ax+b (2)
y’’=2a (3)
Curvature = 1/Radius (4)
(3)=(4)
2a=1/Radius
a=1/(2*Radius) (5)
Gradient=0 so from (2) and substituting (5)
0=2*1/(2*Radius) * X1 + b
b=-x1/Radius (6)
At the known point x1,y1, from (1) substituting (5) and (6)
y1=1/(2*Radius)*(x1)²-x1/Radius*x1+c
y1=(x1)²/(2*Radius) - (x1)²/Radius+c
y1=(x1)²/(2*Radius) - 2 (x1)²/(2*Radius)+c
y1=-(x1)²/(2*Radius)+c
c=y1+(x1)²/(2*Radius)
Now say x1=8000 y1=250 Radius=-5500
a=-0.0001
b=1.4545
c=-5568
So the equation of the curve is:
y=-0.0001x²+1.4545x-5568
So why does
y=-0.0001*(8000)²+1.4545*8000-5568=-332 when it should equal 250
Where have I gone wrong?
sgrya1
May 12th, 2008, 02:59 PM
The radius is not negative there but the curvature should be -ve. Regardless, I still have the problem.
sgrya1
May 12th, 2008, 03:34 PM
Sorry. Haven't worked out quite why yet but I have worked it out.
VBAhack
May 13th, 2008, 02:03 PM
y=-0.0001*(8000)²+1.4545*8000-5568=-332 when it should equal 250. Where have I gone wrong?
Hi, the culprit is rounding, particularly for a. Rounding -0.0000909090909090909 to -.0001 introduces substantial error. For b, 5 significant digits were retained. For c, 4 significant digits were retained. If 5 significant digits are retained for a (i.e. -9.0909E-5), the answer is 249.8, which is a lot closer to the exact value.
P.S. One additional comment. Be careful about relating radius of curvature to y". The expression for radius of curvature is R = [(1 + y'^2)^1.5]/y". If y' is small, then 1/y" approximates the radius of curvature. In your case, y' = 0, so it works. For more info see:
http://mathworld.wolfram.com/RadiusofCurvature.html
sgrya1
May 13th, 2008, 10:54 PM
Hi VBAHack.
Thanks for that! I hadn't actually worked it out.
I was trying to cross check an excel sheet by hand and just couldn't understand what the problem was. The rounding makes perfect sense now that I look at the large number (8000²) and small fraction (0.0001) that were being multipled. I corrected something else in the spreadsheet which made me think that I had solved it.
I'll have to look into the curvature thing. At the moment everything looks fine with the approximation. That being because tendons are typically in thin slabs having long spans. I will need to adjust it though as I don't know how accurate it will be for the tendon profile in a deep beam for instance where the gradients are a lot larger.
Catch 22 with that though. I need the radii to determine the equations. And I need the equations to determine the radii. Might need to give that one some thought.
VBAhack
May 14th, 2008, 02:03 PM
I'll have to look into the curvature thing. At the moment everything looks fine with the approximation. That being because tendons are typically in thin slabs having long spans. I will need to adjust it though as I don't know how accurate it will be for the tendon profile in a deep beam for instance where the gradients are a lot larger.
Catch 22 with that though. I need the radii to determine the equations. And I need the equations to determine the radii. Might need to give that one some thought.
Actually, calculating y" is a straightforward if you know or can estimate the gradient and radius of curvature.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.